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

java.lang.Objectcz.cuni.amis.pogamut.episodic.episodes.EpisodeNode
public class EpisodeNode
The EpisodeNode is what represents the memory of an action
being executed. Episode node is memorized equivalent of Intention,
Action or AtomicAction from decision tree.
It can have several subnodes. Node wihout subnodes is an atomic action. Node without parent is a top-level goal. Actions and intentions may have associated affordance slots that have to be filled in order to successfully finish the action.
A tree made of EpisodeNodes is what makes the basis of any
Episode.
| Field Summary | |
|---|---|
boolean |
finished
Indicator whether this node was correctly finished. |
boolean |
succeeded
Indicator whether this node was successfully finished. |
| Constructor Summary | |
|---|---|
EpisodeNode(EpisodeNode other,
EpisodeNode parent,
Episode e)
|
|
EpisodeNode(String _name,
EpisodeNode _parent,
Episode _root,
Node associated)
Instantiate the class by providing its name, reference to a parent EpisodeNode, parent Episode and associated
decision node. |
|
| Method Summary | |
|---|---|
boolean |
addChildNode(String name)
This method adds a new subnode to the list of node's children. |
boolean |
addChildNode(String name,
String time)
|
void |
addSlot(String type)
A method that attaches new affordance slot to the current episodic node. |
double |
calculateScore()
Method used to compute new score of a node. |
int |
compareTo(EpisodeNode o)
Compares two episode nodes based on the timeStart attribute. |
EpisodeNode |
createCopy(EpisodeNode parent,
Episode e)
|
void |
deleteNode()
|
void |
deleteNode(boolean skipChecks)
|
EpisodeNode |
deriveChildrenAndSlots(Collection<SchemaEpisodeNode> traceSchemaNodes,
Collection<SlotContent> schemaContents)
|
EpisodeNode |
deriveNodeTrace()
|
void |
fillSlot(String type,
String item)
Fills specified slot with a specified item. |
boolean |
finishNode(String node,
ArrayList<String> trace,
boolean _succeeded)
Marks specified episodic node as finished. |
void |
fullDelete(boolean episodeDeleted)
Deletes the node and all its subnodes. |
Node |
getAssociatedNode()
Getter method for the id variable. |
EpisodeNode |
getChild(String name)
Method that returns specified EpisodeNodes that is direct
subnode of this node in the episode tree. |
Collection<EpisodeNode> |
getChildrenNodes()
Returns all EpisodeNodes that are subnodes of this node
in the episode tree. |
Episode |
getEpisodeRoot()
Getter method for the root variable. |
Map<Integer,EpisodeNode> |
getFirstChild()
Getter method for the firstChild variable. |
int |
getId()
Getter method for the id variable. |
String |
getName()
Getter method for the name variable. |
int |
getNumberOfSubNodes()
|
int |
getNumberOfSubNodesWithObjects()
|
ObjectSlot |
getObjectSlot(String type)
Method returning one specified objectSlot attached to this
episodic node. |
Collection<ObjectSlot> |
getObjectSlots()
Getter method for the slots variable. |
EpisodeNode |
getParent()
Getter method for the id variable. |
Map<Integer,EpisodeNode> |
getPredecessor()
Getter method for the predecessor variable. |
double |
getScore()
Getter method for the score variable. |
int |
getStartTime()
|
Map<Integer,EpisodeNode> |
getSuccessor()
Getter method for the successor variable. |
EpisodeNode |
mergeWith(EpisodeNode other)
Merges current node with other node. |
int |
numberOfCommonSubNodesWithObjects(EpisodeNode other)
Calculates number of common episodic subnodes and common objects used in slots on these nodes. |
void |
recalculateTreeSize(boolean validate)
|
String |
toString()
Returns a String object representing this
EpisodeNode's info. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean finished
Nodes in finished episodes can contain unfinished nodes if they were interrupted in an unusual way (top-level goal suddenly disappeared from short-term memory).
public boolean succeeded
| Constructor Detail |
|---|
public EpisodeNode(String _name,
EpisodeNode _parent,
Episode _root,
Node associated)
EpisodeNode, parent Episode and associated
decision node.
The ID of a chronobag is also generated in constructor.
_name - Name of the node._parent - Reference to parent EpisodeNode._root - Reference to parent Episode.associated - Reference to associated decision node.
public EpisodeNode(EpisodeNode other,
EpisodeNode parent,
Episode e)
| Method Detail |
|---|
public String toString()
String object representing this
EpisodeNode's info. It is used to provide detailed
information about a node when it is invoked from
the visualization structures.
toString in class Object
public boolean finishNode(String node,
ArrayList<String> trace,
boolean _succeeded)
node - Name of a node that was finished.trace - Names of traces nodes that lead to the finished node,
beginning with child of current node. Should be empty if node
to be finished is current node.succeeded - True if node was finished successfully.
public int getId()
id variable.
public int numberOfCommonSubNodesWithObjects(EpisodeNode other)
other - Root of the other subtree. (This node being root of
the first one).
public String getName()
name variable.
public EpisodeNode getParent()
id variable.
EpisodeNode in the episode tree.
Only top-level goal (root of an episode) does not have a parent.public Node getAssociatedNode()
id variable.
SchemaEpisodicNode.public Collection<ObjectSlot> getObjectSlots()
slots variable.
public ObjectSlot getObjectSlot(String type)
objectSlot attached to this
episodic node.
null if no slot of specified type is attached to this node.public boolean addChildNode(String name)
name - Name of a subnode to be added.
children map.
public boolean addChildNode(String name,
String time)
public EpisodeNode getChild(String name)
EpisodeNodes that is direct
subnode of this node in the episode tree. Node cannot have two children
with identical name, so there will not be a conflict between several
children.
name - Specifies the name of the subnode to be returned.
public Collection<EpisodeNode> getChildrenNodes()
EpisodeNodes that are subnodes of this node
in the episode tree. Node without children is an atomic action.
EpisodeNodes that are direct
subnodes of this node.public Episode getEpisodeRoot()
root variable.
Episode structure representing whole
episode this node belongs to. Via this reference it is possible to
access outer memories.public void addSlot(String type)
type - String representing the type of the affordance needed
to fill the new slot.
public void fillSlot(String type,
String item)
ObjectSlot and ObjectNode
representing item must be already created when calling
this method.
type - String specifying the type of affordance used.item - Name of an item that will fill the object slot.public Map<Integer,EpisodeNode> getSuccessor()
successor variable.
public Map<Integer,EpisodeNode> getPredecessor()
predecessor variable.
public Map<Integer,EpisodeNode> getFirstChild()
firstChild variable.
public double getScore()
score variable.
public double calculateScore()
public EpisodeNode createCopy(EpisodeNode parent,
Episode e)
public void fullDelete(boolean episodeDeleted)
episodeDeleted - True if this is part of process of deleting
an entire episode, False otherwise.public void deleteNode()
public void deleteNode(boolean skipChecks)
public EpisodeNode mergeWith(EpisodeNode other)
other - Node to be merged to current one. (will be destroyed during process)
public EpisodeNode deriveNodeTrace()
public EpisodeNode deriveChildrenAndSlots(Collection<SchemaEpisodeNode> traceSchemaNodes,
Collection<SlotContent> schemaContents)
public int getNumberOfSubNodes()
public int getNumberOfSubNodesWithObjects()
public int getStartTime()
public int compareTo(EpisodeNode o)
compareTo in interface Comparable<EpisodeNode>public void recalculateTreeSize(boolean validate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||