lejos.realtime
Class AperiodicParameters

java.lang.Object
  extended by lejos.realtime.SchedulingParameters
      extended by lejos.realtime.ReleaseParameters
          extended by lejos.realtime.AperiodicParameters
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SporadicParameters

public class AperiodicParameters
extends ReleaseParameters

Author:
Team iRboT

Field Summary
static String arrivalTimeQueueOverflowExcept
           
static String arrivalTimeQueueOverflowIgnore
           
static String arrivalTimeQueueOverflowReplace
           
static String arrivalTimeQueueOverflowSave
           
 
Constructor Summary
AperiodicParameters()
          Create an AperiodicParameters object.
AperiodicParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Create an AperiodicParameters object.
 
Method Summary
 String getArrivalTimeQueueOverflowBehavior()
          Gets the behavior of the arrival time queue in the event of an overflow.
 int getInitialArrivalTimeQueueLength()
          Gets the initial number of elements the arrival time queue can hold.
 void setArrivalTimeQueueOverflowBehavior(String behavior)
          Sets the behavior of the arrival time queue in the case where the insertion of a new element would make the queue size greater than the initial size given in this.
 void setDeadline(RelativeTime deadline)
          Sets the deadline value.
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
          This method first performs a feasibility analysis using the new cost, and deadline as replacements for the matching attributes of this.
 void setInitialArrivalTimeQueueLength(int initial)
          Sets the initial number of elements the arrival time queue can hold without lengthening the queue.
 
Methods inherited from class lejos.realtime.ReleaseParameters
clone, getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadlineMissHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrivalTimeQueueOverflowExcept

public static final String arrivalTimeQueueOverflowExcept
See Also:
Constant Field Values

arrivalTimeQueueOverflowIgnore

public static final String arrivalTimeQueueOverflowIgnore
See Also:
Constant Field Values

arrivalTimeQueueOverflowReplace

public static final String arrivalTimeQueueOverflowReplace
See Also:
Constant Field Values

arrivalTimeQueueOverflowSave

public static final String arrivalTimeQueueOverflowSave
See Also:
Constant Field Values
Constructor Detail

AperiodicParameters

public AperiodicParameters()
Create an AperiodicParameters object. This constructor is equivalent to: AperiodicParameters(null, null, null, null) Since: 1.0.1


AperiodicParameters

public AperiodicParameters(RelativeTime cost,
                           RelativeTime deadline,
                           AsyncEventHandler overrunHandler,
                           AsyncEventHandler missHandler)
Create an AperiodicParameters object.

Parameters:
cost - Processing time per invocation. On implementations which can measure the amount of time a schedulable object is executed, this value is the maximum amount of time a schedulable object receives. On implementations which cannot measure execution time, this value is used as a hint to the feasibility algorithm. On such systems it is not possible to determine when any particular object exceeds cost. If null, the default value is a new instance of RelativeTime(0,0).
deadline - The latest permissible completion time measured from the release time of the associated invocation of the schedulable object. If null, the default value is a new instance of RelativeTime(Long.MAX_VALUE, 999999).
overrunHandler - This handler is invoked if an invocation of the schedulable object exceeds cost. Not required for minimum implementation. If null, the default value is no overrun handler.
missHandler - This handler is invoked if the run() method of the schedulable object is still executing after the deadline has passed. Although minimum implementations do not consider deadlines in feasibility calculations, they must recognize variable deadlines and invoke the miss handler as appropriate. If null, the default value is no miss handler.
Throws:
IllegalArgumentException - Thrown if the time value of cost is less than zero, or the time value of deadline is less than or equal to zero.
IllegalAssignmentError - Thrown if cost, deadline, overrunHandler or missHandler cannot be stored in this.
Method Detail

getArrivalTimeQueueOverflowBehavior

public String getArrivalTimeQueueOverflowBehavior()
Gets the behavior of the arrival time queue in the event of an overflow.


getInitialArrivalTimeQueueLength

public int getInitialArrivalTimeQueueLength()
Gets the initial number of elements the arrival time queue can hold. This returns the initial queue length currently associated with this parameter object. If the overflow policy is SAVE the initial queue length may not be related to the current queue lengths of schedulable objects associated with this parameter object.


setDeadline

public void setDeadline(RelativeTime deadline)
Sets the deadline value. If this parameter object is associated with any schedulable object (by being passed through the schedulable object's constructor or set with a method such as RealtimeThread.setReleaseParameters(ReleaseParameters)) the deadline of those schedulable objects is altered as specified by each schedulable object's respective scheduler. Overrides: setDeadline in class ReleaseParameters

Overrides:
setDeadline in class ReleaseParameters
Parameters:
deadline - The latest permissible completion time measured from the release time of the associated invocation of the schedulable object. If deadline is null, the deadline is set to a new instance of RelativeTime(Long.MAX_VALUE, 999999).
Throws:
IllegalArgumentException - Thrown if the time value of deadline is less than or equal to zero, or if the new value of this deadline is incompatible with the scheduler for any associated schedulable object.
IllegalAssignmentError - Thrown if deadline cannot be stored in this.

setArrivalTimeQueueOverflowBehavior

public void setArrivalTimeQueueOverflowBehavior(String behavior)
Sets the behavior of the arrival time queue in the case where the insertion of a new element would make the queue size greater than the initial size given in this. Values of behavior are compared using reference equality (==) not value equality (equals()).

Parameters:
behavior - A string representing the behavior.
Throws:
IllegalArgumentException - Thrown if behavior is not one of the final queue overflow behavior values defined in this class. Since: 1.0.1 Moved here from SporadicParameters.

setIfFeasible

public boolean setIfFeasible(RelativeTime cost,
                             RelativeTime deadline)
This method first performs a feasibility analysis using the new cost, and deadline as replacements for the matching attributes of this. If the resulting system is feasible, the method replaces the current scheduling characteristics, of this with the new scheduling characteristics. Overrides: setIfFeasible in class ReleaseParameters

Overrides:
setIfFeasible in class ReleaseParameters
Parameters:
cost - The proposed cost. to determine when any particular object exceeds cost. If null, the default value is a new instance of RelativeTime(0,0).
deadline - The proposed deadline. If null, the default value is a new instance of RelativeTime(Long.MAX_VALUE, 999999).
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.
Throws:
IllegalArgumentException - Thrown if the time value of cost is less than zero, or the time value of deadline is less than or equal to zero, or the values are incompatible with the scheduler for any of the schedulable objects which are presently using this parameter object.
IllegalAssignmentError - Thrown if cost or deadline cannot be stored in this.

setInitialArrivalTimeQueueLength

public void setInitialArrivalTimeQueueLength(int initial)
Sets the initial number of elements the arrival time queue can hold without lengthening the queue. The initial length of an arrival queue is set when the SO using the queue is constructed, after that time changes in the initial queue length are ignored.

Parameters:
initial - The initial length of the queue.
Throws:
IllegalArgumentException - Thrown if initial is less than zero. Since: 1.0.1 Moved here from SporadicParameters.