com.agentfactory.cldc.scheduler
Class ExTime

java.lang.Object
  extended by com.agentfactory.cldc.scheduler.ExTime

public class ExTime
extends java.lang.Object

The ExTime represents a period at which a task can be executed. All tasks that execute at the same period use the same ExTime object. The ExTime object phase shifts agents so as to reduce computation bottlenecks.

Author:
Conor Muldoon

Constructor Summary
ExTime(int period, int randVal)
          Constructs an instance of ExTime.
 
Method Summary
 void newAgt()
          Increase the number of agents operating at a particular period.
 void removeAgt(java.util.Hashtable table)
          Removes the period from the hashtable if there are no more agents scheduled to execute at that period.
 void reSched()
          Creates a new execution time value from a combination of the current time and the random start time.
 void writeTime(java.io.DataOutputStream dos)
          Writes the period at which the agents execute to the data output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExTime

public ExTime(int period,
              int randVal)
Constructs an instance of ExTime.

Parameters:
period - the period at which the tasks should be executed.
randVal - a random start time value.
Method Detail

reSched

public void reSched()
Creates a new execution time value from a combination of the current time and the random start time.


removeAgt

public void removeAgt(java.util.Hashtable table)
Removes the period from the hashtable if there are no more agents scheduled to execute at that period.

Parameters:
table - the hashtable the period is to be removed from.

newAgt

public void newAgt()
Increase the number of agents operating at a particular period. This will have an affect on the phase shifting of agents.


writeTime

public void writeTime(java.io.DataOutputStream dos)
               throws java.io.IOException
Writes the period at which the agents execute to the data output stream.

Parameters:
dos - the stream to which the period is written.
Throws:
java.io.IOException - if there is an I/O error.