aa4mm.basic.agent
Class GenericAgent

java.lang.Object
  extended by aa4mm.basic.agent.GenericAgent

public abstract class GenericAgent
extends java.lang.Object

Generic Agent, this is an abstract class to represent the model agent.

Since:
release Darjeeling
Author:
julien siebert

Field Summary
protected  java.util.ArrayList<InputPort<? extends SimulData>> couplingArtefactInputPortList
          Represents the list of coupling artifacts ports that allow the agent to post data.
protected  java.util.ArrayList<OutputPort<? extends SimulData>> couplingArtefactOutputPortList
          Represents the list of coupling artifacts ports that allow the agent to read data.
protected  GenericModelArtefact modelArtefact
          The model artifact the agent is in charge.
 
Constructor Summary
GenericAgent()
          Constructor
 
Method Summary
 void addInputCouplingArtefactPort(InputPort<? extends SimulData> in)
          Link this agent with an coupling artifact input port
 void addOutputCouplingArtefactPort(OutputPort<? extends SimulData> out)
          Link this agent with an coupling artifact output port
abstract  void executeModel()
          Run the simulation.
 SimulTime getCurrentTime()
           
 SimulTime getNextTime()
           
 void initModel()
          Initiate the model
protected  void post(SimulData data)
          Post a given simulation data to the right coupling artifact input port.
abstract  void postOutputData()
          Read model output data from the model artifact and post it to the coupling artifact input port.
abstract  void readInputData()
          Read model input data from the coupling artifact output port and sent it to the model artifact.
abstract  void setInitialParameters()
          A method to get the initial and external parameters from the external simulators and set them to the model.
 void setModelArtefact(GenericModelArtefact modelArtefact)
          Link this agent with the modelArtefact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

couplingArtefactInputPortList

protected java.util.ArrayList<InputPort<? extends SimulData>> couplingArtefactInputPortList
Represents the list of coupling artifacts ports that allow the agent to post data.


couplingArtefactOutputPortList

protected java.util.ArrayList<OutputPort<? extends SimulData>> couplingArtefactOutputPortList
Represents the list of coupling artifacts ports that allow the agent to read data.


modelArtefact

protected GenericModelArtefact modelArtefact
The model artifact the agent is in charge.

Constructor Detail

GenericAgent

public GenericAgent()
Constructor

Method Detail

executeModel

public abstract void executeModel()
Run the simulation. Implement here the execution policy (run step-by-step, execute one simulation event, run simulation for a given simulation time interval...)


initModel

public void initModel()
Initiate the model


getNextTime

public SimulTime getNextTime()
Returns:
the next simulation time

getCurrentTime

public SimulTime getCurrentTime()
Returns:
the current simulation time

readInputData

public abstract void readInputData()
Read model input data from the coupling artifact output port and sent it to the model artifact.


postOutputData

public abstract void postOutputData()
Read model output data from the model artifact and post it to the coupling artifact input port.


post

protected void post(SimulData data)
Post a given simulation data to the right coupling artifact input port.

Parameters:
data -

setModelArtefact

public void setModelArtefact(GenericModelArtefact modelArtefact)
Link this agent with the modelArtefact.

Parameters:
modelArtefact -

addInputCouplingArtefactPort

public void addInputCouplingArtefactPort(InputPort<? extends SimulData> in)
Link this agent with an coupling artifact input port


addOutputCouplingArtefactPort

public void addOutputCouplingArtefactPort(OutputPort<? extends SimulData> out)
Link this agent with an coupling artifact output port


setInitialParameters

public abstract void setInitialParameters()
A method to get the initial and external parameters from the external simulators and set them to the model.