Class PolycraftRLComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.polycraft.PolycraftRLComponent

public class PolycraftRLComponent extends DiarcComponent
  • Constructor Details

    • PolycraftRLComponent

      public PolycraftRLComponent()
  • Method Details

    • parseArgs

      protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine)
      Description copied from class: DiarcComponent
      Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs
      Overrides:
      parseArgs in class DiarcComponent
    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      Returns:
    • init

      public void init()
      Description copied from class: DiarcComponent
      Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.
      Overrides:
      init in class DiarcComponent
    • collectOriginalActionSet

      public void collectOriginalActionSet()
    • initializeRL

      public String initializeRL(String failedAction)
    • executeRL

      public String executeRL(String failedAction, String lastAction, boolean actionResult)
    • getState

      public PolycraftRLComponent.GameState getState(String failedAction, String action, boolean actionResult)
    • setGameOver

      public void setGameOver(boolean goalAchieved)
      Notify RL when a game is over, and also set isGameOver flag to exit out of local RL execution loop.
      Parameters:
      goalAchieved -
    • executeRL

      public Justification executeRL(Symbol actor, Predicate brokenActionPredicate, Symbol brokenActionStatus, Predicate failurePredicate)
      Main RL entry point for DIARC.

      NOTE: this should ALWAYS return a TRUE justification to indicate that RL was successfully attempted. Otherwise, goal recovery can enter infinitely nested RL episodes (i.e., executeRL(executeRL(exuteRL(...))).