Class ActionSelector

java.lang.Object
edu.tufts.hrilab.action.selector.ActionSelector
Direct Known Subclasses:
GoalPlanningActionSelector, MCTSActionSelector, PreconditionPlanningSelector, RandomActionSelector, TypedActionSelector, UtilitarianActionSelector

public abstract class ActionSelector extends Object
  • Field Details

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • ActionSelector

      protected ActionSelector()
      Protected to prevent instantiation except by subclasses.
  • Method Details

    • getInstance

      public static ActionSelector getInstance()
      Get the action selector instance.
      Returns:
      the singleton instance of an actionSelector
    • setActionSelectorType

      public static void setActionSelectorType(String type)
      Helper method to convert string form of ActionSelector type (e.g., classpath) into a Class object and set the ActionSelector type.
      Parameters:
      type -
    • setActionSelectorType

      public static boolean setActionSelectorType(Class<? extends ActionSelector> type)
      Set the action selector type.
      Parameters:
      type - the action selector to use, a subclass of this class
      Returns:
      success / failure (it can't be set after instance has been constructed)
    • getCandidateActions

      protected static final List<ParameterizedAction> getCandidateActions(Goal goal, ActionConstraints constraints, StateMachine stateMachine)
      this can be used by action selectors (subclasses) get all of the currently available actions that satisfy a goal
      Parameters:
      goal - the goal to be satisfied by returned actions
      Returns:
      list of actions that accomplish the goal
    • selectActionForGoal

      public abstract ParameterizedAction selectActionForGoal(Goal goal, ActionConstraints constraints, StateMachine stateMachine)
      the main job of action selectors (subclasses) is to implement this function
      Parameters:
      goal - the goal that the selected action should accomplish
      constraints - a returned goal should satisfy any constraints
      stateMachine - in case the action selector cares about the state
      Returns:
      an action that accomplishes goal, satisfies constraints
    • selectActionForCommand

      public ActionDBEntry selectActionForCommand(Symbol actor, String command, List<String> inputArguments, ActionConstraints constraints, StateMachine stateMachine)