cz.cuni.amis.pogamut.ut2004.examples.emotionalbot
Class ALMA

Package class diagram package ALMA
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.examples.emotionalbot.ALMA
All Implemented Interfaces:
de.affect.manage.event.AffectUpdateListener

public class ALMA
extends Object
implements de.affect.manage.event.AffectUpdateListener

Provides the basic interface between Pogamut and ALMA. This code is based on the AffectEngine.java class provided with ALMA as an example implementation.

Author:
Patrick Gebhard, Michal Bida

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 Logger log
          Console logging
 EmotionalBot myAgent
          The agent this PogamutALMA instance is for.
 
Constructor Summary
ALMA(EmotionalBot agent)
          The constructor that sets up ALMA engine.
 
Method Summary
 de.affect.xml.AffectInputDocument.AffectInput createAffectInput(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(String actor, double desirability, double praiseworthiness, double appealingness, double likelihood, double liking, double realization, String elicitor, String agency)
          Creates an AffectInput document containing an BasicEEC Element and returns a AffectInput object
 List<de.affect.emotion.Emotion> getAllEmotionsForElicitor(String agentName, String elicitor)
          Gets all emotions for target agent, that are felt toward the elicitor provided.
 List<de.affect.emotion.Emotion> getCurrentEmotions(String agentName)
          Gets the ALMA current emotions (in characters focus) for target agent.
 de.affect.mood.Mood getCurrentMood(String agentName)
          Returns current mood for target agent.
 de.affect.emotion.Emotion getDominantEmotion(String agentName)
          Gets dominant emotion for the input agent.
 de.affect.emotion.Emotion getEmotionForElicitor(String agentName, String elicitor, de.affect.emotion.EmotionType type)
          Gets emotion for target agent name of input type and for input elicitor.
 void processAffectInput(de.affect.xml.AffectInputDocument.AffectInput ai, String 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.
 
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


currentTime

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


log

public static Logger log
Console logging

Constructor Detail

ALMA

public ALMA(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. Called each time something in ALMA is changed. In ALMA the affects are changing very often resulting in this method getting called very often as well.

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

getCurrentMood

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

Parameters:
agentName -
Returns:

getAllEmotionsForElicitor

public List<de.affect.emotion.Emotion> getAllEmotionsForElicitor(String agentName,
                                                                 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(String agentName,
                                                       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:

getDominantEmotion

public de.affect.emotion.Emotion getDominantEmotion(String agentName)
Gets dominant emotion for the input agent.

Parameters:
agentName -
Returns:

getCurrentEmotions

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

Parameters:
agentName -
Returns:

createAffectInputBasicEEC

public de.affect.xml.AffectInputDocument.AffectInput createAffectInputBasicEEC(String actor,
                                                                               double desirability,
                                                                               double praiseworthiness,
                                                                               double appealingness,
                                                                               double likelihood,
                                                                               double liking,
                                                                               double realization,
                                                                               String elicitor,
                                                                               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(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,
                               String event)
The processAffectInput passes instance of AffectInput to AffectManager event string is here just for logging

Parameters:
ai -
event -


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