org.pandora.emotion
Class BasicMood

java.lang.Object
  extended by org.pandora.emotion.BasicMood
All Implemented Interfaces:
Mood

public class BasicMood
extends java.lang.Object
implements Mood

Controls and manages the thought processing.


Constructor Summary
BasicMood()
           
 
Method Summary
 void addEmotion(Emotion emotion)
           
 void awake()
          Spawn a thread to run the thoughts.
 void evaluate()
          Evaluate the active memory input for emotional influence.
 void evaluate(Vertex output)
          Evaluate the output with emotional expression.
<T> T
getEmotion(java.lang.Class<T> type)
           
 Emotion getEmotion(java.lang.String name)
           
 java.util.Map<java.lang.String,Emotion> getEmotions()
           
 Pandora getPandora()
          Return Pandora.
 void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
          Initialize any configurable settings from the properties.
 void log(java.lang.String message, java.util.logging.Level level, java.lang.Object... arguments)
          Log the message if the debug level is greater or equal to the level.
 void log(java.lang.Throwable exception)
          Log the exception.
 void removeEmotion(Emotion emotion)
           
 void setPandora(Pandora pandora)
          Set Pandora.
 void shutdown()
           
 java.lang.String toString()
          Print a useful string representation of the mood.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicMood

public BasicMood()
Method Detail

log

public void log(java.lang.String message,
                java.util.logging.Level level,
                java.lang.Object... arguments)
Log the message if the debug level is greater or equal to the level.


log

public void log(java.lang.Throwable exception)
Log the exception.


getPandora

public Pandora getPandora()
Return Pandora.

Specified by:
getPandora in interface Mood

setPandora

public void setPandora(Pandora pandora)
Set Pandora.

Specified by:
setPandora in interface Mood

initialize

public void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
Initialize any configurable settings from the properties.

Specified by:
initialize in interface Mood

shutdown

public void shutdown()
Specified by:
shutdown in interface Mood

awake

public void awake()
Spawn a thread to run the thoughts. Currently only uses a single thread, but should probably have a least one thread per thought, or more.

Specified by:
awake in interface Mood

getEmotions

public java.util.Map<java.lang.String,Emotion> getEmotions()
Specified by:
getEmotions in interface Mood

getEmotion

public <T> T getEmotion(java.lang.Class<T> type)
Specified by:
getEmotion in interface Mood

getEmotion

public Emotion getEmotion(java.lang.String name)
Specified by:
getEmotion in interface Mood

addEmotion

public void addEmotion(Emotion emotion)
Specified by:
addEmotion in interface Mood

removeEmotion

public void removeEmotion(Emotion emotion)
Specified by:
removeEmotion in interface Mood

evaluate

public void evaluate()
Evaluate the active memory input for emotional influence.

Specified by:
evaluate in interface Mood

evaluate

public void evaluate(Vertex output)
Evaluate the output with emotional expression.

Specified by:
evaluate in interface Mood

toString

public java.lang.String toString()
Print a useful string representation of the mood.

Overrides:
toString in class java.lang.Object