public class DefaultSpeechSensor extends AbstractSensor implements ISpeaker
IEfferentObject
that corresponds to the agent's mouth. That
IEfferentObject
contains at least one
IEfferentCommandTemplate
that is a
VocalizationCommandTemplate
which can be used to instantiate a
specific IEfferentCommand
, that is a VocalizationCommand
.
This sensor will process all such commands, execute them, and place an
IRealObject
into the simulation which will likely be picked up by an
aural sensor to make the percept available.IParticipant.State
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SPEAKER |
static java.lang.String |
VOCALIZATION_DURATION_EQUATION |
Constructor and Description |
---|
DefaultSpeechSensor() |
Modifier and Type | Method and Description |
---|---|
protected void |
agentAdded(IAgentObject agent)
when we get a new agent, immediately given them a mouth
|
void |
configure(DefaultSpeechSensor sensor,
java.util.Map<java.lang.String,java.lang.String> options)
allow the speaker to be configured.
|
void |
configure(java.util.Map<java.lang.String,java.lang.String> options)
we can accept only a very basic configuration option.
|
java.lang.String |
getName()
default name for the speech sensor
|
void |
initialize()
let's initialize.
|
void |
resume()
resume a suspended participant and return state to started.
|
void |
shutdown()
shutdown the participant if it is stopped and disconnect
|
void |
speak(IAgentObject speaker,
VocalizationCommand vocalCommand)
actually speak by creating a new aural event, and posting it.
|
void |
start()
Start it up by queueing the
Runnable _cycle on the Executor |
agentRemoved, agentUpdated, connect, createAfferentObjectManager, createAgentObjectManager, createEfferentObjectManager, createRealObjectManager, createSensor, disconnect, getAddressingInformation, getAfferentObjectManager, getCredentials, getEfferentObjectManager, getInterfacedAgents, getRealObjectManager, isInterfacedAgent, setCredentials, setIdentifier, shouldInterface
addClientService, addServerService, checkState, clearObjectManagers, createEfferentCommandManager, createIOExecutorService, createIOHandler, createNotificationManager, createSensorObjectManager, disconnect, getAgentObjectManager, getCentralThreadFactory, getClock, getCommonRealityIdentifier, getEfferentCommandManager, getIdentifier, getIOExecutor, getIOHandler, getIOThreadFactory, getNotificationManager, getPeriodicExecutor, getSensorObjectManager, getServerAddressInformation, getState, reset, send, setClock, setCommonRealityIdentifier, shutdown, stateMatches, stop, suspend, waitForState, waitForState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disconnect, getAgentObjectManager, getClock, getEfferentCommandManager, getNotificationManager, getSensorObjectManager, getState, reset, send, shutdown, stateMatches, stop, suspend, waitForState, waitForState
getIdentifier
public static final java.lang.String VOCALIZATION_DURATION_EQUATION
public static final java.lang.String SPEAKER
public java.lang.String getName()
getName
in class AbstractParticipant
public void configure(java.util.Map<java.lang.String,java.lang.String> options) throws java.lang.Exception
configure
in interface IParticipant
configure
in class AbstractParticipant
java.lang.Exception
public void initialize() throws java.lang.Exception
Runnable
_cycle). We also create the default
EfferentCommandHandler
here.initialize
in interface IParticipant
initialize
in class AbstractParticipant
java.lang.Exception
public void start() throws java.lang.Exception
Runnable
_cycle on the Executor
start
in interface IParticipant
start
in class AbstractParticipant
java.lang.Exception
AbstractParticipant.start()
public void shutdown() throws java.lang.Exception
IParticipant
shutdown
in interface IParticipant
shutdown
in class AbstractSensor
java.lang.Exception
public void resume() throws java.lang.Exception
IParticipant
resume
in interface IParticipant
resume
in class AbstractParticipant
java.lang.Exception
public void speak(IAgentObject speaker, VocalizationCommand vocalCommand)
IAfferentObject
for the connecte agentsprotected void agentAdded(IAgentObject agent)
agentAdded
in class AbstractSensor
public void configure(DefaultSpeechSensor sensor, java.util.Map<java.lang.String,java.lang.String> options)
ISpeaker