diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps')
8 files changed, 2 insertions, 114 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin index fd8995c0..9acd8621 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin index afdf61a1..ee672cb1 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.CpsMdeOptimiserMain.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.CpsMdeOptimiserMain.xtendbin index e8035410..b9f0df1a 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.CpsMdeOptimiserMain.xtendbin +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.CpsMdeOptimiserMain.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.ExcludedOptimisationInterpreter.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.ExcludedOptimisationInterpreter.xtendbin deleted file mode 100644 index 315d1748..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/.ExcludedOptimisationInterpreter.xtendbin +++ /dev/null | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.java index 7a2a7e99..c047f255 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.java | |||
@@ -1,10 +1,8 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | 1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; |
2 | 2 | ||
3 | import com.google.inject.Injector; | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | 3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; |
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | 4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; |
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator; | 5 | import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator; |
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.ExcludedRun; | ||
8 | import java.io.BufferedReader; | 6 | import java.io.BufferedReader; |
9 | import java.io.BufferedWriter; | 7 | import java.io.BufferedWriter; |
10 | import java.io.FileReader; | 8 | import java.io.FileReader; |
@@ -19,7 +17,7 @@ import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | |||
19 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 17 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
20 | import org.eclipse.xtext.xbase.lib.Exceptions; | 18 | import org.eclipse.xtext.xbase.lib.Exceptions; |
21 | import org.eclipse.xtext.xbase.lib.Pair; | 19 | import org.eclipse.xtext.xbase.lib.Pair; |
22 | import uk.ac.kcl.inf.mdeoptimiser.languages.MoptStandaloneSetup; | 20 | import uk.ac.kcl.inf.mdeoptimiser.interfaces.cli.Run; |
23 | 21 | ||
24 | @SuppressWarnings("all") | 22 | @SuppressWarnings("all") |
25 | public class CpsMdeOptimiserMain { | 23 | public class CpsMdeOptimiserMain { |
@@ -46,8 +44,7 @@ public class CpsMdeOptimiserMain { | |||
46 | problem.eResource().save(CollectionLiterals.<Object, Object>emptyMap()); | 44 | problem.eResource().save(CollectionLiterals.<Object, Object>emptyMap()); |
47 | Pair<String, String> _mappedTo = Pair.<String, String>of("cps.ecore", CpsPackage.eNS_URI); | 45 | Pair<String, String> _mappedTo = Pair.<String, String>of("cps.ecore", CpsPackage.eNS_URI); |
48 | CpsMdeOptimiserMain.fixupHenshinModel("model/cps.henshin", "model/cps_fixup.henshin", Collections.<String, String>unmodifiableMap(CollectionLiterals.<String, String>newHashMap(_mappedTo))); | 46 | CpsMdeOptimiserMain.fixupHenshinModel("model/cps.henshin", "model/cps_fixup.henshin", Collections.<String, String>unmodifiableMap(CollectionLiterals.<String, String>newHashMap(_mappedTo))); |
49 | final Injector injector = new MoptStandaloneSetup().createInjectorAndDoEMFRegistration(); | 47 | Run.main(new String[] { "-p", CpsMdeOptimiserMain.PROJECT_PATH, "-m", CpsMdeOptimiserMain.MOPT_PATH }); |
50 | injector.<ExcludedRun>getInstance(ExcludedRun.class).run(CpsMdeOptimiserMain.PROJECT_PATH, CpsMdeOptimiserMain.MOPT_PATH); | ||
51 | } catch (Throwable _e) { | 48 | } catch (Throwable _e) { |
52 | throw Exceptions.sneakyThrow(_e); | 49 | throw Exceptions.sneakyThrow(_e); |
53 | } | 50 | } |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedMoeaOptimisation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedMoeaOptimisation.java deleted file mode 100644 index 52d3f665..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedMoeaOptimisation.java +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | ||
2 | |||
3 | import java.util.Properties; | ||
4 | import org.moeaframework.Executor; | ||
5 | import org.moeaframework.Instrumenter; | ||
6 | import org.moeaframework.algorithm.PeriodicAction; | ||
7 | import org.moeaframework.core.TerminationCondition; | ||
8 | import org.moeaframework.core.spi.AlgorithmFactory; | ||
9 | import uk.ac.kcl.inf.mdeoptimiser.languages.mopt.AlgorithmSpec; | ||
10 | import uk.ac.kcl.inf.mdeoptimiser.languages.mopt.SolverSpec; | ||
11 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.executor.SolutionGenerator; | ||
12 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.moea.MoeaOptimisation; | ||
13 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.moea.algorithms.MoeaOptimisationAlgorithmProvider; | ||
14 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.moea.instrumentation.PopulationCollector; | ||
15 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.moea.problem.MoeaOptimisationProblem; | ||
16 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.operators.adaptation.MutationStepSizeStrategy; | ||
17 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.operators.adaptation.MutationStepSizeStrategyFactory; | ||
18 | |||
19 | @SuppressWarnings("all") | ||
20 | public class ExcludedMoeaOptimisation extends MoeaOptimisation { | ||
21 | private SolutionGenerator solutionGenerator; | ||
22 | |||
23 | private Instrumenter algorithmStepSizeInstrumenter; | ||
24 | |||
25 | @Override | ||
26 | public Instrumenter execute(final SolverSpec solverSpec, final SolutionGenerator solutionGenerator) { | ||
27 | Instrumenter _xblockexpression = null; | ||
28 | { | ||
29 | this.solutionGenerator = solutionGenerator; | ||
30 | _xblockexpression = super.execute(solverSpec, solutionGenerator); | ||
31 | } | ||
32 | return _xblockexpression; | ||
33 | } | ||
34 | |||
35 | @Override | ||
36 | public Instrumenter runOptimisation(final SolverSpec solverSpec, final Properties optimisationProperties) { | ||
37 | final AlgorithmFactory algorithmFactory = new AlgorithmFactory(); | ||
38 | MoeaOptimisationAlgorithmProvider _moeaOptimisationAlgorithmProvider = new MoeaOptimisationAlgorithmProvider(); | ||
39 | algorithmFactory.addProvider(_moeaOptimisationAlgorithmProvider); | ||
40 | Instrumenter _attachPopulationSizeCollector = new Instrumenter().addExcludedPackage("org.eclipse").withProblemClass( | ||
41 | MoeaOptimisationProblem.class, this.solutionGenerator).attachApproximationSetCollector().attachElapsedTimeCollector().attachPopulationSizeCollector(); | ||
42 | PopulationCollector _populationCollector = new PopulationCollector(); | ||
43 | this.algorithmStepSizeInstrumenter = _attachPopulationSizeCollector.attach(_populationCollector).withFrequency(1).withFrequencyType( | ||
44 | PeriodicAction.FrequencyType.STEPS); | ||
45 | AlgorithmSpec _algorithm = solverSpec.getAlgorithm(); | ||
46 | MutationStepSizeStrategy stepSizeStrategy = new MutationStepSizeStrategyFactory(_algorithm, this.algorithmStepSizeInstrumenter).getStrategy(); | ||
47 | this.solutionGenerator.setMutationStepSizeStrategy(stepSizeStrategy); | ||
48 | this.algorithmStepSizeInstrumenter.addExcludedPackage("jdk"); | ||
49 | Object _get = optimisationProperties.get("terminationCondition"); | ||
50 | new Executor().usingAlgorithmFactory(algorithmFactory).withAlgorithm(solverSpec.getAlgorithm().getName()).withProblemClass(MoeaOptimisationProblem.class, this.solutionGenerator).withProperties(optimisationProperties).withInstrumenter(this.algorithmStepSizeInstrumenter).withTerminationCondition( | ||
51 | ((TerminationCondition) _get)).run(); | ||
52 | return this.algorithmStepSizeInstrumenter; | ||
53 | } | ||
54 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedOptimisationInterpreter.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedOptimisationInterpreter.java deleted file mode 100644 index 90641d73..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedOptimisationInterpreter.java +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.ExcludedMoeaOptimisation; | ||
4 | import java.util.List; | ||
5 | import org.eclipse.emf.ecore.EPackage; | ||
6 | import org.eclipse.emf.henshin.model.Unit; | ||
7 | import org.moeaframework.Instrumenter; | ||
8 | import uk.ac.kcl.inf.mdeoptimiser.languages.mopt.Optimisation; | ||
9 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IModelProvider; | ||
10 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.OptimisationInterpreter; | ||
11 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.executor.SolutionGenerator; | ||
12 | |||
13 | @SuppressWarnings("all") | ||
14 | public class ExcludedOptimisationInterpreter extends OptimisationInterpreter { | ||
15 | private final Optimisation model; | ||
16 | |||
17 | public ExcludedOptimisationInterpreter(final String projectPath, final Optimisation model) { | ||
18 | super(projectPath, model); | ||
19 | this.model = model; | ||
20 | } | ||
21 | |||
22 | @Override | ||
23 | public Instrumenter start() { | ||
24 | List<Unit> _breedingOperators = this.getBreedingOperators(); | ||
25 | List<Unit> _mutationOperators = this.getMutationOperators(); | ||
26 | IModelProvider _modelProvider = this.getModelProvider(); | ||
27 | EPackage _metamodel = this.getMetamodel(); | ||
28 | SolutionGenerator solutionGenerator = new SolutionGenerator(this.model, _breedingOperators, _mutationOperators, _modelProvider, _metamodel); | ||
29 | return new ExcludedMoeaOptimisation().execute(this.model.getSolver(), solutionGenerator); | ||
30 | } | ||
31 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedRun.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedRun.java deleted file mode 100644 index 76f12e79..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ExcludedRun.java +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.ExcludedOptimisationInterpreter; | ||
4 | import java.util.List; | ||
5 | import java.util.Map; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | import org.moeaframework.Instrumenter; | ||
8 | import uk.ac.kcl.inf.mdeoptimiser.interfaces.cli.Run; | ||
9 | import uk.ac.kcl.inf.mdeoptimiser.languages.mopt.Optimisation; | ||
10 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.output.MDEOBatch; | ||
11 | |||
12 | @SuppressWarnings("all") | ||
13 | public class ExcludedRun extends Run { | ||
14 | @Override | ||
15 | public MDEOBatch runBatch(final String moptProjectPath, final Optimisation optimisationModel, final Integer batch, final boolean singleBatch) { | ||
16 | final ExcludedOptimisationInterpreter optimisationInterpreter = new ExcludedOptimisationInterpreter(moptProjectPath, optimisationModel); | ||
17 | final long startTime = System.nanoTime(); | ||
18 | final Instrumenter optimisationOutcome = optimisationInterpreter.start(); | ||
19 | final long endTime = System.nanoTime(); | ||
20 | final long experimentDuration = ((endTime - startTime) / 1000000); | ||
21 | final Map<EPackage, List<org.eclipse.emf.henshin.model.Module>> generatedRules = optimisationInterpreter.getRulegenOperators(); | ||
22 | return new MDEOBatch(batch, experimentDuration, optimisationOutcome, generatedRules, singleBatch); | ||
23 | } | ||
24 | } | ||