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
SimulationServiceSlicegetRemoteTime in interface SimulationServiceSlicejade.core.IMTPException - the IMTPExceptionpublic void setRemoteTimeDiff(long timeDifference)
throws jade.core.IMTPException
SimulationServiceSlicesetRemoteTimeDiff in interface SimulationServiceSlicetimeDifference - the new remote time diffjade.core.IMTPException - the IMTPExceptionpublic void setManagerAgent(EnvironmentManagerDescription envManager) throws jade.core.IMTPException
SimulationServiceSliceEnvironmentManagerDescription of the manager agent.setManagerAgent in interface SimulationServiceSliceenvManager - the new manager agentjade.core.IMTPException - the IMTPExceptionEnvironmentManagerDescriptionpublic EnvironmentModel getEnvironmentModelFromSetup() throws jade.core.IMTPException
SimulationServiceSliceEnvironmentModel from the setup within the end user application.getEnvironmentModelFromSetup in interface SimulationServiceSlicejade.core.IMTPException - the IMTP exceptionpublic void setEnvironmentModel(EnvironmentModel envModel, boolean notifySensorAgents) throws jade.core.IMTPException
SimulationServiceSliceEnvironmentModel without
a direct notification to the involved agents.setEnvironmentModel in interface SimulationServiceSliceenvModel - the current or new EnvironmentModel instancenotifySensorAgents - true, if the sensor agents should be also notifiedjade.core.IMTPException - the IMTPExceptionEnvironmentModelpublic void stepSimulation(EnvironmentModel envModel, boolean aSynchron) throws jade.core.IMTPException
SimulationServiceSliceEnvironmentModel and the number of expected changes / answers.stepSimulation in interface SimulationServiceSliceenvModel - the current or new EnvironmentModelaSynchron - true, if the notification has to be done asynchronouslyjade.core.IMTPException - the iMTP exceptionEnvironmentModelpublic void setAnswersExpected(int answersExpected)
throws jade.core.IMTPException
SimulationServiceSlicesetAnswersExpected in interface SimulationServiceSliceanswersExpected - the number of answers expectedjade.core.IMTPException - the IMTPExceptionpublic boolean notifyAgent(jade.core.AID agentAID,
EnvironmentNotification notification)
throws jade.core.IMTPException
SimulationServiceSlicenotifyAgent in interface SimulationServiceSliceagentAID - the agent AIDnotification - the notificationjade.core.IMTPException - the IMTPExceptionServiceSensor,
ServiceActuator,
SimulationAgent,
EnvironmentNotificationpublic void setPauseSimulation(boolean pauseSimulation)
throws jade.core.IMTPException
SimulationServiceSlicesetPauseSimulation in interface SimulationServiceSlicepauseSimulation - the new pause simulationjade.core.IMTPException - the IMTPExceptionpublic void setEnvironmentInstanceNextPart(java.util.Hashtable<jade.core.AID,java.lang.Object> nextPartsLocal)
throws jade.core.IMTPException
SimulationServiceSlicesetEnvironmentInstanceNextPart in interface SimulationServiceSlicenextPartsLocal - the Hashtable of local environment changes, coming from different agentsjade.core.IMTPException - the IMTPExceptionpublic boolean notifyManager(EnvironmentNotification notification) throws jade.core.IMTPException
SimulationServiceSlicenotifyManager in interface SimulationServiceSlicenotification - the notificationjade.core.IMTPException - the IMTPExceptionSimulationManagerAgent,
EnvironmentNotificationpublic void notifyManagerPutAgentAnswers(java.util.Hashtable<jade.core.AID,java.lang.Object> allAgentAnswers)
throws jade.core.IMTPException
SimulationServiceSlicenotifyManagerPutAgentAnswers in interface SimulationServiceSliceallAgentAnswers - the Hashtable of all agent answersjade.core.IMTPException - the IMTPExceptionpublic java.util.Hashtable<jade.core.AID,java.lang.Object> getEnvironmentInstanceNextParts()
throws jade.core.IMTPException
SimulationServiceSlicegetEnvironmentInstanceNextParts in interface SimulationServiceSlicejade.core.IMTPException - the IMTPExceptionpublic void resetEnvironmentInstanceNextParts()
throws jade.core.IMTPException
SimulationServiceSliceresetEnvironmentInstanceNextParts in interface SimulationServiceSlicejade.core.IMTPException - the IMTPExceptionpublic void stopSimulationAgents()
throws jade.core.IMTPException
SimulationServiceSlicestopSimulationAgents in interface SimulationServiceSlicejade.core.IMTPException - the IMTPExceptionpublic void setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents) throws jade.core.IMTPException
SimulationServiceSlicesetAgentMigration in interface SimulationServiceSlicetransferAgents - the agents to migratejade.core.IMTPException - the IMTPExceptionLoadAgentMap.AID_Containerpublic void displayAgentSetEnvironmentModel(EnvironmentModel envModel) throws jade.core.IMTPException
SimulationServiceSlicedisplayAgentSetEnvironmentModel in interface SimulationServiceSliceenvModel - the EnvironmentModeljade.core.IMTPException - the iMTP exceptionpublic void displayAgentNotification(EnvironmentNotification notification) throws jade.core.IMTPException
SimulationServiceSlicedisplayAgentNotification in interface SimulationServiceSlicenotification - the notificationjade.core.IMTPException - the iMTP exceptionpublic void doDisplayAgentContainerUnRegister(java.lang.String containerName,
boolean isRegisterContainer)
throws jade.core.IMTPException
SimulationServiceSlicedoDisplayAgentContainerUnRegister in interface SimulationServiceSlicecontainerName - the container nameisRegisterContainer - the is register containerjade.core.IMTPException - the IMTP exception