decisionMakingSystem
Class Action

Package class diagram package Action
java.lang.Object
  extended by decisionMakingSystem.Action
All Implemented Interfaces:
Serializable, Cloneable

public class Action
extends Object
implements Cloneable, Serializable

Action is one of the core classes of this decision making modul. It represents the "AND" node of the AND-OR tree it contains a list of affordances which has to be satisfied before executing the action. Action is satisfied in the following fashion. First it needs to satisfy its intentions (all of them in the defined order), then it finds the affordances and in the end it performs consecutively atomic actions.

Author:
Ondrej
See Also:
Serialized Form

Field Summary
 int activity
          value of the total activity in the perception field
 ArrayList<AtomicAction> atomicActions
          atomic actions to do in sequence when in the list - moreover I can define the atomic actions to do after fulfilling intentions
 int atomicActionsIndex
          index of atomic actions -> set on the actual to perform, increased when action is successfully performed
 int attention
          attention give to the action, no clue what does it do so far
 int attractivity
          specified in XML file - used to determine when to delete node from episodic memory
 int duration
          how long does the activity takes to execute - for the activities which are not actively represented by activity of agent like sleep
 boolean enabled
          if the action is blocked or not
 int fadeout
          time after which the process will fade out from the short-term memory
 Intention intention
          parental intention which invoked the action
 int intentionActivity
          value of the activity of parental intention
 ArrayList<Intention> intentions
          intentions necessary to fulfill the action - for hierarchical actions - in certain order
 String name
          written as a part of the agent's name - to show what he's doing
 double realTimeLimit
          real time limit - means in the MINUTES, should be given in the action description in the XML on the other hand timeLimit will be overridden by the calculated value from realTimeLimit and the number of iterations for a day
 HashMap<AffordanceType,EItem> satisfyingItems
          items that satisfy affordances
 int start
          iteration of the logic when the action begins to execute
 int time
          how long is agent trying to do the activity
 int timeLimit
          how long the agent will try to fulfil the action - in number of logic iterations or more precisely in number of executions of its atomic actions
 int unfullfiledIntentionsIndex
          intentions to do - just increase index after fullfiling the current intention
 
Constructor Summary
Action()
           
Action(HashSet<AffordanceType> affos)
           
 
Method Summary
 Intention chooseIntention()
          actually just returns the intention which should be performed now as they are performed in sequential manner
 Action cloneBySerialize(DecisionModuleImpl dModule)
          makes hard copy of a subtree starting at action via Serializable, as decision module and agent are transient it sets those manually after acquiring hard copy
 boolean equals(Object aThat)
           
static Action exampleAction()
           
 AtomicAction executeAtomicActions(Logger log)
          executes an atomic action if there is not any -> successful execution of the action -> TERMINATED if there is one -> execute it this can be done for a long time (as the atomic actions fails or succeeds depending on the environment) it can fails by timeout as well...
 AtomicAction getCurrentAtomicAction()
           
 Intention getCurrentIntention()
           
 int hashCode()
           
 boolean isSpontaneous()
           
 void moveToNextAtomicAction()
          move to next atomic action - just rises index
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

intention

public Intention intention
parental intention which invoked the action


intentions

public ArrayList<Intention> intentions
intentions necessary to fulfill the action - for hierarchical actions - in certain order


unfullfiledIntentionsIndex

public int unfullfiledIntentionsIndex
intentions to do - just increase index after fullfiling the current intention


name

public String name
written as a part of the agent's name - to show what he's doing


satisfyingItems

public final HashMap<AffordanceType,EItem> satisfyingItems
items that satisfy affordances


atomicActions

public ArrayList<AtomicAction> atomicActions
atomic actions to do in sequence when in the list - moreover I can define the atomic actions to do after fulfilling intentions


atomicActionsIndex

public int atomicActionsIndex
index of atomic actions -> set on the actual to perform, increased when action is successfully performed


activity

public int activity
value of the total activity in the perception field


intentionActivity

public int intentionActivity
value of the activity of parental intention


enabled

public boolean enabled
if the action is blocked or not


timeLimit

public int timeLimit
how long the agent will try to fulfil the action - in number of logic iterations or more precisely in number of executions of its atomic actions


realTimeLimit

public double realTimeLimit
real time limit - means in the MINUTES, should be given in the action description in the XML on the other hand timeLimit will be overridden by the calculated value from realTimeLimit and the number of iterations for a day


fadeout

public int fadeout
time after which the process will fade out from the short-term memory


start

public int start
iteration of the logic when the action begins to execute


duration

public int duration
how long does the activity takes to execute - for the activities which are not actively represented by activity of agent like sleep


time

public int time
how long is agent trying to do the activity


attention

public int attention
attention give to the action, no clue what does it do so far


attractivity

public int attractivity
specified in XML file - used to determine when to delete node from episodic memory

Constructor Detail

Action

public Action()

Action

public Action(HashSet<AffordanceType> affos)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

chooseIntention

public Intention chooseIntention()
actually just returns the intention which should be performed now as they are performed in sequential manner

Returns:
first unfulfilled intention

getCurrentIntention

public Intention getCurrentIntention()
Returns:
currently executing intention

isSpontaneous

public boolean isSpontaneous()
Returns:
true if it is spontaneous action - no parental intention

getCurrentAtomicAction

public AtomicAction getCurrentAtomicAction()
Returns:
current atomic action to execute

moveToNextAtomicAction

public void moveToNextAtomicAction()
move to next atomic action - just rises index


executeAtomicActions

public AtomicAction executeAtomicActions(Logger log)
executes an atomic action if there is not any -> successful execution of the action -> TERMINATED if there is one -> execute it this can be done for a long time (as the atomic actions fails or succeeds depending on the environment) it can fails by timeout as well... timeLimit if it succeeds -> move to next action if it fails -> all action failed


cloneBySerialize

public Action cloneBySerialize(DecisionModuleImpl dModule)
makes hard copy of a subtree starting at action via Serializable, as decision module and agent are transient it sets those manually after acquiring hard copy

Parameters:
agent - - link to agent
dModule - - link to decision module
Returns:
hard copy of the tree

equals

public boolean equals(Object aThat)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

exampleAction

public static Action exampleAction()
Returns:
an example instance of action => to create first XML entry for instance


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