org.pandora.sense
Class BasicSense

java.lang.Object
  extended by org.pandora.sense.BasicSense
All Implemented Interfaces:
Sense
Direct Known Subclasses:
Context, Email, Http, IRC, TextEntry, Twitter, Voice

public class BasicSense
extends java.lang.Object
implements Sense

Defines an external interface. i.e. - text - voice - hearing - vision


Field Summary
static java.lang.String DEFAULT_SPEAKER
          Default user if none specified.
static int RETRY
          Number of attempt to retry sensory input on failure.
 
Constructor Summary
BasicSense()
           
 
Method Summary
 void awake()
          Start sensing.
 EmotionalState getEmotionalState()
          Return the current conversational mood.
 Language.LanguageState getLanguageState()
          Return the current conversational state.
 java.lang.String getName()
          Return the name that identifies the sense.
 Pandora getPandora()
          Return the associated Pandora instance.
 Primitive getPrimitive()
          Allows senses to be referenced by memory.
 Network getShortTermMemory()
          Return the short term memory.
 void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
          Initialize any configurable settings from the properties.
 void input(java.lang.Object input)
          Receive any input from the sense.
 void input(java.lang.Object input, Network network)
          Receive any input from the sense.
 boolean isEnabled()
          Return if the sense is enabled.
 void log(java.lang.String message, java.util.logging.Level level)
          Log the message if the debug level is greater or equal to the level.
 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 error)
          Log the exception.
 void output(Vertex output)
          Output the active network to the sense.
 void setEmotionalState(EmotionalState emotionalState)
          Set the current conversational mood.
 void setIsEnabled(boolean isEnabled)
          Allow the sense to disabled/enabled.
 void setLanguageState(Language.LanguageState languageState)
          Set the current conversational state.
 void setName(java.lang.String name)
          Set the name that identifies the sense.
 void setPandora(Pandora pandora)
          Set the associated Pandora instance.
 void shutdown()
          Stop sensing.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RETRY

public static int RETRY
Number of attempt to retry sensory input on failure.


DEFAULT_SPEAKER

public static java.lang.String DEFAULT_SPEAKER
Default user if none specified.

Constructor Detail

BasicSense

public BasicSense()
Method Detail

isEnabled

public boolean isEnabled()
Return if the sense is enabled.

Specified by:
isEnabled in interface Sense

setIsEnabled

public void setIsEnabled(boolean isEnabled)
Allow the sense to disabled/enabled.

Specified by:
setIsEnabled in interface Sense

getLanguageState

public Language.LanguageState getLanguageState()
Return the current conversational state.

Specified by:
getLanguageState in interface Sense

setLanguageState

public void setLanguageState(Language.LanguageState languageState)
Set the current conversational state.

Specified by:
setLanguageState in interface Sense

getEmotionalState

public EmotionalState getEmotionalState()
Return the current conversational mood.


setEmotionalState

public void setEmotionalState(EmotionalState emotionalState)
Set the current conversational mood.

Specified by:
setEmotionalState in interface Sense

awake

public void awake()
Start sensing.

Specified by:
awake in interface Sense

shutdown

public void shutdown()
Stop sensing.

Specified by:
shutdown in interface Sense

input

public void input(java.lang.Object input)
Receive any input from the sense.

Specified by:
input in interface Sense

input

public void input(java.lang.Object input,
                  Network network)
           throws java.lang.Exception
Receive any input from the sense.

Specified by:
input in interface Sense
Throws:
java.lang.Exception

output

public void output(Vertex output)
Output the active network to the sense.

Specified by:
output in interface Sense

getName

public java.lang.String getName()
Return the name that identifies the sense.

Specified by:
getName in interface Sense

setName

public void setName(java.lang.String name)
Set the name that identifies the sense.

Specified by:
setName in interface Sense

getShortTermMemory

public Network getShortTermMemory()
Return the short term memory.


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.String message,
                java.util.logging.Level level)
Log the message if the debug level is greater or equal to the level.


log

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


getPrimitive

public Primitive getPrimitive()
Description copied from interface: Sense
Allows senses to be referenced by memory.

Specified by:
getPrimitive in interface Sense

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPandora

public Pandora getPandora()
Return the associated Pandora instance.

Specified by:
getPandora in interface Sense

setPandora

public void setPandora(Pandora pandora)
Set the associated Pandora instance.

Specified by:
setPandora in interface Sense

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 Sense