public class BasicSense extends java.lang.Object implements Sense
Modifier and Type | Field and Description |
---|---|
int |
conversations |
static long |
DAY |
static java.lang.String |
DEFAULT_SPEAKER
Default user if none specified.
|
int |
engaged |
static long |
HOUR |
static int |
MAX_FILE_SIZE |
static long |
MINUTE |
static int |
RETRY
Number of attempt to retry sensory input on failure.
|
Constructor and Description |
---|
BasicSense() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ExceptionEventListener listener)
Add the exception listener.
|
void |
awake()
Start sensing.
|
void |
checkEngaged(Vertex conversation)
Record the engaged statistic if the conversation is engaged (over 3 messages).
|
boolean |
checkSentence(Vertex sentence,
Network network,
Vertex currentTime)
Check if the sentence has been discovered.
|
boolean |
discover(Vertex input,
Network network,
Vertex currentTime)
Attempt to discover information on the vertex.
|
void |
discoverSentence(Vertex sentence,
Network network,
Vertex currentTime)
Attempt to discover information on the sentence words.
|
java.lang.String |
getAction() |
Bot |
getBot()
Return the associated Bot instance.
|
EmotionalState |
getEmotionalState()
Return the current conversational mood.
|
Language.LanguageState |
getLanguageState()
Return the current conversational state.
|
java.util.List<ExceptionEventListener> |
getListeners() |
java.lang.String |
getName()
Return the name that identifies the sense.
|
Primitive |
getPrimitive()
Allows senses to be referenced by memory.
|
ResponseListener |
getResponseListener() |
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 |
migrateProperties()
Migrate to new properties system.
|
void |
notifyExceptionListeners(java.lang.Throwable exception) |
void |
notifyResponseListener() |
void |
output(Vertex output)
Output the active network to the sense.
|
void |
pool()
Reset state when instance is pooled.
|
java.lang.String |
printInput(Vertex input)
Convert the input into text.
|
void |
removeListener(ExceptionEventListener listener) |
void |
saveProperties() |
void |
setAction(java.lang.String action)
Set the current action.
|
void |
setBot(Bot Bot)
Set the associated Bot instance.
|
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 |
setResponseListener(ResponseListener responseListener) |
void |
shutdown()
Stop sensing.
|
java.lang.String |
toString() |
public static long MINUTE
public static long HOUR
public static long DAY
public static int RETRY
public static int MAX_FILE_SIZE
public static java.lang.String DEFAULT_SPEAKER
public int conversations
public int engaged
public void notifyResponseListener()
public ResponseListener getResponseListener()
public void setResponseListener(ResponseListener responseListener)
public void checkEngaged(Vertex conversation)
public boolean isEnabled()
public void setIsEnabled(boolean isEnabled)
setIsEnabled
in interface Sense
public Language.LanguageState getLanguageState()
getLanguageState
in interface Sense
public void setLanguageState(Language.LanguageState languageState)
setLanguageState
in interface Sense
public EmotionalState getEmotionalState()
public void setEmotionalState(EmotionalState emotionalState)
setEmotionalState
in interface Sense
public java.lang.String getAction()
public void setAction(java.lang.String action)
public void migrateProperties()
migrateProperties
in interface Sense
public void input(java.lang.Object input)
public void input(java.lang.Object input, Network network) throws java.lang.Exception
public void output(Vertex output)
public java.lang.String getName()
public void setName(java.lang.String name)
public Network getShortTermMemory()
public void log(java.lang.String message, java.util.logging.Level level, java.lang.Object... arguments)
public void log(java.lang.String message, java.util.logging.Level level)
public void log(java.lang.Throwable error)
public Primitive getPrimitive()
Sense
getPrimitive
in interface Sense
public java.lang.String toString()
toString
in class java.lang.Object
public Bot getBot()
public void setBot(Bot Bot)
public void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
initialize
in interface Sense
public boolean discover(Vertex input, Network network, Vertex currentTime)
public boolean checkSentence(Vertex sentence, Network network, Vertex currentTime)
public void discoverSentence(Vertex sentence, Network network, Vertex currentTime)
public java.lang.String printInput(Vertex input)
public void notifyExceptionListeners(java.lang.Throwable exception)
notifyExceptionListeners
in interface Sense
public java.util.List<ExceptionEventListener> getListeners()
public void addListener(ExceptionEventListener listener)
public void removeListener(ExceptionEventListener listener)
public void saveProperties()
saveProperties
in interface Sense