eu.semaine.components.dialogue.actionproposers
Class UtteranceProposer

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

public class UtteranceProposer
extends Component

This class waits for the Agent to have the turn, takes the analysis of the user input and chooses a response for the agent

Version:
0.1 - dummy class
Author:
Mark tM

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
UtteranceProposer()
          Creates a new UtteranceProposer + Creates the Senders and Receivers + Import response-model data + Sets a random starting personality
 
Method Summary
protected  void act()
          Starts the conversation if this is called for the first time
 boolean changeOfCharacter(DialogueAct act)
          Regulates the process of changing the character
 eu.semaine.components.dialogue.actionproposers.UtteranceProposer.Personality choosePersonality()
          Returns a random personality
 java.lang.String getMaxScorer(java.util.HashMap<java.lang.String,java.lang.Integer> scores)
          Returns the best possible utterance from the given map with responses and scores
 eu.semaine.components.dialogue.actionproposers.UtteranceProposer.Personality getPersonality(java.lang.String p)
          Returns the Personality based on the String representation of the character
 java.util.HashMap<java.lang.String,java.lang.Integer> giveResponseRatings(DialogueAct act)
          Returns a map with all possible responses plus the ratings of those responses (based on the response model)
 void pickResponse(DialogueAct act)
          Tries to pick a response based on the given DialogueAct (which contains of the detected utterance + detected features)
protected  void react(SEMAINEMessage m)
          Called when a new message arrives Checks whether the message is an EmmaMessage containing processed input.
 void respond(java.lang.String response)
          Sends the chosen response to the FML-channel
 boolean startOfConversation()
          Regulates the start of a conversation (done at the start of each character)
 boolean systemWantsSpeakerChange()
           
 
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

UtteranceProposer

public UtteranceProposer()
                  throws javax.jms.JMSException
Creates a new UtteranceProposer + Creates the Senders and Receivers + Import response-model data + Sets a random starting personality

Throws:
javax.jms.JMSException
Method Detail

act

protected void act()
            throws javax.jms.JMSException
Starts the conversation if this is called for the first time

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

react

protected void react(SEMAINEMessage m)
              throws javax.jms.JMSException
Called when a new message arrives Checks whether the message is an EmmaMessage containing processed input. If so, then it will use this input to pick a response

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

pickResponse

public void pickResponse(DialogueAct act)
                  throws javax.jms.JMSException
Tries to pick a response based on the given DialogueAct (which contains of the detected utterance + detected features)

Parameters:
act -
Throws:
javax.jms.JMSException

startOfConversation

public boolean startOfConversation()
                            throws javax.jms.JMSException
Regulates the start of a conversation (done at the start of each character)

Returns:
Throws:
javax.jms.JMSException

changeOfCharacter

public boolean changeOfCharacter(DialogueAct act)
                          throws javax.jms.JMSException
Regulates the process of changing the character

Parameters:
act -
Returns:
Throws:
javax.jms.JMSException

systemWantsSpeakerChange

public boolean systemWantsSpeakerChange()
Returns:
true if the System decides to change the speaker TODO: implement

giveResponseRatings

public java.util.HashMap<java.lang.String,java.lang.Integer> giveResponseRatings(DialogueAct act)
Returns a map with all possible responses plus the ratings of those responses (based on the response model)

Parameters:
act -
Returns:

getMaxScorer

public java.lang.String getMaxScorer(java.util.HashMap<java.lang.String,java.lang.Integer> scores)
Returns the best possible utterance from the given map with responses and scores

Parameters:
scores -
Returns:

choosePersonality

public eu.semaine.components.dialogue.actionproposers.UtteranceProposer.Personality choosePersonality()
Returns a random personality

Returns:

getPersonality

public eu.semaine.components.dialogue.actionproposers.UtteranceProposer.Personality getPersonality(java.lang.String p)
Returns the Personality based on the String representation of the character

Parameters:
p -
Returns:

respond

public void respond(java.lang.String response)
             throws javax.jms.JMSException
Sends the chosen response to the FML-channel

Parameters:
response -
Throws:
javax.jms.JMSException