org.eclipse.viatra.dse.objectives

## Interface IGlobalConstraint

- All Known Implementing Classes:
    ModelQueriesGlobalConstraint

      public interface IGlobalConstraint

  Implementation of this interface represents a global constraint of the DSE problem, which can halt an exploration continuing from a state which dissatisfies the global constraint.

  Certain global constraints can have inner state for the validation. In this case a new instance is necessary for every new thread, and the `createNew` method should not return the same instance more than once.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkGlobalConstraint(ThreadContext context)` Checks whether the current state satisfies the global constraint.
    `IGlobalConstraint` | `createNew()` Returns an instance of the `IGlobalConstraint`.
    `java.lang.String` | `getName()` Returns the name of the global constraint.
    `void` | `init(ThreadContext context)` Initializes the global constraint.

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Returns the name of the global constraint.
      Returns:
        The name of the global constraint.

    - #### checkGlobalConstraint

          boolean checkGlobalConstraint(ThreadContext context)

      Checks whether the current state satisfies the global constraint.
      Parameters:
        `context` - The `ThreadContext` which contains the necessary information.
      Returns:
        True if the state is valid and exploration can be continued from the actual state.

    - #### init

          void init(ThreadContext context)

      Initializes the global constraint. It is called exactly once for every thread starts.
      Parameters:
        `context` - The `ThreadContext`.

    - #### createNew

          IGlobalConstraint createNew()

      Returns an instance of the `IGlobalConstraint`. If it returns the same instance, all the methods has to be thread save as they are called concurrently.
      Returns:
        An instance of the global constraint.