Package com.embabel.agent.core.support
Class AbstractAction
-
- All Implemented Interfaces:
-
com.embabel.agent.core.Action,com.embabel.agent.core.ActionRunner,com.embabel.agent.core.AgentSystemStep,com.embabel.agent.core.DataDictionary,com.embabel.agent.core.DataFlowStep,com.embabel.agent.core.Operation,com.embabel.agent.core.ToolGroupConsumer,com.embabel.common.core.types.Described,com.embabel.common.core.types.HasInfoString,com.embabel.common.core.types.Named,com.embabel.common.core.types.NamedAndDescribed,com.embabel.plan.Action,com.embabel.plan.Step,com.embabel.plan.common.condition.ConditionAction,com.embabel.plan.common.condition.ConditionStep
public abstract class AbstractAction implements Action
Abstract action implementation that computes outputs.
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<String, ConditionDetermination>preconditionsprivate final Map<String, ConditionDetermination>effectsprivate final Stringnameprivate final Stringdescriptionprivate final List<String>preprivate final List<String>postprivate final Function1<WorldState, Double>costprivate final Function1<WorldState, Double>valueprivate final Set<IoBinding>inputsprivate final Set<IoBinding>outputsprivate final Set<ToolGroupRequirement>toolGroupsprivate final BooleancanRerunprivate final BooleanreadOnlyprivate final ActionQosqosprivate final Collection<DomainType>domainTypesprivate final Set<String>knownConditionsprivate final Collection<DynamicType>dynamicTypesprivate final Collection<JvmType>jvmTypes
-
Constructor Summary
Constructors Constructor Description AbstractAction(String name, String description, List<String> pre, List<String> post, Function1<WorldState, Double> cost, Function1<WorldState, Double> value, Set<IoBinding> inputs, Set<IoBinding> outputs, Set<ToolGroupRequirement> toolGroups, Boolean canRerun, Boolean readOnly, Boolean clearBlackboard, ActionQos qos)
-
Method Summary
Modifier and Type Method Description Map<String, ConditionDetermination>getPreconditions()Conditions that must be true for this step to execute Map<String, ConditionDetermination>getEffects()Expected effects of this action. StringgetName()StringgetDescription()final List<String>getPre()final List<String>getPost()Function1<WorldState, Double>getCost()Function1<WorldState, Double>getValue()Function to compute the value of completing this step. Set<IoBinding>getInputs()Set<IoBinding>getOutputs()Set<ToolGroupRequirement>getToolGroups()Tool groups exposed. BooleangetCanRerun()BooleangetReadOnly()ActionQosgetQos()-
Methods inherited from class com.embabel.agent.core.Action
getDomainTypes, infoString, shortName -
Methods inherited from class com.embabel.plan.common.condition.ConditionStep
getKnownConditions, isAchievable -
Methods inherited from class com.embabel.agent.core.DataDictionary
allowedRelationships, domainTypeForLabels, excluding, excluding, filter, getDynamicTypes, getJvmTypes, minus, minus, plus -
Methods inherited from class com.embabel.plan.Action
netValue -
Methods inherited from class com.embabel.agent.core.ActionRunner
execute, referencedInputProperties -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractAction
AbstractAction(String name, String description, List<String> pre, List<String> post, Function1<WorldState, Double> cost, Function1<WorldState, Double> value, Set<IoBinding> inputs, Set<IoBinding> outputs, Set<ToolGroupRequirement> toolGroups, Boolean canRerun, Boolean readOnly, Boolean clearBlackboard, ActionQos qos)
- Parameters:
name- the name of the actiondescription- a description of the actionpre- a list of preconditions.post- a list of expected effects.cost- the cost of the actioninputs- the input bindingsoutputs- the output bindingscanRerun- can we rerun this action?readOnly- does this action have no external side effects?qos- quality of service requirements
-
-
Method Detail
-
getPreconditions
Map<String, ConditionDetermination> getPreconditions()
Conditions that must be true for this step to execute
-
getEffects
Map<String, ConditionDetermination> getEffects()
Expected effects of this action. World state should be checked afterward as these effects may not have been achieved
-
getDescription
String getDescription()
-
getCost
Function1<WorldState, Double> getCost()
-
getValue
Function1<WorldState, Double> getValue()
Function to compute the value of completing this step. From 0 (least valuable) to 1 (most valuable) Steps with 0 value will still be planned if necessary to achieve a result
-
getOutputs
Set<IoBinding> getOutputs()
-
getToolGroups
Set<ToolGroupRequirement> getToolGroups()
Tool groups exposed. This will include directly registered tool groups and tool groups resolved from ToolGroups.
-
getCanRerun
Boolean getCanRerun()
-
getReadOnly
Boolean getReadOnly()
-
-
-
-