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

java.lang.Objectcz.cuni.amis.pogamut.episodic.decisions.Node
public abstract class Node
Node class is an abstract class representing nodes from
the decision tree in decision making process in pogamut end part of
the project. Node can be either Action (the OR node),
Intention (goal, the AND node) or AtomicAction.
It is possible to attach affordance slots to the Nodes in
the decision tree, but no affordances should be attached to atomic actions.
All nodes that were performed at least once by an agent are associated
with equivalent nodes in the schema tree in agent's memory.
Every EpisodeNode in agent's memory of experienced episodes
is associated with its equivalent Node in decision trees.
The only way how to add a new memories to agent's memory is to provide
a specific trace of Nodes starting with a top-level goal and
ending with atomic action.
Action,
Intention,
AtomicAction,
EpisodeNode,
Serialized Form| Field Summary | |
|---|---|
Node |
parent
A reference to the parent node in the decision tree. |
| Constructor Summary | |
|---|---|
Node(String _name,
int _attractivity,
NodeType _type)
Instantiate the class by providing its name, attractivity and type. |
|
| Method Summary | |
|---|---|
void |
addAffordance(AffordanceSlot affordance)
Actions and Intetions can have AffordanceSlots attached
to them. |
AffordanceSlot |
getAffordance(String type)
|
Collection<AffordanceSlot> |
getAffordances()
Getter method for the affordances variable. |
SchemaEpisodeNode |
getAssociatedNode()
Getter method for the associatedSchemaNode variable. |
int |
getAttractivity()
A getter method for attractivity variable. |
int |
getId()
Getter method for the id variable. |
String |
getName()
Getter method for the name variable. |
NodeType |
getType()
Getter method for the type variable. |
boolean |
setAssociatedSchemaNode(SchemaEpisodeNode node)
This method sets the associatedSchemaNode variable. |
boolean |
setId(int newId)
This method sets the unique ID of the node. |
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 |
| Methods inherited from interface cz.cuni.amis.pogamut.episodic.decisions.INode |
|---|
getAllChildrenNodes, getSubNode |
| Field Detail |
|---|
public Node parent
| Constructor Detail |
|---|
public Node(String _name,
int _attractivity,
NodeType _type)
Name of the node is used to identify and index the nodes agent's memory. Therefore no two nodes in the same level can have identical names (e.g. no two top-level goals, no two children of another node). There can be two nodes with same name though, if they are not children of the same parent node.
Type of the Node can be either action, intention (goal)
or atomic action.
_name - Name of the node._attractivity - Specified in XML file. Helps determine when to forget node._type - Type of the node.| Method Detail |
|---|
public String toString()
String object representing this
EpisodeNode's info. It is used to provide tooltips
for the node when it is invoked from the visualizion structures.
toString in class Objectpublic boolean setId(int newId)
newId - The ID of this node.public int getId()
id variable.
Throws - exception when trying to retrive ID that was not set yet.public NodeType getType()
type variable.
Node. Node can be
either action, intention (goal) or atomic action.public String getName()
name variable.
public void addAffordance(AffordanceSlot affordance)
AffordanceSlots attached
to them. These slots are kept in the affordances list.
In order to perform an action or satisfy a goal, all its slots have
to be filled first.
This method attaches a new slot to this Node. There should
be no two slots of same type attached to one node.
affordance - Already instantiated AffordanceSlot
that should be attached to this node.public boolean setAssociatedSchemaNode(SchemaEpisodeNode node)
associatedSchemaNode variable.
All nodes are associated with equivalent nodes in schemabag once
the equivalent node is created there. SchemaNodes can be used to
create average episodes or count number of experienced of an episode.
It should only be called from the newly created schema node when making the mutual association. New schema node association to this node has to be performed first, otherwise the association is not made.
node - Newly created SchemaEpisodeNode that this
node should be associated with.
SchemaEpisodeNodepublic SchemaEpisodeNode getAssociatedNode()
associatedSchemaNode variable.
getAssociatedNode in interface INodeSchemaEpisodeNodepublic Collection<AffordanceSlot> getAffordances()
affordances variable.
getAffordances in interface INodepublic AffordanceSlot getAffordance(String type)
public int getAttractivity()
attractivity variable.
Specified in XML file. Helps determine when to forget node.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||