diff options
author | 2020-05-19 23:25:51 +0200 | |
---|---|---|
committer | 2020-05-19 23:25:51 +0200 | |
commit | 39fce03a49c68ae35ea921df8696fdf4b200fb25 (patch) | |
tree | 5cea9534b23273af48f91002fd0e641d6b28918b /Solvers/VIATRA-Solver | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | option to calculate object creation costs in fitness (diff) | |
download | VIATRA-Generator-39fce03a49c68ae35ea921df8696fdf4b200fb25.tar.gz VIATRA-Generator-39fce03a49c68ae35ea921df8696fdf4b200fb25.tar.zst VIATRA-Generator-39fce03a49c68ae35ea921df8696fdf4b200fb25.zip |
Merge branch 'master' of github.com:viatra/VIATRA-Generator
Diffstat (limited to 'Solvers/VIATRA-Solver')
4 files changed, 8 insertions, 5 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend index ca09ae00..b63607f7 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend | |||
@@ -59,7 +59,8 @@ class ModelGenerationMethodProvider { | |||
59 | boolean nameNewElements, | 59 | boolean nameNewElements, |
60 | TypeInferenceMethod typeInferenceMethod, | 60 | TypeInferenceMethod typeInferenceMethod, |
61 | ScopePropagator scopePropagator, | 61 | ScopePropagator scopePropagator, |
62 | DocumentationLevel debugLevel | 62 | DocumentationLevel debugLevel, |
63 | boolean objectCreationCosts | ||
63 | ) { | 64 | ) { |
64 | val statistics = new ModelGenerationStatistics | 65 | val statistics = new ModelGenerationStatistics |
65 | val writeFiles = (debugLevel === DocumentationLevel.NORMAL || debugLevel === DocumentationLevel.FULL) | 66 | val writeFiles = (debugLevel === DocumentationLevel.NORMAL || debugLevel === DocumentationLevel.FULL) |
@@ -77,7 +78,7 @@ class ModelGenerationMethodProvider { | |||
77 | objectRefinementRules = refinementRuleProvider.createObjectRefinementRules(logicProblem, emptySolution, queries,scopePropagator,nameNewElements,statistics) | 78 | objectRefinementRules = refinementRuleProvider.createObjectRefinementRules(logicProblem, emptySolution, queries,scopePropagator,nameNewElements,statistics) |
78 | val relationRefinementRules = refinementRuleProvider.createRelationRefinementRules(queries,statistics) | 79 | val relationRefinementRules = refinementRuleProvider.createRelationRefinementRules(queries,statistics) |
79 | 80 | ||
80 | val unfinishedMultiplicities = goalConstraintProvider.getUnfinishedMultiplicityQueries(logicProblem,queries) | 81 | val unfinishedMultiplicities = goalConstraintProvider.getUnfinishedMultiplicityQueries(logicProblem,queries,objectCreationCosts) |
81 | val unfinishedWF = queries.getUnfinishedWFQueries.values | 82 | val unfinishedWF = queries.getUnfinishedWFQueries.values |
82 | 83 | ||
83 | val invalidWF = queries.getInvalidWFQueries.values | 84 | val invalidWF = queries.getInvalidWFQueries.values |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/GoalConstraintProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/GoalConstraintProvider.xtend index 0e8d341a..e03a8c35 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/GoalConstraintProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/GoalConstraintProvider.xtend | |||
@@ -19,9 +19,8 @@ import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher | |||
19 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 19 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
20 | 20 | ||
21 | class GoalConstraintProvider { | 21 | class GoalConstraintProvider { |
22 | val calculateObjectCost = false | ||
23 | 22 | ||
24 | def public getUnfinishedMultiplicityQueries(LogicProblem p, GeneratedPatterns patterns) { | 23 | def public getUnfinishedMultiplicityQueries(LogicProblem p, GeneratedPatterns patterns, boolean calculateObjectCost) { |
25 | val res = new ArrayList() | 24 | val res = new ArrayList() |
26 | 25 | ||
27 | res.addAll(patterns.unfinishedNonContainmentMulticiplicityQueries,false) | 26 | res.addAll(patterns.unfinishedNonContainmentMulticiplicityQueries,false) |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend index df3ccee5..0bd8c50e 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend | |||
@@ -75,7 +75,8 @@ class ViatraReasoner extends LogicReasoner{ | |||
75 | viatraConfig.nameNewElements, | 75 | viatraConfig.nameNewElements, |
76 | viatraConfig.typeInferenceMethod, | 76 | viatraConfig.typeInferenceMethod, |
77 | scopePropagator, | 77 | scopePropagator, |
78 | viatraConfig.documentationLevel | 78 | viatraConfig.documentationLevel, |
79 | viatraConfig.calculateObjectCreationCosts | ||
79 | ) | 80 | ) |
80 | //println("parsed") | 81 | //println("parsed") |
81 | 82 | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend index 7369344c..6e3c5235 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend | |||
@@ -53,6 +53,8 @@ class ViatraReasonerConfiguration extends LogicSolverConfiguration{ | |||
53 | public var conaintmentWeight = 2 | 53 | public var conaintmentWeight = 2 |
54 | public var nonContainmentWeight = 1 | 54 | public var nonContainmentWeight = 1 |
55 | public var unfinishedWFWeight = 1 | 55 | public var unfinishedWFWeight = 1 |
56 | |||
57 | public var calculateObjectCreationCosts = false | ||
56 | } | 58 | } |
57 | 59 | ||
58 | public class DiversityDescriptor { | 60 | public class DiversityDescriptor { |