almabasedmodel
Class AEmotionState

java.lang.Object
  extended by almabasedmodel.AEmotionState

public class AEmotionState
extends java.lang.Object

This class is used to count and store the feeling toward other agents in the scenario and provides interface between ALMA and our agent. Feeling is counted from the emotions that are caused by other agents in the scenario. These emotions are used for counting the feeling: love, hate, liking, disliking, joy, distress, anger and gratitude. Love, hate, liking and disliking creates fixed feeling part - these emotions are remebered and can change a little during the scenario. The second, dynamic part of the feeling is counted from emotions joy, distress, anger and gratitude. These emotions are not remembered and in ALMA they decay over time.


Field Summary
 AMood currentMood
          Here we store current mood of the agent - not used right now
 java.util.ArrayList<java.lang.Integer> emotionObjects
          Here we store ids of all agents in the scenario, so we can get emotions towards them from ALMA
 java.util.HashMap<java.lang.Integer,java.util.HashMap<de.affect.emotion.EmotionType,AEmotion>> feelingsHistory
          Here the fixed part of the feeling is stored for all agents.
 java.util.ArrayList<AMood> moodHistory
          Here we store mood history of the agent - not used right now
 EmotionalBot myAgent
          Pointer toward our agent
 PogamutALMA myALMA
          Pointer toward ALMA emotion model
 
Constructor Summary
AEmotionState(PogamutALMA alma, EmotionalBot myAgent)
          Only constructor for this class, requires few other objects.
 
Method Summary
 void decayFeelings()
          Decay all our stored emotions by some const.
 double getAlmaEmotionIntensity(int id, de.affect.emotion.EmotionType type)
          Returns intensity of emotion towards elicitor of input type.
 AEmotion getCurrentDominantEmotion()
          Returns the current dominant emotion from ALMA.
 java.util.ArrayList<AEmotion> getCurrentEmotions()
          Returns the list of ALMA current emotions for our agent.
 AMood getCurrentMood()
          Returns agent current mood.
 double getFeeling(int id)
          Here we get a feeling toward agent - either positive or negative.
 java.lang.String getSmiliesString(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr)
          Here we will process our feelings and emotions and generate appropriate smilies string that will be used in our agent messages.
 void insertEmotionObject(int newId)
          Checks if emotionObjects already contains the id we want to add.
 int parseId(java.lang.String stringId)
          Parses elicitor (in string format) for int UnrealId
 void processEmotions()
          Updates current emotions and mood
 void processFeelings()
          Updates our feelingsHistory, so we have emotions we felt to all objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myALMA

public PogamutALMA myALMA
Pointer toward ALMA emotion model


myAgent

public EmotionalBot myAgent
Pointer toward our agent


currentMood

public AMood currentMood
Here we store current mood of the agent - not used right now


moodHistory

public java.util.ArrayList<AMood> moodHistory
Here we store mood history of the agent - not used right now


feelingsHistory

public java.util.HashMap<java.lang.Integer,java.util.HashMap<de.affect.emotion.EmotionType,AEmotion>> feelingsHistory
Here the fixed part of the feeling is stored for all agents.


emotionObjects

public java.util.ArrayList<java.lang.Integer> emotionObjects
Here we store ids of all agents in the scenario, so we can get emotions towards them from ALMA

Constructor Detail

AEmotionState

public AEmotionState(PogamutALMA alma,
                     EmotionalBot myAgent)
Only constructor for this class, requires few other objects.

Parameters:
alma - our ALMA emotion model
myAgent - our agent
Method Detail

decayFeelings

public void decayFeelings()
Decay all our stored emotions by some const.


processFeelings

public void processFeelings()
Updates our feelingsHistory, so we have emotions we felt to all objects


processEmotions

public void processEmotions()
Updates current emotions and mood


getCurrentEmotions

public java.util.ArrayList<AEmotion> getCurrentEmotions()
Returns the list of ALMA current emotions for our agent.

Returns:
list of current emotions from ALMA

getCurrentDominantEmotion

public AEmotion getCurrentDominantEmotion()
Returns the current dominant emotion from ALMA.

Returns:
current dominant emotion

getAlmaEmotionIntensity

public double getAlmaEmotionIntensity(int id,
                                      de.affect.emotion.EmotionType type)
Returns intensity of emotion towards elicitor of input type.

Parameters:
id - agent the emotion is associated with
type - type of the emotion
Returns:
emotion intensity

getCurrentMood

public AMood getCurrentMood()
Returns agent current mood.

Returns:
agent current mood

getFeeling

public double getFeeling(int id)
Here we get a feeling toward agent - either positive or negative. Feeling is counted from these emotions: + gratitude/2, - anger * 2, + joy, - distress, + love * 1.5, - hate * 1.5, + liking, - disliking.

Parameters:
id - agent that the feeling is associated with
Returns:
feeling intensity (Max feeling is 4, min feeling is -5.5 (2.5 and -2.5 for "fixed" feeling))

getSmiliesString

public java.lang.String getSmiliesString(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr)
Here we will process our feelings and emotions and generate appropriate smilies string that will be used in our agent messages.

Parameters:
plr - agent we want to generate smilies string for
Returns:
string containing the smilies for the agent (reflecting our feeling)

parseId

public int parseId(java.lang.String stringId)
Parses elicitor (in string format) for int UnrealId

Parameters:
stringId - - string to parse
Returns:
parsed unreal id, or -1

insertEmotionObject

public void insertEmotionObject(int newId)
Checks if emotionObjects already contains the id we want to add. If not, we will add it.

Parameters:
newId - - id to add