org.eclipse.viatra.transformation.evm.specific.resolver

## Class FixedPriorityConflictResolver

- java.lang.Object
- - org.eclipse.viatra.transformation.evm.specific.resolver.ReconfigurableConflictResolver<FixedPriorityConflictSet>
  - - org.eclipse.viatra.transformation.evm.specific.resolver.FixedPriorityConflictResolver

- All Implemented Interfaces:
    ConflictResolver
  Direct Known Subclasses:
    InvertedDisappearancePriorityConflictResolver, RuleOrderBasedFixedPriorityResolver

      public class FixedPriorityConflictResolver
      extends ReconfigurableConflictResolver<FixedPriorityConflictSet>

  This conflict resolver uses Integer value priorities assigned to rules. You can set priorities with the `setPriority(RuleSpecification, int)` method. The activations of rules with the lowest priority value will be the next activations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `defaultPriority`
    `protected java.util.Map<RuleSpecification<?>,java.lang.Integer>` | `priorities`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixedPriorityConflictResolver()` Initializes the conflict resolver with a default priority of 0.
    `FixedPriorityConflictResolver(int defaultPriority)` Initializes the conflict resolver with a given default priority value

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected FixedPriorityConflictSet` | `createReconfigurableConflictSet()`
    `void` | `setPriority(RuleSpecification<?> specification, int priority)` Sets the priority for the given specification.

    - ### Methods inherited from class org.eclipse.viatra.transformation.evm.specific.resolver.ReconfigurableConflictResolver

      `createConflictSet, getConflictSets`

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

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

- - ### Field Detail

    - #### priorities

          protected java.util.Map<RuleSpecification<?>,java.lang.Integer> priorities

    - #### defaultPriority

          protected final int defaultPriority

      Since:
        2.1

  - ### Constructor Detail

    - #### FixedPriorityConflictResolver

          public FixedPriorityConflictResolver()

      Initializes the conflict resolver with a default priority of 0.

    - #### FixedPriorityConflictResolver

          public FixedPriorityConflictResolver(int defaultPriority)

      Initializes the conflict resolver with a given default priority value
      Since:
        2.1

  - ### Method Detail

    - #### setPriority

          public void setPriority(RuleSpecification<?> specification,
                                  int priority)

      Sets the priority for the given specification. The activations of rules with the lowest priority value will be the next activations while rules with higher priority values will only be included in the conflicting activations set. The default priority is set when the resolver is created; if unspecified, it is 0.
      Parameters:
        `specification` -
        `priority` -

    - #### createReconfigurableConflictSet

          protected FixedPriorityConflictSet createReconfigurableConflictSet()

      Specified by:
        `createReconfigurableConflictSet` in class `ReconfigurableConflictResolver<FixedPriorityConflictSet>`