class adevs_sched

A scheduler for atomic models.

Public Methods

[more] adevs_sched(int capacity = SCHED_DEFAULT_CAP)
Creates a scheduler with the default or specified initial capacity
[more]void schedule(atomic* model, ADEVS_TIME_TYPE tN)
Add a model to the schedule or change to position of a model already in the schedule.
[more]atomic* getMinimum() const
Get the model at the front of the queue.
[more]void removeMinimum()
Remove the model at the front of the queue
[more]ADEVS_TIME_TYPE minPriority() const
Returns the smallest time of next event, or ADEVS_INFINITY if the queue is empty
[more]int getSize() const
Returns the number of items in the queue
[more]bool isEmpty() const
Returns true if the queue is empty, and false otherwise
[more]void clear()
Removes all items from the queue
[more] ~adevs_sched()
Destructor


Documentation

A scheduler for atomic models. The scheduler is implemented as a binary heap. The scheduler requires that the time types be able to support all of the comparison operations, assignment operators, and copy constructors.
o adevs_sched(int capacity = SCHED_DEFAULT_CAP)
Creates a scheduler with the default or specified initial capacity

ovoid schedule(atomic* model, ADEVS_TIME_TYPE tN)
Add a model to the schedule or change to position of a model already in the schedule. If the tN is ADEVS_INFINITY, the the item or removed (if it is already in the queue) or not inserted. Because this method uses the model's q_index field, it is imperative that a model be entered into one, and only one, schedule at any time.

oatomic* getMinimum() const
Get the model at the front of the queue. Returns NULL if the queue is empty.

ovoid removeMinimum()
Remove the model at the front of the queue

oADEVS_TIME_TYPE minPriority() const
Returns the smallest time of next event, or ADEVS_INFINITY if the queue is empty

oint getSize() const
Returns the number of items in the queue

obool isEmpty() const
Returns true if the queue is empty, and false otherwise

ovoid clear()
Removes all items from the queue

o ~adevs_sched()
Destructor


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.