Class SynchronousScheduler

java.lang.Object
  extended by SynchronousScheduler
All Implemented Interfaces:
ICommunicationScheduler

public class SynchronousScheduler
extends java.lang.Object
implements ICommunicationScheduler

Scheduler for synchronous communication round scheduling. This determines the order in which various robots will iterate through the broadcast, recieve, update cycle.

Since:
1.0

Constructor Summary
SynchronousScheduler()
          Constructor -- can we eliminate the no-argument constructor?
SynchronousScheduler(double lfTStep, int nRobots)
          Constructor
 
Method Summary
 double getNextRoundAndFiringSchedule(double lfCurrTime, int nTotalAgents, java.util.Set<java.lang.Integer> setActiveAgents)
          Gets the time of the next communication round, populates setActiveAgents with the indices of those agents which are active on this round.
 double getNextRoundTime(double lfCurrTime)
          Gets the time of the next communication round.
protected  void populate(double lfTStep, int nRobots)
          internal function to populate scheduler params Used mostly be constructors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronousScheduler

public SynchronousScheduler(double lfTStep,
                            int nRobots)
Constructor

Parameters:
lfTStep - time between rounds (uniform)
nRobots - number of robots

SynchronousScheduler

public SynchronousScheduler()
Constructor -- can we eliminate the no-argument constructor?

Method Detail

populate

protected void populate(double lfTStep,
                        int nRobots)
internal function to populate scheduler params Used mostly be constructors


getNextRoundTime

public double getNextRoundTime(double lfCurrTime)
Gets the time of the next communication round. Useful for the differential equation solver, as these communication times are usually discontinuities

Specified by:
getNextRoundTime in interface ICommunicationScheduler
Parameters:
lfCurrTime - absolute current time
Returns:
absolute time of next communication round (not "time till next round").

getNextRoundAndFiringSchedule

public double getNextRoundAndFiringSchedule(double lfCurrTime,
                                            int nTotalAgents,
                                            java.util.Set<java.lang.Integer> setActiveAgents)
Gets the time of the next communication round, populates setActiveAgents with the indices of those agents which are active on this round.

Specified by:
getNextRoundAndFiringSchedule in interface ICommunicationScheduler
Parameters:
lfCurrTime - current time
nTotalAgents - agents are index 0 through nTotalAgents-1
setActiveAgents - initially empty, then populated with indices (of type Integer) of agents to fire next round.
Returns:
absolute time of next communication round