mirror of
https://github.com/Echtzeitsysteme/gips-examples.git
synced 2024-05-20 20:00:43 +00:00
MdVNE: fixes API termination for all GIPS-based VNE algorithms
This commit is contained in:
parent
d6804256c5
commit
41fcedc597
|
@ -17,7 +17,7 @@ public class MdvneMigrationGipsIflyeAdapter {
|
|||
/**
|
||||
* MdVNE GIPS migration API object.
|
||||
*/
|
||||
final static MigrationGipsAPI api = new MigrationGipsAPI();
|
||||
static MigrationGipsAPI api;
|
||||
|
||||
/**
|
||||
* If true, the API was already initialized.
|
||||
|
@ -42,6 +42,7 @@ public class MdvneMigrationGipsIflyeAdapter {
|
|||
|
||||
// Init if not already initialized
|
||||
if (!init) {
|
||||
api = new MigrationGipsAPI();
|
||||
api.init(model);
|
||||
init = true;
|
||||
}
|
||||
|
@ -63,20 +64,15 @@ public class MdvneMigrationGipsIflyeAdapter {
|
|||
api.getL2s().applyNonZeroMappings();
|
||||
api.getNet2net().applyNonZeroMappings();
|
||||
|
||||
// Terminate API
|
||||
// api.terminate();
|
||||
// TODO: Currently, this throws an Exception:
|
||||
//
|
||||
// java.lang.IllegalArgumentException: Cannot remove a consumer which was not
|
||||
// registered before!
|
||||
// at
|
||||
// org.emoflon.ibex.gt.api.GraphTransformationPattern.unsubscribeAppearing(GraphTransformationPattern.java:310)
|
||||
// at org.emoflon.gips.core.gt.GTMapper.terminate(GTMapper.java:69)
|
||||
// at org.emoflon.gips.core.GipsEngine.lambda$1(GIPSEngine.java:71)
|
||||
// at java.base/java.util.HashMap.forEach(HashMap.java:1421)
|
||||
// at org.emoflon.gips.core.GipsEngine.terminate(GIPSEngine.java:71)
|
||||
|
||||
return output.solutionCount() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the initialized state of the GIPS API.
|
||||
*/
|
||||
public static void resetInit() {
|
||||
init = false;
|
||||
api.terminate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.emoflon.gips.gipsl.examples.mdvne.seq.api.matches.Switch2NodeRuleMatc
|
|||
*
|
||||
* @author Maximilian Kratz {@literal <maximilian.kratz@es.tu-darmstadt.de>}
|
||||
*/
|
||||
public class MdvneGipsIflyeAdapter {
|
||||
public class MdvneSeqGipsIflyeAdapter {
|
||||
|
||||
/**
|
||||
* MdVNE GIPS API object.
|
||||
|
@ -118,19 +118,6 @@ public class MdvneGipsIflyeAdapter {
|
|||
}
|
||||
});
|
||||
|
||||
// Terminate API
|
||||
// api.terminate();
|
||||
// TODO: Currently, this throws an Exception:
|
||||
//
|
||||
// java.lang.IllegalArgumentException: Cannot remove a consumer which was not
|
||||
// registered before!
|
||||
// at
|
||||
// org.emoflon.ibex.gt.api.GraphTransformationPattern.unsubscribeAppearing(GraphTransformationPattern.java:310)
|
||||
// at org.emoflon.gips.core.gt.GTMapper.terminate(GTMapper.java:69)
|
||||
// at org.emoflon.gips.core.GipsEngine.lambda$1(GIPSEngine.java:71)
|
||||
// at java.base/java.util.HashMap.forEach(HashMap.java:1421)
|
||||
// at org.emoflon.gips.core.GipsEngine.terminate(GIPSEngine.java:71)
|
||||
|
||||
return output.solutionCount() > 0;
|
||||
}
|
||||
|
||||
|
@ -139,6 +126,7 @@ public class MdvneGipsIflyeAdapter {
|
|||
*/
|
||||
public static void resetInit() {
|
||||
init = false;
|
||||
api.terminate();
|
||||
}
|
||||
|
||||
}
|
|
@ -63,19 +63,6 @@ public class MdvneGipsIflyeAdapter {
|
|||
api.getL2s().applyNonZeroMappings();
|
||||
api.getNet2net().applyNonZeroMappings();
|
||||
|
||||
// Terminate API
|
||||
// api.terminate();
|
||||
// TODO: Currently, this throws an Exception:
|
||||
//
|
||||
// java.lang.IllegalArgumentException: Cannot remove a consumer which was not
|
||||
// registered before!
|
||||
// at
|
||||
// org.emoflon.ibex.gt.api.GraphTransformationPattern.unsubscribeAppearing(GraphTransformationPattern.java:310)
|
||||
// at org.emoflon.gips.core.gt.GTMapper.terminate(GTMapper.java:69)
|
||||
// at org.emoflon.gips.core.GipsEngine.lambda$1(GIPSEngine.java:71)
|
||||
// at java.base/java.util.HashMap.forEach(HashMap.java:1421)
|
||||
// at org.emoflon.gips.core.GipsEngine.terminate(GIPSEngine.java:71)
|
||||
|
||||
return output.solutionCount() > 0;
|
||||
}
|
||||
|
||||
|
@ -84,6 +71,7 @@ public class MdvneGipsIflyeAdapter {
|
|||
*/
|
||||
public static void resetInit() {
|
||||
init = false;
|
||||
api.terminate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue