Class ComparingConflictResolver.ComparingConflictSet
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.specific.resolver.ComparingConflictResolver.ComparingConflictSet
-
- All Implemented Interfaces:
ChangeableConflictSet
,ConflictSet
- Enclosing class:
- ComparingConflictResolver
public class ComparingConflictResolver.ComparingConflictSet extends java.lang.Object implements ChangeableConflictSet
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComparingConflictSet(java.util.Comparator<Activation<?>> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addActivation(Activation<?> activation)
This method is called by the Agenda when an activation changes state and becomes or is still enabled.java.util.Set<Activation<?>>
getConflictingActivations()
Returns a snapshot of all activations that are in conflict (all enabled activations).ComparingConflictResolver
getConflictResolver()
Activation<?>
getNextActivation()
java.util.Set<Activation<?>>
getNextActivations()
Returns a snapshot of activations that are considered as equal by the resolver.boolean
removeActivation(Activation<?> activation)
This method is called by the Agenda when an activation changes state and becomes or is still disabled.
-
-
-
Constructor Detail
-
ComparingConflictSet
protected ComparingConflictSet(java.util.Comparator<Activation<?>> comparator)
-
-
Method Detail
-
getNextActivation
public Activation<?> getNextActivation()
- Specified by:
getNextActivation
in interfaceConflictSet
- Returns:
- the next activation chosen by the resolver
-
addActivation
public boolean addActivation(Activation<?> activation)
Description copied from interface:ChangeableConflictSet
This method is called by the Agenda when an activation changes state and becomes or is still enabled. NOTE: The ChangeableConflictSet is responsible for handling thatadd
may be called multiple times on an Activation already in the conflict set!- Specified by:
addActivation
in interfaceChangeableConflictSet
- Parameters:
activation
- the activation that should be added to the conflict set- Returns:
- true, if the conflict set changed
-
removeActivation
public boolean removeActivation(Activation<?> activation)
Description copied from interface:ChangeableConflictSet
This method is called by the Agenda when an activation changes state and becomes or is still disabled. NOTE: The ChangeableConflictSet is responsible for handling thatremove
may be called on Activations that are not in the conflict set!- Specified by:
removeActivation
in interfaceChangeableConflictSet
- Parameters:
activation
- the activation that should be removed from the conflict set- Returns:
- true, if the conflict set changed
-
getConflictResolver
public ComparingConflictResolver getConflictResolver()
- Specified by:
getConflictResolver
in interfaceConflictSet
-
getNextActivations
public java.util.Set<Activation<?>> getNextActivations()
Description copied from interface:ConflictSet
Returns a snapshot of activations that are considered as equal by the resolver. Each time the method is called, a new copy of the activation set is returned.- Specified by:
getNextActivations
in interfaceConflictSet
-
getConflictingActivations
public java.util.Set<Activation<?>> getConflictingActivations()
Description copied from interface:ConflictSet
Returns a snapshot of all activations that are in conflict (all enabled activations). Each time the method is called, a new copy of the conflicting actions are returned.- Specified by:
getConflictingActivations
in interfaceConflictSet
-
-