Class BcastStorage

java.lang.Object
  extended by BcastStorage
All Implemented Interfaces:
ILogicVarBundle, IPosBcast

public class BcastStorage
extends java.lang.Object
implements IPosBcast


Nested Class Summary
static class BcastStorage.BcastStorageMsg
           
static class BcastStorage.BcastStorageMsgCompound
           
 
Nested classes/interfaces inherited from interface IPosBcast
IPosBcast.IPosBcastMsg
 
Constructor Summary
BcastStorage()
           
BcastStorage(BcastStorage src)
           
BcastStorage(int nAgents)
           
 
Method Summary
 void forceUpdate(int nId, double[] arrLfPos, double lfTime)
           
 java.lang.Boolean getBoolVar(java.lang.Object refObject)
          gets a Boolean (wrapping a boolean) referred to by an object.
 int getDim()
           
 int getId()
          Gets unique Id of this agent
 java.lang.Integer getIntVar(java.lang.Object refObject)
          gets an Integer (wrapping an int) referred to by an object.
 double getLastTime(int nAgent)
          Gets the time when the position estimate for nAgent was last valid
 IPosBcast.IPosBcastMsg getMsg()
          not neccessarily const, could modify state
 int getNumAgents()
          Gets number of agents in swarm
 double[] getPos(int nAgent)
          Gets the most recent known position of agent nAgent
 boolean haveAllInfo()
          Returns true if the information on each agent is valid, false otherwise
 boolean haveInfo(int nAgent)
          Returns true if the information on this agent is valid, false otherwise
 boolean insertBoolVar(java.lang.Object refObject, boolean bValue)
          inserts an boolean value (see getBoolVar).
 boolean insertIntVar(java.lang.Object refObject, int nValue)
          inserts an integer value (see getIntvar).
 ILogicVarBundle makeCopy()
          makes a copy and returns it
 void removeVar(java.lang.Object refObject)
          Removes any values indexed by refObject
 void reset(int nAgents, int nDim)
           
 void setId(int nId)
          Sets unique Id of this agent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BcastStorage

public BcastStorage()

BcastStorage

public BcastStorage(int nAgents)

BcastStorage

public BcastStorage(BcastStorage src)
Method Detail

getDim

public int getDim()
Specified by:
getDim in interface IPosBcast
Returns:
dimensionality in which these agents live

reset

public void reset(int nAgents,
                  int nDim)

haveInfo

public boolean haveInfo(int nAgent)
Description copied from interface: IPosBcast
Returns true if the information on this agent is valid, false otherwise

Specified by:
haveInfo in interface IPosBcast
Parameters:
nAgent - unique identifier of agent we are requesting the position of
Returns:
true if we have any info

getLastTime

public double getLastTime(int nAgent)
Description copied from interface: IPosBcast
Gets the time when the position estimate for nAgent was last valid

Specified by:
getLastTime in interface IPosBcast
Parameters:
nAgent - unique identifier of agent we are requesting info about
Returns:
time position data for nAgent was last valid

getPos

public double[] getPos(int nAgent)
Description copied from interface: IPosBcast
Gets the most recent known position of agent nAgent

Specified by:
getPos in interface IPosBcast
Parameters:
nAgent - unique identifier of agent we are requesting the position of
Returns:
position array

forceUpdate

public void forceUpdate(int nId,
                        double[] arrLfPos,
                        double lfTime)
Specified by:
forceUpdate in interface IPosBcast

haveAllInfo

public boolean haveAllInfo()
Returns true if the information on each agent is valid, false otherwise

Specified by:
haveAllInfo in interface IPosBcast
Returns:
true if we have info for every agent

getNumAgents

public int getNumAgents()
Gets number of agents in swarm

Specified by:
getNumAgents in interface IPosBcast
Returns:
number of agents

getMsg

public IPosBcast.IPosBcastMsg getMsg()
Description copied from interface: IPosBcast
not neccessarily const, could modify state

Specified by:
getMsg in interface IPosBcast
Returns:

makeCopy

public ILogicVarBundle makeCopy()
Description copied from interface: ILogicVarBundle
makes a copy and returns it

Specified by:
makeCopy in interface ILogicVarBundle

setId

public void setId(int nId)
Description copied from interface: ILogicVarBundle
Sets unique Id of this agent

Specified by:
setId in interface ILogicVarBundle

getIntVar

public java.lang.Integer getIntVar(java.lang.Object refObject)
gets an Integer (wrapping an int) referred to by an object. returns null if refObject is of invalid type or indexes an invalid logic var. Note: The original specification only allowed boolean variables in this place. Obviously some applications may want to use collections of boolean variables to represent integers over a finite fixed range, or rationals with finite fixed precision over a finite fixed range. This function is merely provided as a shortcut towards this end.

Specified by:
getIntVar in interface ILogicVarBundle

insertIntVar

public boolean insertIntVar(java.lang.Object refObject,
                            int nValue)
inserts an integer value (see getIntvar). Returns fals if this insert was not permitted

Specified by:
insertIntVar in interface ILogicVarBundle
See Also:
ILogicVarBundle.getIntVar(java.lang.Object)

removeVar

public void removeVar(java.lang.Object refObject)
Removes any values indexed by refObject

Specified by:
removeVar in interface ILogicVarBundle
Parameters:
refObject - remove values associated with this.

getBoolVar

public java.lang.Boolean getBoolVar(java.lang.Object refObject)
gets a Boolean (wrapping a boolean) referred to by an object. returns null if refObject is of invalid type or indexes an invalid logic var.

Specified by:
getBoolVar in interface ILogicVarBundle

insertBoolVar

public boolean insertBoolVar(java.lang.Object refObject,
                             boolean bValue)
inserts an boolean value (see getBoolVar). Returns fals if this insert was not permitted

Specified by:
insertBoolVar in interface ILogicVarBundle
See Also:
ILogicVarBundle.getBoolVar(java.lang.Object)

getId

public int getId()
Gets unique Id of this agent

Specified by:
getId in interface ILogicVarBundle