cz.cuni.amis.pogamut.episodic.decisions
Class Action

Package class diagram package Action
java.lang.Object
  extended by cz.cuni.amis.pogamut.episodic.decisions.Node
      extended by cz.cuni.amis.pogamut.episodic.decisions.Action
All Implemented Interfaces:
INode, Serializable

public class Action
extends Node
implements Serializable

Class Action represents an action node from decision process in pogamut end of the project. It is part of decision tree and represent universal OR node in the decision AND-OR trees. In order to perform an action, all its sub-goals must be fullfilled and an action can fulfill one given super-goal. It is extending the Node class, so it is possible to attach specified affordances to the Action node.

By pointing to the trace of Intentions and Actions it is possible to add new node to the episode tree. It is the only way how to add new information to memory.

AtomicAction nodes can be attached on to Action nodes. They cannot be attached to the Intention nodes.

Author:
Michal Cermak
See Also:
Node, Serialized Form

Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.episodic.decisions.Node
parent
 
Constructor Summary
Action(String name, int attractivity)
          Instantiate the class by providing its name and attractivity.
 
Method Summary
 void addAtomicAction(AtomicAction aa)
          Attach new atomic action that will be executed when performing this action node.
 void addSubNode(Intention intention)
          Adds a new goal subnode that has to be satisfied first in order to perform the action representing by the current node.
 Collection<Node> getAllChildrenNodes()
          This method returns Intention nodes that are direct subnodes of this node and atomic action nodes.
 AtomicAction getAtomicAction(String s)
          This method returns one specified AtomicAction node that is attached to this node.
 Collection<AtomicAction> getAtomicActions()
          Basically a getter method for the atomicActions variable.
 int getPossibleSubTrees()
           
 Intention getSubIntention(String name)
          This method returns one specified Intention node that is direct subnode of this node.
 Node getSubNode(String name)
          This method returns one specified Intention node that is direct subnode of this node.
 Collection<Intention> getSubNodes()
          Basically a getter method for the subNodes variable.
 
Methods inherited from class cz.cuni.amis.pogamut.episodic.decisions.Node
addAffordance, getAffordance, getAffordances, getAssociatedNode, getAttractivity, getId, getName, getType, setAssociatedSchemaNode, setId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Action

public Action(String name,
              int attractivity)
Instantiate the class by providing its name and attractivity.

There can be several nodes with identical name in the decision tree, but no node can have two direct children with the same name.

Parameters:
name - Name of the new node.
_attractivity - Specified in XML file. Helps determine when to forget node.
Method Detail

addAtomicAction

public void addAtomicAction(AtomicAction aa)
Attach new atomic action that will be executed when performing this action node. Each Action node can have unlimited number of AtomicAction subnodes. The only restriction is that no two subnodes can have identical name. These subnodes are atomic actions that will be executed once all goals are satisfied and agent is performing this action. It is reasonable that action nodes without any subgoals will have at least one atomic action attached to it.

No attached atomic action node can share identical name with any direct goal subnode.

Parameters:
aa - Reference to an already instanciated AtomicAction class that should be added attached to this action node.

getAtomicActions

public Collection<AtomicAction> getAtomicActions()
Basically a getter method for the atomicActions variable.

Returns:
Returns a collection of a all AtomicActions attached to this Action node. These are atomic actions that will be executed once all goals are satisfied and agent is performing this action.

getAtomicAction

public AtomicAction getAtomicAction(String s)
This method returns one specified AtomicAction node that is attached to this node.

Parameters:
s - Name of the atomic action that is to be returned.
Returns:
Returns an AtomicAction node with specified name attached to this Action node. Returns null if there is no such AtomicAction attached to it.

addSubNode

public void addSubNode(Intention intention)
Adds a new goal subnode that has to be satisfied first in order to perform the action representing by the current node. Each Action node can have unlimited number of Intention subnodes. The only restriction is that no two direct subnodes can have identical name. These subnodes are goals that all need to be completed in order to perform this action - they are AND nodes.

This method is used to create the decision tree structure during memory initialization.

No direct goal subnode can share identical name with attached atomic action node.

Parameters:
intention - Reference to an already instanciated Intention class that should be added attached to this Action node.

getSubNodes

public Collection<Intention> getSubNodes()
Basically a getter method for the subNodes variable. These subnodes are goals that all need to be completed in order to perform this action - they are AND nodes. Together with attached atomic actions and affordances they are direct children of this node in the decision tree.

Returns:
Returns a collection of a all Intetion (goal) subnodes of this Action node.

getSubNode

public Node getSubNode(String name)
This method returns one specified Intention node that is direct subnode of this node. If no such node exists it tries to find and atomic action of such name.

Specified by:
getSubNode in interface INode
Parameters:
name - Name of the node that is to be returned.
Returns:
Returns an Intention node with specified name that is direct subnode of this Action node. If no such goal exists returns AtomicAction node attached to this node. Returns null if there is no such AtomicAction attached to it.

getSubIntention

public Intention getSubIntention(String name)
This method returns one specified Intention node that is direct subnode of this node.

Parameters:
name - Name of the node that is to be returned.
Returns:
Returns an Intention node with specified name that is direct subnode of this Action node. Returns null if there is no such Intention attached to it.

getAllChildrenNodes

public Collection<Node> getAllChildrenNodes()
This method returns Intention nodes that are direct subnodes of this node and atomic action nodes.

Specified by:
getAllChildrenNodes in interface INode
Returns:
Returns a collection of Intention nodes that are direct subnodes of this Action node and AtomicAction nodes attached to this node.

getPossibleSubTrees

public int getPossibleSubTrees()


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.