public class FixedPriorityConflictSet extends java.lang.Object implements ChangeableConflictSet
FixedPriorityConflictResolver
for more details.Constructor and Description |
---|
FixedPriorityConflictSet(FixedPriorityConflictResolver resolver,
java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities) |
FixedPriorityConflictSet(FixedPriorityConflictResolver resolver,
java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities,
int defaultPriority) |
Modifier and Type | Method and Description |
---|---|
boolean |
addActivation(Activation<?> activation)
This method is called by the Agenda when an activation changes state and becomes or is still enabled.
|
protected boolean |
addActivation(Activation<?> activation,
java.lang.Integer priority) |
java.util.Set<Activation<?>> |
getConflictingActivations()
Returns all conflicting activations.
|
FixedPriorityConflictResolver |
getConflictResolver() |
Activation<?> |
getNextActivation()
Returns one of the activations of one of the rules with the lowest priority.
|
java.util.Set<Activation<?>> |
getNextActivations()
Returns the set of activations of rules with the lowest priority.
|
protected java.lang.Integer |
getRulePriority(Activation<?> activation) |
protected java.lang.Integer |
getRulePriority(RuleSpecification<?> specification) |
boolean |
removeActivation(Activation<?> activation)
This method is called by the Agenda when an activation changes state and becomes or is still disabled.
|
protected boolean |
removeActivation(Activation<?> activation,
java.lang.Integer priority) |
protected void |
setPriority(RuleSpecification<?> specification,
int priority) |
public FixedPriorityConflictSet(FixedPriorityConflictResolver resolver, java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities)
public FixedPriorityConflictSet(FixedPriorityConflictResolver resolver, java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities, int defaultPriority)
public Activation<?> getNextActivation()
getNextActivation
in interface ConflictSet
public boolean addActivation(Activation<?> activation)
ChangeableConflictSet
add
may be called
multiple times on an Activation already in the conflict set!addActivation
in interface ChangeableConflictSet
activation
- the activation that should be added to the conflict setpublic boolean removeActivation(Activation<?> activation)
ChangeableConflictSet
remove
may be called
on Activations that are not in the conflict set!removeActivation
in interface ChangeableConflictSet
activation
- the activation that should be removed from the conflict setprotected boolean addActivation(Activation<?> activation, java.lang.Integer priority)
protected boolean removeActivation(Activation<?> activation, java.lang.Integer priority)
protected void setPriority(RuleSpecification<?> specification, int priority)
public FixedPriorityConflictResolver getConflictResolver()
getConflictResolver
in interface ConflictSet
public java.util.Set<Activation<?>> getNextActivations()
getNextActivations
in interface ConflictSet
public java.util.Set<Activation<?>> getConflictingActivations()
getConflictingActivations
in interface ConflictSet
protected java.lang.Integer getRulePriority(Activation<?> activation)
protected java.lang.Integer getRulePriority(RuleSpecification<?> specification)