eu.semaine.components.dialogue.interpreters
Class EmotionInterpreter

java.lang.Object
  extended by java.lang.Thread
      extended by eu.semaine.components.Component
          extended by eu.semaine.components.dialogue.interpreters.EmotionInterpreter
All Implemented Interfaces:
SEMAINEMessageAvailableListener, java.lang.Runnable

public class EmotionInterpreter
extends Component

The EmotionInterpreter reads the emotions detected by the input modules, and if they are higher than a certain threshold this emotion is send to the user state. Emotions: Valence, Arousal, Potency, Emotion-Quadrant Other factors: Interest, Gender Input EmmaReceiver('semaine.data.state.user.emma') Output StateSender('semaine.data.state.user')

Author:
MaatM

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.semaine.components.Component
Component.State
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class eu.semaine.components.Component
inputWaiting, isInput, isOutput, log, meta, receivers, senders, state, waitingTime
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EmotionInterpreter()
          Constructor of EmotionInterpreter Initializes the Senders and Receivers
 
Method Summary
 java.lang.String[] getEmotionQuadrant(SEMAINEEmmaMessage em)
           
 float[] getEmotions(SEMAINEEmmaMessage em)
          Retrieves the emotions from the given Message
 java.lang.String getGender(SEMAINEEmmaMessage em)
           
 void react(SEMAINEMessage m)
          Reads the emotions sends in EmmaMessages and determines the values.
 void sendEmotions(float valence, float arousal, float potency, float interest, java.lang.String emoQuadrant, java.lang.String emoQuadrantConfidence, java.lang.String gender)
          Sends the given emotion with the given value to the UserState
 
Methods inherited from class eu.semaine.components.Component
act, customStartIO, exitRequested, messageAvailableFrom, requestExit, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmotionInterpreter

public EmotionInterpreter()
                   throws javax.jms.JMSException
Constructor of EmotionInterpreter Initializes the Senders and Receivers

Throws:
javax.jms.JMSException
Method Detail

react

public void react(SEMAINEMessage m)
           throws javax.jms.JMSException
Reads the emotions sends in EmmaMessages and determines the values. If the values exceed the predetermined thresholds a message is send to the userstate.

Overrides:
react in class Component
Throws:
javax.jms.JMSException - if communication with the JMS server goes wrong.

getGender

public java.lang.String getGender(SEMAINEEmmaMessage em)
                           throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getEmotionQuadrant

public java.lang.String[] getEmotionQuadrant(SEMAINEEmmaMessage em)
                                      throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getEmotions

public float[] getEmotions(SEMAINEEmmaMessage em)
                    throws javax.jms.JMSException
Retrieves the emotions from the given Message

Parameters:
m - - the message to read
Returns:
- the values for the emotions in this order: [valence, arousal, Potency, Interest]
Throws:
javax.jms.JMSException

sendEmotions

public void sendEmotions(float valence,
                         float arousal,
                         float potency,
                         float interest,
                         java.lang.String emoQuadrant,
                         java.lang.String emoQuadrantConfidence,
                         java.lang.String gender)
                  throws javax.jms.JMSException
Sends the given emotion with the given value to the UserState

Parameters:
emotion - - the emotion to send
value - - the value of the emotion to send
Throws:
javax.jms.JMSException