Package jadex.rules.rulesystem
Class PriorityAgenda
- java.lang.Object
- 
- jadex.rules.rulesystem.AbstractAgenda
- 
- jadex.rules.rulesystem.PriorityAgenda
 
 
- 
- All Implemented Interfaces:
- IAgenda
 
 public class PriorityAgenda extends AbstractAgenda An agenda that sorts activations according to their priority.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.TreeSetactivationsThe activations.protected longcountThe current count.protected java.util.MapcountsThe map containing the activation order count (for FIFO in case two activations are equal).protected ActivationnextThe next activation (selected by strategy or manually form outside for debugging).- 
Fields inherited from class jadex.rules.rulesystem.AbstractAgendahistory, last, listeners, state
 
- 
 - 
Constructor SummaryConstructors Constructor Description PriorityAgenda()Create a new agenda.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActivation(Activation act)Add a new activation.java.util.CollectiongetActivations()Get the current activations.ActivationgetNextActivation()Get the next activation.booleanisEmpty()Test if the agenda is empty.voidremoveActivation(Activation act)Remove an activationvoidsetNextActivation(Activation next)Set the next activation.- 
Methods inherited from class jadex.rules.rulesystem.AbstractAgendaaddAgendaListener, fireRule, getHistory, getLastActivation, getState, isHistoryEnabled, notifyListeners, removeAgendaListener, setHistoryEnabled, toString
 
- 
 
- 
- 
- 
Field Detail- 
activationsprotected java.util.TreeSet activations The activations.
 - 
nextprotected Activation next The next activation (selected by strategy or manually form outside for debugging).
 - 
countsprotected java.util.Map counts The map containing the activation order count (for FIFO in case two activations are equal).
 - 
countprotected long count The current count.
 
- 
 - 
Method Detail- 
addActivationpublic void addActivation(Activation act) Add a new activation.- Specified by:
- addActivationin class- AbstractAgenda
- Parameters:
- act- The activation.
 
 - 
removeActivationpublic void removeActivation(Activation act) Remove an activation- Specified by:
- removeActivationin class- AbstractAgenda
- Parameters:
- act- The activation.
 
 - 
getActivationspublic java.util.Collection getActivations() Get the current activations.- Specified by:
- getActivationsin interface- IAgenda
- Specified by:
- getActivationsin class- AbstractAgenda
- Returns:
- The activations.
 
 - 
isEmptypublic boolean isEmpty() Test if the agenda is empty.- Specified by:
- isEmptyin interface- IAgenda
- Specified by:
- isEmptyin class- AbstractAgenda
- Returns:
- True if is empty.
 
 - 
getNextActivationpublic Activation getNextActivation() Get the next activation.- Specified by:
- getNextActivationin interface- IAgenda
- Specified by:
- getNextActivationin class- AbstractAgenda
- Returns:
- The next activation.
 
 - 
setNextActivationpublic void setNextActivation(Activation next) Set the next activation.- Specified by:
- setNextActivationin interface- IAgenda
- Specified by:
- setNextActivationin class- AbstractAgenda
 
 
- 
 
-