almabasedmodel
Class PogamutALMA

java.lang.Object
  extended by almabasedmodel.PogamutALMA
All Implemented Interfaces:
de.affect.manage.event.AffectInputListener, de.affect.manage.event.AffectUpdateListener, de.affect.manage.event.EmotionChangeListener, de.affect.manage.event.EmotionMaintenanceListener

public class PogamutALMA
extends java.lang.Object
implements de.affect.manage.event.EmotionMaintenanceListener, de.affect.manage.event.AffectInputListener, de.affect.manage.event.AffectUpdateListener, de.affect.manage.event.EmotionChangeListener

Provides the first interface between Pogamut and ALMA (additional methods are defined in AEmotionState.java class). This code is based on the AffectEngine.java class provided with ALMA as an example implementation.


Field Summary
 double currentTime
          Current level time in seconds (contains also milliseconds after dot)
static de.affect.manage.AffectManager fAM
          The ALMA Java implementation
static java.util.logging.Logger log
          Console logging
 EmotionalBot myAgent
          The agent this PogamutALMA instance is for.
private static java.lang.String sALMACOMP
          ALMA affect computation definition file
private static java.lang.String sALMADEF
          ALMA character definition file
private static boolean sGUIMode
           
 
Constructor Summary
PogamutALMA(EmotionalBot agent)
          The constructor that sets up ALMA engine.
 
Method Summary
 de.affect.xml.AffectInputDocument.AffectInput createAffectInput(java.lang.String actor, de.affect.xml.AffectInputDocument.AffectInput.BasicEEC eec)
          Creates an AffectInput document containing an BasicEEC Element and returns a AffectInput object This type eec element is constructed elsewhere
 de.affect.xml.AffectInputDocument.AffectInput createAffectInputBasicEEC(java.lang.String actor, double desirability, double praiseworthiness, double appealingness, double likelihood, double liking, double realization, java.lang.String elicitor, java.lang.String agency)
          Creates an AffectInput document containing an BasicEEC Element and returns a AffectInput object
 void emotionChanged(de.affect.manage.event.EmotionChangeEvent event)
          Not used right now.
 java.util.List<de.affect.emotion.Emotion> getAllEmotionsForElicitor(java.lang.String agentName, java.lang.String elicitor)
          Gets all emotions for target agent, that are felt toward the elicitor provided.
 java.util.List<de.affect.emotion.Emotion> getCurrentEmotions(java.lang.String agentName)
          Gets the ALMA current emotions (in characters focus) for target agent.
 de.affect.mood.Mood getCurrentMood(java.lang.String agentName)
          Returns current mode for target agent.
 de.affect.emotion.Emotion getEmotionForElicitor(java.lang.String agentName, java.lang.String elicitor, de.affect.emotion.EmotionType type)
          Gets emotion for target agent name of input type and for input elicitor.
 void maintainEmotion(de.affect.manage.event.EmotionMaintenanceEvent event)
          Not used right now.
 void processAffectInput(de.affect.xml.AffectInputDocument.AffectInput ai, EventId event)
          The processAffectInput passes instance of AffectInput to AffectManager event string is here just for logging
 void update(de.affect.manage.event.AffectUpdateEvent event)
          Listens to affect updates computed by ALMA.
 void updateInput(de.affect.manage.event.AffectInputEvent event)
          Not used right now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAgent

public EmotionalBot myAgent
The agent this PogamutALMA instance is for.


fAM

public static de.affect.manage.AffectManager fAM
The ALMA Java implementation


sALMACOMP

private static java.lang.String sALMACOMP
ALMA affect computation definition file


sALMADEF

private static java.lang.String sALMADEF
ALMA character definition file


currentTime

public double currentTime
Current level time in seconds (contains also milliseconds after dot)


sGUIMode

private static final boolean sGUIMode
See Also:
Constant Field Values

log

public static java.util.logging.Logger log
Console logging

Constructor Detail

PogamutALMA

public PogamutALMA(EmotionalBot agent)
The constructor that sets up ALMA engine.

Parameters:
agent -
Method Detail

update

public void update(de.affect.manage.event.AffectUpdateEvent event)
Listens to affect updates computed by ALMA. This implements the AffectUpdateListener

Specified by:
update in interface de.affect.manage.event.AffectUpdateListener
Parameters:
event -

getCurrentMood

public de.affect.mood.Mood getCurrentMood(java.lang.String agentName)
Returns current mode for target agent.

Parameters:
agentName -
Returns:

getAllEmotionsForElicitor

public java.util.List<de.affect.emotion.Emotion> getAllEmotionsForElicitor(java.lang.String agentName,
                                                                           java.lang.String elicitor)
Gets all emotions for target agent, that are felt toward the elicitor provided.

Parameters:
agentName -
elicitor -
Returns:

getEmotionForElicitor

public de.affect.emotion.Emotion getEmotionForElicitor(java.lang.String agentName,
                                                       java.lang.String elicitor,
                                                       de.affect.emotion.EmotionType type)
Gets emotion for target agent name of input type and for input elicitor.

Parameters:
agentName -
elicitor -
type -
Returns:

getCurrentEmotions

public java.util.List<de.affect.emotion.Emotion> getCurrentEmotions(java.lang.String agentName)
Gets the ALMA current emotions (in characters focus) for target agent.

Parameters:
agentName -
Returns:

createAffectInputBasicEEC

public de.affect.xml.AffectInputDocument.AffectInput createAffectInputBasicEEC(java.lang.String actor,
                                                                               double desirability,
                                                                               double praiseworthiness,
                                                                               double appealingness,
                                                                               double likelihood,
                                                                               double liking,
                                                                               double realization,
                                                                               java.lang.String elicitor,
                                                                               java.lang.String agency)
Creates an AffectInput document containing an BasicEEC Element and returns a AffectInput object

Parameters:
actor -
desirability -
agency -
praiseworthiness -
appealingness -
liking -
likelihood -
elicitor -
realization -
Returns:

createAffectInput

public de.affect.xml.AffectInputDocument.AffectInput createAffectInput(java.lang.String actor,
                                                                       de.affect.xml.AffectInputDocument.AffectInput.BasicEEC eec)
Creates an AffectInput document containing an BasicEEC Element and returns a AffectInput object This type eec element is constructed elsewhere

Parameters:
actor -
eec -
Returns:

processAffectInput

public void processAffectInput(de.affect.xml.AffectInputDocument.AffectInput ai,
                               EventId event)
The processAffectInput passes instance of AffectInput to AffectManager event string is here just for logging

Parameters:
ai -
event -

maintainEmotion

public void maintainEmotion(de.affect.manage.event.EmotionMaintenanceEvent event)
Not used right now.

Specified by:
maintainEmotion in interface de.affect.manage.event.EmotionMaintenanceListener
Parameters:
event -

emotionChanged

public void emotionChanged(de.affect.manage.event.EmotionChangeEvent event)
Not used right now.

Specified by:
emotionChanged in interface de.affect.manage.event.EmotionChangeListener
Parameters:
event -

updateInput

public void updateInput(de.affect.manage.event.AffectInputEvent event)
Not used right now.

Specified by:
updateInput in interface de.affect.manage.event.AffectInputListener
Parameters:
event -