eu.semaine.components.dialogue.interpreters
Class TurnTakingInterpreter

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

public class TurnTakingInterpreter
extends Component

This class interprets and analyses the turn taking behaviour of the user

Version:
0.1 - dummy class
Author:
Mark tM

Nested Class Summary
static class TurnTakingInterpreter.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
TurnTakingInterpreter()
          Constructor DialogInterpreter
 
Method Summary
 void act()
          Checks if the turn has switched to the agent
 void changeTurnState(boolean agentTurn, long time)
          Changes the Turn-holder in the Dialog-state
 boolean isSilence(SEMAINEMessage m)
          Checks if the Message is ASR output and if it contains Silence.
 boolean isSpeaking(SEMAINEMessage m)
          Checks if the Message is ASR output and if it contains a word.
 boolean processTurnMessage(SEMAINEMessage m)
           
 void react(SEMAINEMessage m)
          Updates the time since the user is silent and the turn taking state based on the received message
 
Methods inherited from class eu.semaine.components.Component
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

TurnTakingInterpreter

public TurnTakingInterpreter()
                      throws javax.jms.JMSException
Constructor DialogInterpreter

Throws:
javax.jms.JMSException
Method Detail

act

public void act()
         throws javax.jms.JMSException
Checks if the turn has switched to the agent

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

react

public void react(SEMAINEMessage m)
           throws javax.jms.JMSException
Updates the time since the user is silent and the turn taking state based on the received message

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

processTurnMessage

public boolean processTurnMessage(SEMAINEMessage m)

isSilence

public boolean isSilence(SEMAINEMessage m)
                  throws javax.jms.JMSException
Checks if the Message is ASR output and if it contains Silence.

Parameters:
m - the message to check
Returns:
true if the message says that the user is currently silent
Throws:
javax.jms.JMSException

isSpeaking

public boolean isSpeaking(SEMAINEMessage m)
                   throws javax.jms.JMSException
Checks if the Message is ASR output and if it contains a word.

Parameters:
m - the message to check
Returns:
true if the message says that the user is currently silent
Throws:
javax.jms.JMSException

changeTurnState

public void changeTurnState(boolean agentTurn,
                            long time)
                     throws javax.jms.JMSException
Changes the Turn-holder in the Dialog-state

Parameters:
agentTurn - - if true -> Agent has turn if false -> User has turn
Throws:
javax.jms.JMSException