Class DrawObjectAggregator

java.lang.Object
  extended by DrawObjectAggregator
All Implemented Interfaces:
ISimUICallback, ISwarmDraw

public class DrawObjectAggregator
extends java.lang.Object
implements ISwarmDraw, ISimUICallback


Constructor Summary
DrawObjectAggregator()
           
 
Method Summary
 void addDrawAgent(IDrawAgent agent)
           
 int addEl(ISwarmDraw draw, ISimUICallback callback, IProjection proj, int nXOff, int nYOff)
           
 boolean doCallback(double[] arrLfState, IAgent agent, StateBundle[] arrStates, ISensor[] arrSensors, IEnvironment env, CommGraph graph, double lfSimTime)
          Callback function From ISimUICallback
 java.lang.Object getLastObject()
          From ISimUICallback.
 java.awt.image.BufferedImage grabLastFrame()
           
 void moveEl(int nWhichEl, int nNewXOff, int nNewYOff)
           
 double realTimeToSimTime(java.util.Date dateRealTime)
          Added for interface completeness, probably should not be called from this adapter
 void reDraw(java.awt.Graphics g)
           
 void scaleProjection(int nNewX, int nNewY)
           
 void setEnvDraw(IEnvDraw envDraw)
           
 void setProjection(IProjection proj)
          Pass in a projection class to handle mapping points to screen coords.
 java.util.Date simTimeToRealTime(double lfSimTime)
          Added for interface completeness, probably should not be called from this adapter
 void xlateProjection(int nXOff, int nYOff)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawObjectAggregator

public DrawObjectAggregator()
Method Detail

moveEl

public void moveEl(int nWhichEl,
                   int nNewXOff,
                   int nNewYOff)

addEl

public int addEl(ISwarmDraw draw,
                 ISimUICallback callback,
                 IProjection proj,
                 int nXOff,
                 int nYOff)

setEnvDraw

public void setEnvDraw(IEnvDraw envDraw)
Specified by:
setEnvDraw in interface ISwarmDraw

simTimeToRealTime

public java.util.Date simTimeToRealTime(double lfSimTime)
Added for interface completeness, probably should not be called from this adapter

Specified by:
simTimeToRealTime in interface ISwarmDraw

realTimeToSimTime

public double realTimeToSimTime(java.util.Date dateRealTime)
Added for interface completeness, probably should not be called from this adapter

Specified by:
realTimeToSimTime in interface ISwarmDraw

setProjection

public void setProjection(IProjection proj)
Pass in a projection class to handle mapping points to screen coords. Currently does nothing : possibly fix later.

Specified by:
setProjection in interface ISwarmDraw

addDrawAgent

public void addDrawAgent(IDrawAgent agent)
Specified by:
addDrawAgent in interface ISwarmDraw

grabLastFrame

public java.awt.image.BufferedImage grabLastFrame()

reDraw

public void reDraw(java.awt.Graphics g)
Specified by:
reDraw in interface ISwarmDraw

doCallback

public boolean doCallback(double[] arrLfState,
                          IAgent agent,
                          StateBundle[] arrStates,
                          ISensor[] arrSensors,
                          IEnvironment env,
                          CommGraph graph,
                          double lfSimTime)
Callback function From ISimUICallback

Specified by:
doCallback in interface ISimUICallback
Parameters:
arrLfState - state vector (initially initial state, overwritten with final state)
agent - agent mapping (currently only support for homogenous swarms )
arrStates - non-position components of state of each agent (logic vars and control function)
arrSensors - array of sensor interfaces.
env - environment
graph - new communication graph (if an update is needed pass null otherwise)
lfSimTime - current simulated time
Returns:
true if something unusual has happened

getLastObject

public java.lang.Object getLastObject()
From ISimUICallback. Not properly implemented. Lack of clarity on what proper implementation would be suggests redesign of ISimUICallback. In case we need more info then true/false from doCallback

Specified by:
getLastObject in interface ISimUICallback
Returns:
arbitrary object (meaning depends on derived class)

scaleProjection

public void scaleProjection(int nNewX,
                            int nNewY)
Specified by:
scaleProjection in interface ISwarmDraw

xlateProjection

public void xlateProjection(int nXOff,
                            int nYOff)
Specified by:
xlateProjection in interface ISwarmDraw