|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.episodic.memory.AgentMemory
public class AgentMemory
AgentMemory is the main class of this project and integrates
all the information agent remembers. Its main parts are: decision tree
mirroring the decision nodes from pogamut end project, chronobags containing
memories of episodes group together on temporal basis and schemas integrating
all the episodes experienced by an agent into the average episodes.
Before agent memory can be used, it needs to be initialized by providing the content of the decision tree. Then each time agent performs an action new nodes are added into the memory structures. Memory nodes are forgotten during the reorganization process that is triggered once a day when the agent goes to sleep.
| Field Summary | |
|---|---|
Semaphore |
sem
|
static boolean |
visualize
Parameter determining if the visualization components should be displayed while agent's memory is running. |
| Constructor Summary | |
|---|---|
AgentMemory()
|
|
| Method Summary | |
|---|---|
boolean |
addNewNode(String atomicAction,
ArrayList<String> trace,
ArrayList<AffordanceUsed> affordances)
This method should be called each time agent executes an atomic action. |
boolean |
addNewNode(String atomicAction,
ArrayList<String> trace,
String time,
ArrayList<AffordanceUsed> affordances)
This method should be called each time agent executes an atomic action. |
void |
addVisualizationListener(IVisualizationListener listener)
|
void |
fireVisualizationEvent(VisualizationEvent event)
|
void |
generateStatistics(String fileName)
Generates a csv file with information how different goals were satisfied. |
Collection<Chronobag> |
getChronobags()
|
Map<Integer,Chronobag> |
getChronobagSequenceEnds()
|
DecisionTree |
getDecisionTree()
Getter method for the decisionTree. |
IdGenerator |
getIdGenerator()
|
Integer |
getLastEpisodeId()
|
HashSet<Chronobag> |
getPastChrononags()
|
Chronobag |
getPresentChronobag()
|
SchemaBag |
getSchemaBag()
|
void |
initialize(Collection<Intention> topLevelGoals)
Creates the decision tree structure based on the trees representing decision plans for top-level goals received in a parameter. |
void |
initVisualizers()
|
boolean |
nodeFinished(String node,
ArrayList<String> trace,
boolean succeeded)
Marks specified episodic node as finished. |
void |
registerNewPastChronobag(Chronobag c)
Each time new past chronobag is created it has to be added to the set of all past chronobags. |
void |
removeVisualizationListener(IVisualizationListener listener)
|
void |
reviewActiveIntentions(ArrayList<String> list)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Semaphore sem
public static boolean visualize
| Constructor Detail |
|---|
public AgentMemory()
| Method Detail |
|---|
public void addVisualizationListener(IVisualizationListener listener)
public void removeVisualizationListener(IVisualizationListener listener)
public void fireVisualizationEvent(VisualizationEvent event)
public DecisionTree getDecisionTree()
decisionTree.
DecisionTree structure
in agent's memory.public IdGenerator getIdGenerator()
public void initialize(Collection<Intention> topLevelGoals)
initialize in interface IAgentMemorytopLevelGoals - List of Intention structures
representing possible top-level goals of agent. They are roots of
already complete trees consisting of intentions, actions and
atomic actions.public void initVisualizers()
public boolean addNewNode(String atomicAction,
ArrayList<String> trace,
ArrayList<AffordanceUsed> affordances)
EpisodeNodes into the Episode.
It invokes the equivalent method in current chronobag and pass it all the
parameters, then it finds (or creates) the current Episode
according to the top level goal in trace. And invokes the addNewNode
method on that episode while passing it the same parameters.
addNewNode in interface IAgentMemoryatomicAction - Name of an atomic action that was executed.trace - List of names of decision nodes that lead to
the atomic action executed. The top-level goal is first in the list and
parent of atomic action is last item in the list.affordances - List of AffordanceUsed objects.
Each object represent one filled affordance slot that was
needed for the execution of current atomic action.
public boolean addNewNode(String atomicAction,
ArrayList<String> trace,
String time,
ArrayList<AffordanceUsed> affordances)
EpisodeNodes into the Episodes.
It invokes the equivalent method in current chronobag and pass it all the
parameters, then it finds (or creates) the current Episode
according to the top level goal in trace. And invokes the addNewNode
method on that episode while passing it the same parameters.
In case agent has started the sleep action for the first time in a day memory reorganization process is also triggered.
All visualizations are refreshed according to new contents of agent's memory.
atomicAction - Name of an atomic action that was executed.trace - List of names of decision nodes that lead to
the atomic action executed. Parent of atomic action is first in the list and
top-level goal is last item in the list.time - String containing information about the time of execution
of the atomic action. Its format should be: "Fr, 03:44, day 12."affordances - List of AffordanceUsed objects.
Each object represent one filled affordance slot that was
needed for the execution of current atomic action.
public boolean nodeFinished(String node,
ArrayList<String> trace,
boolean succeeded)
currentEpisodes list of current chronobags
to finishedEpisodes list.
node - Name of a node that was finished.trace - Names of traces nodes that lead to the finished node,
beginning with top-level goal and ending with node's parent.
Should be empty if node itself is top-level goal.succeeded - True if node was finished successfully.
public void registerNewPastChronobag(Chronobag c)
pastSequenceEnds references.
c - Reference to the newly created chronobag.public SchemaBag getSchemaBag()
public void reviewActiveIntentions(ArrayList<String> list)
public Collection<Chronobag> getChronobags()
public Map<Integer,Chronobag> getChronobagSequenceEnds()
public Chronobag getPresentChronobag()
public HashSet<Chronobag> getPastChrononags()
public void generateStatistics(String fileName)
public Integer getLastEpisodeId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||