org.eclipse.incquery.runtime.evm.specific.resolver

## Class FixedPriorityConflictSet

- java.lang.Object
- - org.eclipse.incquery.runtime.evm.specific.resolver.FixedPriorityConflictSet

- All Implemented Interfaces:
    ChangeableConflictSet, ConflictSet
  Direct Known Subclasses:
    InvertedDisappearancePriorityConflictResolver.InvertedDisappearancePriorityConflictSet

      public class FixedPriorityConflictSet
      extends java.lang.Object
      implements ChangeableConflictSet

  This conflict set resolves conflicts between activations based on Integer valued priorities assigned to rules. The activations of rules with the lowest priority value will be the next activations. See `FixedPriorityConflictResolver` for more details.
  Author:
    Abel Hegedus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixedPriorityConflictSet(FixedPriorityConflictResolver resolver, java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.
    `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.
    `boolean` | `removeActivation(Activation<?> activation)` This method is called by the Agenda when an activation changes state and becomes or is still disabled.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FixedPriorityConflictSet

          public FixedPriorityConflictSet(FixedPriorityConflictResolver resolver,
                                          java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities)

  - ### Method Detail

    - #### getNextActivation

          public Activation<?> getNextActivation()

      Returns one of the activations of one of the rules with the lowest priority.
      Specified by:
        `getNextActivation` in interface `ConflictSet`
      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 that `add` may be called multiple times on an Activation already in the conflict set!
      Specified by:
        `addActivation` in interface `ChangeableConflictSet`
      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 that `remove` may be called on Activations that are not in the conflict set!
      Specified by:
        `removeActivation` in interface `ChangeableConflictSet`
      Parameters:
        `activation` - the activation that should be removed from the conflict set
      Returns:
        true, if the conflict set changed

    - #### getConflictResolver

          public FixedPriorityConflictResolver getConflictResolver()

      Specified by:
        `getConflictResolver` in interface `ConflictSet`

    - #### getNextActivations

          public java.util.Set<Activation<?>> getNextActivations()

      Returns the set of activations of rules with the lowest priority.
      Specified by:
        `getNextActivations` in interface `ConflictSet`
      Returns:
        the set of activations that are considered as equal by the resolver

    - #### getConflictingActivations

          public java.util.Set<Activation<?>> getConflictingActivations()

      Returns all conflicting activations.
      Specified by:
        `getConflictingActivations` in interface `ConflictSet`
      Returns:
        the set of all activations that are in conflict (all enabled activations)