public class SimulationServiceProxy extends jade.core.SliceProxy implements SimulationServiceSlice
SimulationServiceSlice
.SERVICE_DISPLAY_AGENT_NOTIFICATION, SERVICE_DISPLAY_AGENT_SET_ENVIRONMENT_MODEL, SERVICE_DISPLAY_CONTAINER_UN_REGISTRATION, SERVICE_SET_AGENT_MIGRATION, SERVICE_STOP_SIMULATION_AGENTS, SERVICE_SYNCH_GET_REMOTE_TIME, SERVICE_SYNCH_SET_TIME_DIFF, SIM_GET_ENVIRONMENT_MODEL_FROM_SETUP, SIM_GET_ENVIRONMENT_NEXT_PARTS, SIM_NOTIFY_AGENT, SIM_NOTIFY_MANAGER, SIM_NOTIFY_MANAGER_PUT_AGENT_ANSWERS, SIM_PAUSE_SIMULATION, SIM_RESET_ENVIRONMENT_NEXT_PARTS, SIM_SET_ANSWERS_EXPECTED, SIM_SET_ENVIRONMENT_MODEL, SIM_SET_ENVIRONMENT_NEXT_PART, SIM_SET_MANAGER_AGENT, SIM_STEP_SIMULATION
Constructor and Description |
---|
SimulationServiceProxy() |
Modifier and Type | Method and Description |
---|---|
void |
displayAgentNotification(EnvironmentNotification notification)
Notifies all registered DisplayAgents.
|
void |
displayAgentSetEnvironmentModel(EnvironmentModel envModel)
Notifies all registered DisplayAgents about a new EnvironmentModel.
|
void |
doDisplayAgentContainerUnRegister(java.lang.String containerName,
boolean isRegisterContainer)
Does the (un-)registration for a display agent in a container .
|
java.util.Hashtable<jade.core.AID,java.lang.Object> |
getEnvironmentInstanceNextParts()
This method returns the complete environment-model-changes from the Main-Container.
|
EnvironmentModel |
getEnvironmentModelFromSetup()
Returns the
EnvironmentModel from the setup within the end user application. |
long |
getRemoteTime()
Returns the remote time as long.
|
boolean |
notifyAgent(jade.core.AID agentAID,
EnvironmentNotification notification)
Notifies a specified sensor agent by using an EnvironmentNotification.
|
boolean |
notifyManager(EnvironmentNotification notification)
Notifies a SimulationManager by using an EnvironmentNotification.
|
void |
notifyManagerPutAgentAnswers(java.util.Hashtable<jade.core.AID,java.lang.Object> allAgentAnswers)
Sends the current set of agent answers to the manager agent of the environment.
|
void |
resetEnvironmentInstanceNextParts()
This method resets the hash with the single environment-model-changes.
|
void |
setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents)
Sets the new locations to the agents.
|
void |
setAnswersExpected(int answersExpected)
Sets the number of changes/answers expected from the simulation cycle.
|
void |
setEnvironmentInstanceNextPart(java.util.Hashtable<jade.core.AID,java.lang.Object> nextPartsLocal)
Sends the local next parts of the environment-model to the Main-Container.
|
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(EnvironmentManagerDescription envManager)
Sets the
EnvironmentManagerDescription of the manager agent. |
void |
setPauseSimulation(boolean pauseSimulation)
Sets to pause the simulation.
|
void |
setRemoteTimeDiff(long timeDifference)
Sets the remote time difference in milliseconds for synchronised time.
|
void |
stepSimulation(EnvironmentModel envModel,
boolean aSynchron)
Steps a simulation by using the current
EnvironmentModel and the number of expected changes / answers. |
void |
stopSimulationAgents()
Stops the simulation agents.
|
public long getRemoteTime() throws jade.core.IMTPException
SimulationServiceSlice
getRemoteTime
in interface SimulationServiceSlice
jade.core.IMTPException
- the IMTPExceptionpublic void setRemoteTimeDiff(long timeDifference) throws jade.core.IMTPException
SimulationServiceSlice
setRemoteTimeDiff
in interface SimulationServiceSlice
timeDifference
- the new remote time diffjade.core.IMTPException
- the IMTPExceptionpublic void setManagerAgent(EnvironmentManagerDescription envManager) throws jade.core.IMTPException
SimulationServiceSlice
EnvironmentManagerDescription
of the manager agent.setManagerAgent
in interface SimulationServiceSlice
envManager
- the new manager agentjade.core.IMTPException
- the IMTPExceptionEnvironmentManagerDescription
public EnvironmentModel getEnvironmentModelFromSetup() throws jade.core.IMTPException
SimulationServiceSlice
EnvironmentModel
from the setup within the end user application.getEnvironmentModelFromSetup
in interface SimulationServiceSlice
jade.core.IMTPException
- the IMTP exceptionpublic void setEnvironmentModel(EnvironmentModel envModel, boolean notifySensorAgents) throws jade.core.IMTPException
SimulationServiceSlice
EnvironmentModel
without
a direct notification to the involved agents.setEnvironmentModel
in interface SimulationServiceSlice
envModel
- the current or new EnvironmentModel instancenotifySensorAgents
- true, if the sensor agents should be also notifiedjade.core.IMTPException
- the IMTPExceptionEnvironmentModel
public void stepSimulation(EnvironmentModel envModel, boolean aSynchron) throws jade.core.IMTPException
SimulationServiceSlice
EnvironmentModel
and the number of expected changes / answers.stepSimulation
in interface SimulationServiceSlice
envModel
- the current or new EnvironmentModelaSynchron
- true, if the notification has to be done asynchronouslyjade.core.IMTPException
- the iMTP exceptionEnvironmentModel
public void setAnswersExpected(int answersExpected) throws jade.core.IMTPException
SimulationServiceSlice
setAnswersExpected
in interface SimulationServiceSlice
answersExpected
- the number of answers expectedjade.core.IMTPException
- the IMTPExceptionpublic boolean notifyAgent(jade.core.AID agentAID, EnvironmentNotification notification) throws jade.core.IMTPException
SimulationServiceSlice
notifyAgent
in interface SimulationServiceSlice
agentAID
- the agent AIDnotification
- the notificationjade.core.IMTPException
- the IMTPExceptionServiceSensor
,
ServiceActuator
,
SimulationAgent
,
EnvironmentNotification
public void setPauseSimulation(boolean pauseSimulation) throws jade.core.IMTPException
SimulationServiceSlice
setPauseSimulation
in interface SimulationServiceSlice
pauseSimulation
- the new pause simulationjade.core.IMTPException
- the IMTPExceptionpublic void setEnvironmentInstanceNextPart(java.util.Hashtable<jade.core.AID,java.lang.Object> nextPartsLocal) throws jade.core.IMTPException
SimulationServiceSlice
setEnvironmentInstanceNextPart
in interface SimulationServiceSlice
nextPartsLocal
- the Hashtable of local environment changes, coming from different agentsjade.core.IMTPException
- the IMTPExceptionpublic boolean notifyManager(EnvironmentNotification notification) throws jade.core.IMTPException
SimulationServiceSlice
notifyManager
in interface SimulationServiceSlice
notification
- the notificationjade.core.IMTPException
- the IMTPExceptionSimulationManagerAgent
,
EnvironmentNotification
public void notifyManagerPutAgentAnswers(java.util.Hashtable<jade.core.AID,java.lang.Object> allAgentAnswers) throws jade.core.IMTPException
SimulationServiceSlice
notifyManagerPutAgentAnswers
in interface SimulationServiceSlice
allAgentAnswers
- the Hashtable of all agent answersjade.core.IMTPException
- the IMTPExceptionpublic java.util.Hashtable<jade.core.AID,java.lang.Object> getEnvironmentInstanceNextParts() throws jade.core.IMTPException
SimulationServiceSlice
getEnvironmentInstanceNextParts
in interface SimulationServiceSlice
jade.core.IMTPException
- the IMTPExceptionpublic void resetEnvironmentInstanceNextParts() throws jade.core.IMTPException
SimulationServiceSlice
resetEnvironmentInstanceNextParts
in interface SimulationServiceSlice
jade.core.IMTPException
- the IMTPExceptionpublic void stopSimulationAgents() throws jade.core.IMTPException
SimulationServiceSlice
stopSimulationAgents
in interface SimulationServiceSlice
jade.core.IMTPException
- the IMTPExceptionpublic void setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents) throws jade.core.IMTPException
SimulationServiceSlice
setAgentMigration
in interface SimulationServiceSlice
transferAgents
- the agents to migratejade.core.IMTPException
- the IMTPExceptionLoadAgentMap.AID_Container
public void displayAgentSetEnvironmentModel(EnvironmentModel envModel) throws jade.core.IMTPException
SimulationServiceSlice
displayAgentSetEnvironmentModel
in interface SimulationServiceSlice
envModel
- the EnvironmentModel
jade.core.IMTPException
- the iMTP exceptionpublic void displayAgentNotification(EnvironmentNotification notification) throws jade.core.IMTPException
SimulationServiceSlice
displayAgentNotification
in interface SimulationServiceSlice
notification
- the notificationjade.core.IMTPException
- the iMTP exceptionpublic void doDisplayAgentContainerUnRegister(java.lang.String containerName, boolean isRegisterContainer) throws jade.core.IMTPException
SimulationServiceSlice
doDisplayAgentContainerUnRegister
in interface SimulationServiceSlice
containerName
- the container nameisRegisterContainer
- the is register containerjade.core.IMTPException
- the IMTP exception