decisionMakingSystem
Class Intention

Package class diagram package Intention
java.lang.Object
  extended by decisionMakingSystem.Intention
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
Want

public class Intention
extends Object
implements Comparable, Serializable

Intention is one of the crucial classes of this decision making model it represents an "OR" node of the tree, so it contains a set of actions by which it can be satisfied (it suffices to succeed with one of them)

Author:
Ondrej
See Also:
Serialized Form

Field Summary
 int attractivity
          specified in XML file - used to determine when to delete node from episodic memory
 boolean extend
          specified in XML file - enables definition of common subtrees
 boolean extension
           
 
Constructor Summary
Intention()
           
 
Method Summary
 Action chooseAction()
          picks up an action to do next to try to satisfy the intention.
 Intention cloneBySerialize(Bot agent, DecisionModuleImpl dModule)
          makes hard copy of whole AND-OR tree via Serializable, as decision module and agent are transient it sets those manually after acquiring hard copy
 int compareTo(Object o)
           
 void decreaseFadeout()
           
 void dropOut(int time)
          drop out happens when an intention finishes successfuly => so it will not be active in its activation interval -> drops out
 boolean equals(Object aThat)
           
static Intention exampleOfIntention()
           
 ArrayList<Action> getActions()
           
 ArrayList<Interval> getActivationIntervals()
           
 int getActivity()
           
 Action getAncestorAction()
           
 Action getChosenAction()
           
 int getDuration()
           
 int getFadeout()
           
 int getMemoryDuration()
           
 String getName()
           
 ArrayList<Action> getNotTriedActions()
           
 IntentionStates getRealized()
           
 int getTimeLimit()
           
 int hashCode()
           
 void increaseActivityToAllSources(ArrayList<EItem> things)
          sets attractivity of all provided items which can satisfy any affordance of actions in the intention
 boolean increased(int time)
          if it should be increased in the provided time
 void increaseDuration()
           
 boolean isEnabled()
           
 boolean isRoot()
           
 void restrictTimeLimits(int intervalSize)
          this procedure tries to restrict the time limits, so the subactions of the intention would fail/end earlier then normaly so far it restrains the interval to 2/3 of the given restrain for each subaction -> though with a bit more effort it can do it exactly like count the time before, make it proportional and set it according to it, but as it is not crucial, I made it this way
 Intention rootIntention()
           
 void setActions(ArrayList<Action> actions)
           
 void setActivationIntervals(ArrayList<Interval> activationIntervals)
           
 void setActivity(int activity)
           
 void setAncestorAction(Action ancestorAction)
           
 void setChosenAction(Action chosenAction)
           
 void setDuration(int duration)
           
 void setEnabled(boolean enabled)
           
 void setFadeout(int fadeout)
           
 void setMemoryDuration(int memoryDuration)
           
 void setName(String name)
           
 void setNotTriedActions(ArrayList<Action> oldProcesses)
           
 void setRealized(IntentionStates realized)
           
 String toString()
           
 void updateActivity(int time)
          updates activity of the intention according to the habituation/activation function counts with dropout first - no need to restart it - it will be overriden later anyway
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

attractivity

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


extend

public boolean extend
specified in XML file - enables definition of common subtrees


extension

public boolean extension
Constructor Detail

Intention

public Intention()
Method Detail

cloneBySerialize

public Intention cloneBySerialize(Bot agent,
                                  DecisionModuleImpl dModule)
makes hard copy of whole AND-OR tree 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

toString

public String toString()
Overrides:
toString in class Object

increased

public boolean increased(int time)
if it should be increased in the provided time

Parameters:
time -
Returns:

updateActivity

public void updateActivity(int time)
updates activity of the intention according to the habituation/activation function counts with dropout first - no need to restart it - it will be overriden later anyway


increaseActivityToAllSources

public void increaseActivityToAllSources(ArrayList<EItem> things)
sets attractivity of all provided items which can satisfy any affordance of actions in the intention

Parameters:
things -

rootIntention

public Intention rootIntention()
Returns:
root intention of presented intention - null if it is already in root

isRoot

public boolean isRoot()
Returns:
true if intention is root of some AND-OR tree

chooseAction

public Action chooseAction()
picks up an action to do next to try to satisfy the intention. as intention can be satisfied by any of its action, it chooses it randomly


compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getActivity

public int getActivity()

setActivity

public void setActivity(int activity)

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

getRealized

public IntentionStates getRealized()

setRealized

public void setRealized(IntentionStates realized)

getChosenAction

public Action getChosenAction()

setChosenAction

public void setChosenAction(Action chosenAction)

getActions

public ArrayList<Action> getActions()

setActions

public void setActions(ArrayList<Action> actions)

getNotTriedActions

public ArrayList<Action> getNotTriedActions()

setNotTriedActions

public void setNotTriedActions(ArrayList<Action> oldProcesses)

getActivationIntervals

public ArrayList<Interval> getActivationIntervals()

setActivationIntervals

public void setActivationIntervals(ArrayList<Interval> activationIntervals)

getAncestorAction

public Action getAncestorAction()

setAncestorAction

public void setAncestorAction(Action ancestorAction)

getName

public String getName()

setName

public void setName(String name)

getDuration

public int getDuration()

setDuration

public void setDuration(int duration)

increaseDuration

public void increaseDuration()

getMemoryDuration

public int getMemoryDuration()

setMemoryDuration

public void setMemoryDuration(int memoryDuration)

setFadeout

public void setFadeout(int fadeout)

getFadeout

public int getFadeout()

decreaseFadeout

public void decreaseFadeout()

getTimeLimit

public int getTimeLimit()

dropOut

public void dropOut(int time)
drop out happens when an intention finishes successfuly => so it will not be active in its activation interval -> drops out

Parameters:
time -

exampleOfIntention

public static Intention exampleOfIntention()
Returns:
an example instance of Intention - useful when generating first XML entry of some structure of intentions and actions to see how it looks like

restrictTimeLimits

public void restrictTimeLimits(int intervalSize)
this procedure tries to restrict the time limits, so the subactions of the intention would fail/end earlier then normaly so far it restrains the interval to 2/3 of the given restrain for each subaction -> though with a bit more effort it can do it exactly like count the time before, make it proportional and set it according to it, but as it is not crucial, I made it this way

Parameters:
intervalSize - - the maximum timeLimit possible -> already in the steps of the logic


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