gridiq.agents
Class GridIQAgent

java.lang.Object
  extended by jade.core.Agent
      extended by gridiq.agents.GridIQAgent
All Implemented Interfaces:
jade.core.TimerListener, java.io.Serializable, java.lang.Runnable

public class GridIQAgent
extends jade.core.Agent

The super class for JADE agents that can interact with GridIQ. This class provides the behaviour that enables agents to receive simulation results and obtain a reference to a bus in a GridIQ network.

Author:
colin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.Agent
jade.core.Agent.Interrupted
 
Field Summary
protected  Bus bus
           
protected  BusResult busResult
           
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_CLASS
 
Constructor Summary
GridIQAgent()
           
 
Method Summary
 Bus getBus()
          Gets the bus this agent controls.
 BusResult getBusResult()
          Gets the most recent simulation result received by this agent
 int getTimestep()
          Gets the current simulation time step according to this agent.
 void setBusResult(BusResult bus)
          Sets the current simulation result for the agent.
protected  void setup()
          The initial setup of the agent.
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, createMessageQueue, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, removeTimer, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setO2AManager, setQueueSize, takeDown, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

busResult

protected BusResult busResult

bus

protected Bus bus
Constructor Detail

GridIQAgent

public GridIQAgent()
Method Detail

setup

protected void setup()
The initial setup of the agent. Takes the first instantiation argument to the agent as a reference to the Bus this agent can control. This setup method also enables object2Agent communication and adds a ReceiveBusData behaviour to this agent.

Overrides:
setup in class jade.core.Agent

setBusResult

public void setBusResult(BusResult bus)
Sets the current simulation result for the agent. The agent time step is updated to the time step specified in the simulation result.

Parameters:
bus - The bus simulation result to set for this agent.

getTimestep

public int getTimestep()
Gets the current simulation time step according to this agent.

Returns:
the current time step for this agent.

getBus

public Bus getBus()
Gets the bus this agent controls.

Returns:
the bus this agent controls.

getBusResult

public BusResult getBusResult()
Gets the most recent simulation result received by this agent

Returns:
the most recent simulation result received by this agent.