Package edu.tufts.hrilab.action.learning
Class LearningState
java.lang.Object
edu.tufts.hrilab.action.learning.LearningState
LearningState is used to store relevant information during learning of a new action (task or skill), including
the roles (argument and local variables), action steps, effects (success and failure), conditions (pre and operational),
also contains additional information about skills and instructions
This class is modified by the ActionLearning class
-
Constructor Summary
ConstructorsConstructorDescriptionLearningState
(ActionDBEntry adbe, Predicate action) Generates a new LearningState which is a copy ofadbe
but with the name fromaction
LearningState
(Predicate predicate) LearningState
(Predicate signature, LearningState previousLearningState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCondition
(Condition toAdd) void
addEventSpec
(int index, Predicate p) Add EventSpec described byp
atindex
void
Main entry point method for adding new event specs ot learning statevoid
Generates a new ActionDBEntry and adds it to the Database.int
getEventStepLocation
(Predicate reference) Helper method to find the action step matching the reference step.int
getIndexGivenConstraints
(Predicate location, Predicate modification) int
getIndexOfConstraint
(Predicate locationConstraint) getName()
getRoles()
void
removeCondition
(Condition toRemove) void
removeEffect
(Effect toRemove) void
removeEventSpec
(int index) void
removeEventSpec
(int index, String lvToUpdate) void
-
Constructor Details
-
LearningState
-
LearningState
-
LearningState
Generates a new LearningState which is a copy ofadbe
but with the name fromaction
- Parameters:
adbe
- ActionDBEntry to cloneaction
- signature predicate representing new action
-
-
Method Details
-
getName
-
getDescription
-
getPreviousLearningState
-
getConditions
-
addCondition
-
removeCondition
-
addEffect
-
removeEffect
-
getEffects
-
getRoles
-
getEventSpecs
-
addEventSpec
Add EventSpec described byp
atindex
- Parameters:
index
- index in learning state at which to insert new EventSpecp
- Predicate description of new Event spec
-
removeEventSpec
public void removeEventSpec(int index) -
removeEventSpec
-
removeEventSpecsForLocalVariable
-
getEventStepLocation
Helper method to find the action step matching the reference step.- Parameters:
reference
- predicate defining reference event spec- Returns:
-
createEventSpec
Main entry point method for adding new event specs ot learning state- Parameters:
g
- goal to generate event spec for
-
getIndexOfConstraint
- Parameters:
locationConstraint
- constraint predicate of the form before(X), after(X), and(X,Y)- Returns:
- index of first step/before or after constraint
-
getIndexGivenConstraints
- Parameters:
location
-modification
-- Returns:
- index of @modification, constrained by @location
-
generateActionDBEntry
public void generateActionDBEntry()Generates a new ActionDBEntry and adds it to the Database. Iterates through the learning queue and creates events and roles for new action
-