org.eclipse.viatra.dse.api

## Class SolutionTrajectory

- java.lang.Object
- - org.eclipse.viatra.dse.api.SolutionTrajectory

-     public class SolutionTrajectory
      extends java.lang.Object

  A SolutionTrajectory represents a trajectory (i.e. sequence of transformation rule applications), which can transform the initial model to a desired state. An instance of this class holds the the actual rule sequence and the corresponding activation codes. Furthermore it can be used to perform the transformation on a given model (if possible).

  It is also possible to undo the transformation if initialized with an editing domain.

  The instance of this class can be reused for different models.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolutionTrajectory(java.util.List<java.lang.Object> activationCodes, java.util.List<BatchTransformationRule<?,?>> transformationRules, IStateCoderFactory stateCoderFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `doNextTransformation()` Transforms the given model by one step to the solution (makes one step in the trajectory).
    `void` | `doTransformation()` Transforms the given model along the trajectory.
    `void` | `doTransformation(org.eclipse.emf.common.notify.Notifier modelRoot)` Transforms the given model along the trajectory.
    `void` | `doTransformationUndoable(org.eclipse.emf.common.notify.Notifier modelRoot)` Transforms the given model along the trajectory.
    `boolean` | `equals(java.lang.Object obj)`
    `java.util.List<java.lang.Object>` | `getActivationCodes()`
    `int` | `getCurrentIndex()`
    `ViatraQueryEngine` | `getEngine()`
    `Fitness` | `getFitness()`
    `org.eclipse.emf.common.notify.Notifier` | `getModel()`
    `Solution` | `getSolution()`
    `IStateCoder` | `getStateCoder()`
    `IStateCoderFactory` | `getStateCoderFactory()`
    `int` | `getTrajectoryLength()`
    `java.util.List<BatchTransformationRule<?,?>>` | `getTransformationRules()`
    `int` | `hashCode()`
    `void` | `setFitness(Fitness fitness)`
    `void` | `setModel(org.eclipse.emf.common.notify.Notifier model)` Initialize this SolutionTrajectory for transforming the model along the trajectory.
    `void` | `setModelWithEditingDomain(org.eclipse.emf.common.notify.Notifier modelRoot)` Initialize this SolutionTrajectory for transforming the given model along the trajectory.
    `void` | `setSolution(Solution solution)`
    `java.lang.String` | `toPrettyString()`
    `boolean` | `undoLastTransformation()` Call this method to undo the last transformation.
    `void` | `undoTransformation()` Call this method to undo the transformation.

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

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

- - ### Constructor Detail

    - #### SolutionTrajectory

          public SolutionTrajectory(java.util.List<java.lang.Object> activationCodes,
                                    java.util.List<BatchTransformationRule<?,?>> transformationRules,
                                    IStateCoderFactory stateCoderFactory)

  - ### Method Detail

    - #### setModel

          public void setModel(org.eclipse.emf.common.notify.Notifier model)
                        throws ViatraQueryException

      Initialize this SolutionTrajectory for transforming the model along the trajectory.
      Parameters:
        `model` - The model.
      Throws:
        `ViatraQueryException` - If the VIATRA Query fails to initialize.

    - #### setModelWithEditingDomain

          public void setModelWithEditingDomain(org.eclipse.emf.common.notify.Notifier modelRoot)
                                         throws ViatraQueryException

      Initialize this SolutionTrajectory for transforming the given model along the trajectory.

      The transformation will be reversible by creating an `EditingDomain` on the model.

      Parameters:
        `modelRoot` - The root of the model.
      Throws:
        `ViatraQueryException` - If the VIATRA Query fails to initialize.

    - #### doTransformation

          public void doTransformation(org.eclipse.emf.common.notify.Notifier modelRoot)
                                throws ViatraQueryException

      Transforms the given model along the trajectory.
      Parameters:
        `modelRoot` - The root of the model.
      Throws:
        `ViatraQueryException` - If the VIATRA Query fails to initialize.

    - #### doTransformationUndoable

          public void doTransformationUndoable(org.eclipse.emf.common.notify.Notifier modelRoot)
                                        throws ViatraQueryException

      Transforms the given model along the trajectory.

      The transformation will be reversible by creating an `EditingDomain` on the model.

      Parameters:
        `modelRoot` - The root of the model.
      Throws:
        `ViatraQueryException` - If the VIATRA Query fails to initialize.

    - #### doTransformation

          public void doTransformation()
                                throws ViatraQueryException

      Transforms the given model along the trajectory. To initialize the model call the `setModel(Notifier)` method.
      Throws:
        `java.lang.Exception` - If the activation to fire is not found. Possible problems: wrong model, bad state serializer.
        `ViatraQueryException` - If the VIATRA Query fails to initialize.

    - #### doNextTransformation

          public boolean doNextTransformation()
                                       throws ViatraQueryException

      Transforms the given model by one step to the solution (makes one step in the trajectory). To initialize the model call the `setModel(Notifier)` method.
      Throws:
        `ViatraQueryException`

    - #### undoLastTransformation

          public boolean undoLastTransformation()

      Call this method to undo the last transformation.
      Returns:
        True, if it was successful.

    - #### undoTransformation

          public void undoTransformation()

      Call this method to undo the transformation.

    - #### getActivationCodes

          public java.util.List<java.lang.Object> getActivationCodes()

    - #### getTransformationRules

          public java.util.List<BatchTransformationRule<?,?>> getTransformationRules()

    - #### getStateCoderFactory

          public IStateCoderFactory getStateCoderFactory()

    - #### getEngine

          public ViatraQueryEngine getEngine()

    - #### getModel

          public org.eclipse.emf.common.notify.Notifier getModel()

    - #### getStateCoder

          public IStateCoder getStateCoder()

    - #### getCurrentIndex

          public int getCurrentIndex()

    - #### getTrajectoryLength

          public int getTrajectoryLength()

    - #### getFitness

          public Fitness getFitness()

    - #### setFitness

          public void setFitness(Fitness fitness)

    - #### toPrettyString

          public java.lang.String toPrettyString()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getSolution

          public Solution getSolution()

    - #### setSolution

          public void setSolution(Solution solution)