public class SolutionTrajectory
extends java.lang.Object
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 and Description |
---|
SolutionTrajectory(java.util.List<java.lang.Object> activationCodes,
java.util.List<DSETransformationRule<?,?>> transformationRules,
IStateCoderFactory stateCoderFactory) |
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() |
org.eclipse.viatra.query.runtime.api.ViatraQueryEngine |
getEngine() |
java.util.Map<java.lang.String,java.lang.Double> |
getFitness() |
org.eclipse.emf.common.notify.Notifier |
getModel() |
IStateCoder |
getStateCoder() |
IStateCoderFactory |
getStateCoderFactory() |
int |
getTrajectoryLength() |
java.util.List<DSETransformationRule<?,?>> |
getTransformationRules() |
int |
hashCode() |
void |
setFitness(java.util.Map<java.lang.String,java.lang.Double> fitness) |
void |
setModel(org.eclipse.emf.common.notify.Notifier modelRoot)
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.
|
java.lang.String |
toPrettyString() |
boolean |
undoLastTransformation()
Call this method to undo the last transformation.
|
void |
undoTransformation()
Call this method to undo the transformation.
|
public SolutionTrajectory(java.util.List<java.lang.Object> activationCodes, java.util.List<DSETransformationRule<?,?>> transformationRules, IStateCoderFactory stateCoderFactory)
public void setModel(org.eclipse.emf.common.notify.Notifier modelRoot) throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
modelRoot
- The root of the model.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- If the VIATRA Query fails to initialize.public void setModelWithEditingDomain(org.eclipse.emf.common.notify.Notifier modelRoot) throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
The transformation will be reversible by creating an EditingDomain
on the model.
modelRoot
- The root of the model.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- If the VIATRA Query fails to initialize.public void doTransformation(org.eclipse.emf.common.notify.Notifier modelRoot) throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
modelRoot
- The root of the model.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- If the VIATRA Query fails to initialize.public void doTransformationUndoable(org.eclipse.emf.common.notify.Notifier modelRoot) throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
The transformation will be reversible by creating an EditingDomain
on the model.
modelRoot
- The root of the model.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- If the VIATRA Query fails to initialize.public void doTransformation() throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
SolutionTrajectory#setModel(EObject)
method.java.lang.Exception
- If the activation to fire is not found. Possible problems: wrong model, bad state serializer.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- If the VIATRA Query fails to initialize.public boolean doNextTransformation() throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
SolutionTrajectory#setModel(EObject)
method.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
public boolean undoLastTransformation()
public void undoTransformation()
public java.util.List<java.lang.Object> getActivationCodes()
public java.util.List<DSETransformationRule<?,?>> getTransformationRules()
public IStateCoderFactory getStateCoderFactory()
public org.eclipse.viatra.query.runtime.api.ViatraQueryEngine getEngine()
public org.eclipse.emf.common.notify.Notifier getModel()
public IStateCoder getStateCoder()
public int getCurrentIndex()
public int getTrajectoryLength()
public java.util.Map<java.lang.String,java.lang.Double> getFitness()
public void setFitness(java.util.Map<java.lang.String,java.lang.Double> fitness)
public java.lang.String toPrettyString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object