Package edu.tufts.hrilab.action.selector
Class ActionSelector
java.lang.Object
edu.tufts.hrilab.action.selector.ActionSelector
- Direct Known Subclasses:
GoalPlanningActionSelector
,MCTSActionSelector
,PreconditionPlanningSelector
,RandomActionSelector
,TypedActionSelector
,UtilitarianActionSelector
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Protected to prevent instantiation except by subclasses. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 goalstatic ActionSelector
Get the action selector instance.selectActionForCommand
(Symbol actor, String command, List<String> inputArguments, ActionConstraints constraints, StateMachine stateMachine) abstract ParameterizedAction
selectActionForGoal
(Goal goal, ActionConstraints constraints, StateMachine stateMachine) the main job of action selectors (subclasses) is to implement this functionstatic boolean
setActionSelectorType
(Class<? extends ActionSelector> type) Set the action selector type.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.
-
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
Get the action selector instance.- Returns:
- the singleton instance of an actionSelector
-
setActionSelectorType
Helper method to convert string form of ActionSelector type (e.g., classpath) into a Class object and set the ActionSelector type.- Parameters:
type
-
-
setActionSelectorType
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 accomplishconstraints
- a returned goal should satisfy any constraintsstateMachine
- 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)
-