org.eclipse.viatra.dse.api.strategy.impl

## Class FixedPriorityStrategy

- java.lang.Object
- - org.eclipse.viatra.dse.api.strategy.impl.FixedPriorityStrategy

- All Implemented Interfaces:
    IStrategy

      public class FixedPriorityStrategy
      extends java.lang.Object
      implements IStrategy

  Works as `DepthFirstStrategy` but:
  - works only with single thread,
  - in a given state, it only traverses the activations with locally the highest priority.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixedPriorityStrategy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `explore()` This method explores the design space as the implementation specifies.
    `java.util.Map<BatchTransformationRule<?,?>,java.lang.Integer>` | `getPriorities()`
    `void` | `initStrategy(ThreadContext context)` Initializes the strategy with a specific `ThreadContext`.
    `void` | `interruptStrategy()` The implementation of this interface should be ready to be interrupted.
    `FixedPriorityStrategy` | `withDepthLimit(int maxDepth)` Adds a depth limit to the strategy.
    `FixedPriorityStrategy` | `withRulePriority(BatchTransformationRule<?,?> rule, int priority)` Assigns a priority to a rule.

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

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

- - ### Constructor Detail

    - #### FixedPriorityStrategy

          public FixedPriorityStrategy()

  - ### Method Detail

    - #### withDepthLimit

          public FixedPriorityStrategy withDepthLimit(int maxDepth)

      Adds a depth limit to the strategy.
      Parameters:
        `depthLimit` - The depth limit.
      Returns:
        The actual instance to enable a builder pattern like usage.

    - #### withRulePriority

          public FixedPriorityStrategy withRulePriority(BatchTransformationRule<?,?> rule,
                                                        int priority)

      Assigns a priority to a rule. Unassigned rule will have a priority of 0.
      Parameters:
        `rule` - The transformation rule.
        `priority` - The priority of the rule. Higher is better.
      Returns:
        The actual instance to enable a builder pattern like usage.

    - #### getPriorities

          public java.util.Map<BatchTransformationRule<?,?>,java.lang.Integer> getPriorities()

    - #### initStrategy

          public void initStrategy(ThreadContext context)

      Description copied from interface: `IStrategy`
      Initializes the strategy with a specific `ThreadContext`.
      Specified by:
        `initStrategy` in interface `IStrategy`
      Parameters:
        `context` - The context.

    - #### explore

          public void explore()

      Description copied from interface: `IStrategy`
      This method explores the design space as the implementation specifies. It will be called only once, hence the exploration loop is run by the implementation. The termination condition is also specified by the implementation and when it returns the exploration thread will be disposed.
      Specified by:
        `explore` in interface `IStrategy`

    - #### interruptStrategy

          public void interruptStrategy()

      Description copied from interface: `IStrategy`
      The implementation of this interface should be ready to be interrupted. If this method is called, the `IStrategy.explore()` method should return ASAP. This method is also called by the `SolutionStore` class if enough solutions are found.
      Specified by:
        `interruptStrategy` in interface `IStrategy`