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 ofadbebut with the name fromactionLearningState(Predicate predicate) LearningState(Predicate signature, LearningState previousLearningState) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCondition(Condition toAdd) voidaddEventSpec(int index, Predicate p) Add EventSpec described bypatindexvoidMain entry point method for adding new event specs ot learning statevoidGenerates a new ActionDBEntry and adds it to the Database.intgetEventStepLocation(Predicate reference) Helper method to find the action step matching the reference step.intgetIndexGivenConstraints(Predicate location, Predicate modification) intgetIndexOfConstraint(Predicate locationConstraint) getName()getRoles()voidremoveCondition(Condition toRemove) voidremoveEffect(Effect toRemove) voidremoveEventSpec(int index) voidremoveEventSpec(int index, String lvToUpdate) void
-
Constructor Details
-
LearningState
-
LearningState
-
LearningState
Generates a new LearningState which is a copy ofadbebut 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 bypatindex- 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
-