public class ServiceActuator
extends java.lang.Thread
SimulationService, which is able to
inform all connected SimulationAgent with an integrated ServiceSensor
about a new EnvironmentModel or with an EnvironmentNotification.
Furthermore it can inform the connected agents about the Location, where they
have to migrate, delegated by the load balancing process, or that they just have to die.
SimulationService,
SimulationAgent,
ServiceSensor,
EnvironmentModel,
EnvironmentNotification,
Location| Constructor and Description |
|---|
ServiceActuator(java.lang.String containerName)
Instantiates a new service actuator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNoOfSimulationAnswersExpected()
Returns the number of simulation answers expected.
|
jade.core.AID[] |
getSensorAgents()
Returns all agents registered to this actuator by a sensor.
|
void |
notifySensor(EnvironmentModel environmentModel,
jade.core.AID aid)
Notifies the sensor of the specified agent about a new environment model.
|
boolean |
notifySensorAgent(jade.core.AID aid,
EnvironmentNotification notification)
Notifies an agent through the service sensor.
|
void |
notifySensorAgentsDoDelete()
This method will kill all registered SimulationAgents
to provide a faster(!)
|
void |
notifySensorPauseSimulation(boolean isPauseSimulation)
Notify that simulation has to be paused or not.
|
void |
notifySensors(EnvironmentModel environmentModel,
boolean async)
This method informs all Sensors about the new environment model.
|
void |
plugIn(ServiceSensor currSensor)
Method for agents to plug-in to this actuator.
|
void |
plugInPassive(ServiceSensor currSensor)
Method for agents to plug-in to this actuator, but it is not
expected that the connected agent will answer to the change
of the environment.
|
void |
plugOut(ServiceSensor currSensor)
Method to plug-out from this actuator
|
void |
run() |
void |
setMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents)
This method will place a 'newLocation'-Object to every agent which is registered to this actuator.
|
void |
shutdown()
Manages to shutdown the Thread of this ServiceActuator.
|
activeCount, checkAccess, clone, 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, yieldpublic ServiceActuator(java.lang.String containerName)
containerName - the container namepublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void shutdown()
public void plugIn(ServiceSensor currSensor)
currSensor - the ServiceSensor to plug-inpublic void plugInPassive(ServiceSensor currSensor)
currSensor - the ServiceSensor to plug-inpublic void plugOut(ServiceSensor currSensor)
currSensor - the ServiceSensor to plug-outpublic jade.core.AID[] getSensorAgents()
public int getNoOfSimulationAnswersExpected()
public void notifySensors(EnvironmentModel environmentModel, boolean async)
environmentModel - the new EnvironmentModelasync - set true, if this should be done asynchronouslypublic void notifySensor(EnvironmentModel environmentModel, jade.core.AID aid)
environmentModel - the environment modelaid - the aid of the designated agentpublic void notifySensorAgentsDoDelete()
public void notifySensorPauseSimulation(boolean isPauseSimulation)
isPauseSimulation - the is pause simulationpublic void setMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents)
transferAgents - the Vector of agents to migratepublic boolean notifySensorAgent(jade.core.AID aid,
EnvironmentNotification notification)
aid - the aidnotification - the notification