public interface SimulationServiceHelper
extends jade.core.ServiceHelper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_NAME
The Constant SERVICE_NAME.
|
static java.lang.String |
SERVICE_NODE_DESCRIPTION_FILE
The Constant SERVICE_NODE_DESCRIPTION_FILE.
|
Modifier and Type | Method and Description |
---|---|
void |
displayAgentNotification(EnvironmentNotification notification)
Notifies all registered DisplayAgents.
|
void |
displayAgentRegister(AbstractDisplayAgent displayAgent)
Registers a DisplayAgent at the SimulationService.
|
void |
displayAgentSetEnvironmentModel(EnvironmentModel envModel)
Notifies all registered DisplayAgents about a new EnvironmentModel.
|
void |
displayAgentUnregister(AbstractDisplayAgent displayAgent)
Unregisters a DisplayAgent at the SimulationService.
|
java.util.Hashtable<jade.core.AID,java.lang.Object> |
getEnvironmentInstanceNextParts()
Gets the parts for the next environment instance coming from different
SimulationAgent . |
EnvironmentModel |
getEnvironmentModel()
Returns the current the
EnvironmentModel . |
EnvironmentModel |
getEnvironmentModelFromSetup()
Returns the
EnvironmentModel from the setup of the end user application. |
jade.core.AID |
getManagerAgent()
Returns the manager agent for the simulation/environment.
|
boolean |
getStepSimulationAsynchronous()
Returns the information, if the notification about environment changes has to be done asynchronously.
|
java.util.Date |
getSynchTimeDate()
Returns the synchronised time as date.
|
long |
getSynchTimeDifferenceMillis()
Returns the difference in milliseconds for synchronised time.
|
long |
getSynchTimeMillis()
Returns the synchronised time in milliseconds.
|
boolean |
notifyManagerAgent(EnvironmentNotification notification)
Notifies a SimulationManager by using an EnvironmentNotification.
|
boolean |
notifySensorAgent(jade.core.AID agentAID,
EnvironmentNotification notification)
Notifies a specified sensor agent by using an EnvironmentNotification.
|
void |
resetEnvironmentInstanceNextParts()
This method will reset the Hashtable of environment changes for the next environment instance.
|
void |
sensorPlugIn(ServiceSensor sensor)
Allows to plug in a
ServiceSensor into the SimulationService. |
void |
sensorPlugIn(ServiceSensor sensor,
boolean passive)
Allows to plug in a
ServiceSensor into the SimulationService. |
void |
sensorPlugIn4Manager(ServiceSensorManager sensor)
Allows to plug in a
ServiceSensorManager into the SimulationService. |
void |
sensorPlugOut(ServiceSensor sensor)
Allows to plug out a
ServiceSensor into the SimulationService. |
void |
sensorPlugOut4Manager(ServiceSensorManager sensor)
Allows to plug out a
ServiceSensorManager into the SimulationService. |
void |
setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents)
Sets the agents to migrate to a different location/container.
|
void |
setEnvironmentInstanceNextPart(jade.core.AID fromAgent,
java.lang.Object nextPart)
This method can be used by a
SimulationAgent in order to set their part
of the environment change. |
void |
setEnvironmentModel(EnvironmentModel envModel)
Can be used in order to set and distribute an
EnvironmentModel without
a direct notification to the involved agents. |
void |
setEnvironmentModel(EnvironmentModel envModel,
boolean notifySensorAgents)
Can be used in order to set and distribute an
EnvironmentModel without
a direct notification to the involved agents. |
void |
setManagerAgent(jade.core.AID agentAddress)
Sets the manager agent of the simulation/environment.
|
void |
setPauseSimulation(boolean pauseSimulation)
Sets the pause of the simulation.
|
void |
setStepSimulationAsynchronous(boolean stepAsynchronous)
Sets to step a simulation by notify all involved agents in a asynchronous way.
|
void |
stepSimulation(EnvironmentModel envModel,
int answersExpected)
Steps a simulation by using the current
EnvironmentModel and the number of expected changes / answers. |
void |
stepSimulation(EnvironmentModel envModel,
int answersExpected,
boolean aSynchron)
Steps a simulation by using the current
EnvironmentModel and the number of expected changes / answers. |
void |
stopSimulationAgents()
Stops all agents, which are connected to the SimulationService via the Actuator/Sensor relationship .
|
static final java.lang.String SERVICE_NAME
static final java.lang.String SERVICE_NODE_DESCRIPTION_FILE
long getSynchTimeDifferenceMillis() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionlong getSynchTimeMillis() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionjava.util.Date getSynchTimeDate() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionvoid stopSimulationAgents() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionvoid setPauseSimulation(boolean pauseSimulation) throws jade.core.ServiceException
pauseSimulation
- the new pause simulationjade.core.ServiceException
- the ServiceExceptionvoid setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents) throws jade.core.ServiceException
transferAgents
- the new agent migrationjade.core.ServiceException
- the ServiceExceptionLoadAgentMap.AID_Container
void setManagerAgent(jade.core.AID agentAddress) throws jade.core.ServiceException
agentAddress
- the new manager agentjade.core.ServiceException
- the ServiceExceptionjade.core.AID getManagerAgent() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionvoid sensorPlugIn(ServiceSensor sensor) throws jade.core.ServiceException
ServiceSensor
into the SimulationService.sensor
- the ServiceSensor
to plug injade.core.ServiceException
- the ServiceExceptionvoid sensorPlugIn(ServiceSensor sensor, boolean passive) throws jade.core.ServiceException
ServiceSensor
into the SimulationService.sensor
- the ServiceSensor
to plug inpassive
- true, if the sensor is just listening to the actuator, but that there is no answer to expectjade.core.ServiceException
- the ServiceExceptionvoid sensorPlugOut(ServiceSensor sensor) throws jade.core.ServiceException
ServiceSensor
into the SimulationService.sensor
- the ServiceSensor
to plug outjade.core.ServiceException
- the ServiceExceptionvoid sensorPlugIn4Manager(ServiceSensorManager sensor) throws jade.core.ServiceException
ServiceSensorManager
into the SimulationService.sensor
- the ServiceSensorManager
to plug injade.core.ServiceException
- the ServiceExceptionvoid sensorPlugOut4Manager(ServiceSensorManager sensor) throws jade.core.ServiceException
ServiceSensorManager
into the SimulationService.sensor
- the ServiceSensorManager
to plug outjade.core.ServiceException
- the ServiceExceptionvoid setStepSimulationAsynchronous(boolean stepAsynchronous) throws jade.core.ServiceException
stepAsynchronous
- true, if the notification has to be done asynchronouslyjade.core.ServiceException
- the ServiceExceptionboolean getStepSimulationAsynchronous() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionvoid stepSimulation(EnvironmentModel envModel, int answersExpected) throws jade.core.ServiceException
EnvironmentModel
and the number of expected changes / answers.envModel
- the current or new EnvironmentModelanswersExpected
- the changes / answers expected from the simulation agentsjade.core.ServiceException
- the ServiceExceptionEnvironmentModel
void stepSimulation(EnvironmentModel envModel, int answersExpected, boolean aSynchron) throws jade.core.ServiceException
EnvironmentModel
and the number of expected changes / answers.envModel
- the current or new EnvironmentModelanswersExpected
- the changes / answers expected from the simulation agentsaSynchron
- true, if the notification has to be done asynchronouslyjade.core.ServiceException
- the ServiceExceptionEnvironmentModel
boolean notifySensorAgent(jade.core.AID agentAID, EnvironmentNotification notification) throws jade.core.ServiceException
agentAID
- the agent AIDnotification
- the notificationjade.core.ServiceException
- the ServiceExceptionServiceSensor
,
ServiceActuator
,
SimulationAgent
,
EnvironmentNotification
boolean notifyManagerAgent(EnvironmentNotification notification) throws jade.core.ServiceException
notification
- the notificationjade.core.ServiceException
- the ServiceExceptionSimulationManagerAgent
,
EnvironmentNotification
EnvironmentModel getEnvironmentModelFromSetup() throws jade.core.ServiceException
EnvironmentModel
from the setup of the end user application.jade.core.ServiceException
- the service exceptionEnvironmentModel getEnvironmentModel() throws jade.core.ServiceException
EnvironmentModel
.jade.core.ServiceException
- the ServiceExceptionEnvironmentModel
void setEnvironmentModel(EnvironmentModel envModel) throws jade.core.ServiceException
EnvironmentModel
without
a direct notification to the involved agents.envModel
- the current or new EnvironmentModel instancejade.core.ServiceException
- the ServiceExceptionEnvironmentModel
void setEnvironmentModel(EnvironmentModel envModel, boolean notifySensorAgents) throws jade.core.ServiceException
EnvironmentModel
without
a direct notification to the involved agents.envModel
- the current or new EnvironmentModel instancenotifySensorAgents
- true, if the sensor agents should be also notifiedjade.core.ServiceException
- the ServiceExceptionEnvironmentModel
void setEnvironmentInstanceNextPart(jade.core.AID fromAgent, java.lang.Object nextPart) throws jade.core.ServiceException
SimulationAgent
in order to set their part
of the environment change.fromAgent
- the AID of the agentnextPart
- the agents part for the next environmentjade.core.ServiceException
- the ServiceExceptionSimulationAgent
void resetEnvironmentInstanceNextParts() throws jade.core.ServiceException
jade.core.ServiceException
- the ServiceExceptionjava.util.Hashtable<jade.core.AID,java.lang.Object> getEnvironmentInstanceNextParts() throws jade.core.ServiceException
SimulationAgent
.jade.core.ServiceException
- the ServiceExceptionvoid displayAgentRegister(AbstractDisplayAgent displayAgent) throws jade.core.ServiceException
displayAgent
- the instance of the display agentjade.core.ServiceException
- the service exceptionAbstractDisplayAgent
,
SimulationService
void displayAgentUnregister(AbstractDisplayAgent displayAgent) throws jade.core.ServiceException
displayAgent
- the instance of the display agentjade.core.ServiceException
- the service exceptionAbstractDisplayAgent
,
SimulationService
void displayAgentSetEnvironmentModel(EnvironmentModel envModel) throws jade.core.ServiceException
envModel
- the EnvironmentModeljade.core.ServiceException
- the service exceptionAbstractDisplayAgent
void displayAgentNotification(EnvironmentNotification notification) throws jade.core.ServiceException
notification
- the EnvironmentNotificationjade.core.ServiceException
- the service exception