public class PriorityAgenda extends AbstractAgenda
Modifier and Type | Field and Description |
---|---|
protected java.util.TreeSet |
activations
The activations.
|
protected long |
count
The current count.
|
protected java.util.Map |
counts
The map containing the activation order count (for FIFO in case two activations are equal).
|
protected Activation |
next
The next activation (selected by strategy or manually form outside for debugging).
|
history, last, listeners, state
Constructor and Description |
---|
PriorityAgenda()
Create a new agenda.
|
Modifier and Type | Method and Description |
---|---|
void |
addActivation(Activation act)
Add a new activation.
|
java.util.Collection |
getActivations()
Get the current activations.
|
Activation |
getNextActivation()
Get the next activation.
|
boolean |
isEmpty()
Test if the agenda is empty.
|
void |
removeActivation(Activation act)
Remove an activation
|
void |
setNextActivation(Activation next)
Set the next activation.
|
addAgendaListener, fireRule, getHistory, getLastActivation, getState, isHistoryEnabled, notifyListeners, removeAgendaListener, setHistoryEnabled, toString
protected java.util.TreeSet activations
protected Activation next
protected java.util.Map counts
protected long count
public void addActivation(Activation act)
addActivation
in class AbstractAgenda
act
- The activation.public void removeActivation(Activation act)
removeActivation
in class AbstractAgenda
act
- The activation.public java.util.Collection getActivations()
getActivations
in interface IAgenda
getActivations
in class AbstractAgenda
public boolean isEmpty()
isEmpty
in interface IAgenda
isEmpty
in class AbstractAgenda
public Activation getNextActivation()
getNextActivation
in interface IAgenda
getNextActivation
in class AbstractAgenda
public void setNextActivation(Activation next)
setNextActivation
in interface IAgenda
setNextActivation
in class AbstractAgenda