diff options
author | 2019-04-08 00:58:00 +0200 | |
---|---|---|
committer | 2019-04-08 00:58:00 +0200 | |
commit | c1f185fd8fc2c3dfc123d9271726c588963c7c01 (patch) | |
tree | 88a5bb94017e7d3f0fbce0a51a78c2549b0977bd /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend | |
parent | Infrastructure for objective functions (diff) | |
download | VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.tar.gz VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.tar.zst VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.zip |
Objective POC implementation
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend | 32 |
1 files changed, 25 insertions, 7 deletions
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 9ef23c59..e6aee20c 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 | |||
@@ -7,18 +7,22 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration | |||
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationMethod | 7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationMethod |
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod | 8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod |
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser | 9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser |
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind | ||
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold | ||
10 | import java.util.LinkedList | 12 | import java.util.LinkedList |
11 | import java.util.List | 13 | import java.util.List |
12 | import java.util.Set | 14 | import java.util.Set |
13 | import org.eclipse.xtext.xbase.lib.Functions.Function1 | 15 | import org.eclipse.xtext.xbase.lib.Functions.Function1 |
14 | 16 | ||
15 | enum StateCoderStrategy { | 17 | enum StateCoderStrategy { |
16 | Neighbourhood, NeighbourhoodWithEquivalence, IDBased, DefinedByDiversity | 18 | Neighbourhood, |
19 | NeighbourhoodWithEquivalence, | ||
20 | IDBased, | ||
21 | DefinedByDiversity | ||
17 | } | 22 | } |
18 | 23 | ||
19 | class ViatraReasonerConfiguration extends LogicSolverConfiguration{ | 24 | class ViatraReasonerConfiguration extends LogicSolverConfiguration { |
20 | //public var Iterable<PQuery> existingQueries | 25 | // public var Iterable<PQuery> existingQueries |
21 | |||
22 | public var nameNewElements = false | 26 | public var nameNewElements = false |
23 | public var StateCoderStrategy stateCoderStrategy = StateCoderStrategy.Neighbourhood | 27 | public var StateCoderStrategy stateCoderStrategy = StateCoderStrategy.Neighbourhood |
24 | public var TypeInferenceMethod typeInferenceMethod = TypeInferenceMethod.PreliminaryAnalysis | 28 | public var TypeInferenceMethod typeInferenceMethod = TypeInferenceMethod.PreliminaryAnalysis |
@@ -26,7 +30,7 @@ class ViatraReasonerConfiguration extends LogicSolverConfiguration{ | |||
26 | * Once per 1/randomBacktrackChance the search selects a random state. | 30 | * Once per 1/randomBacktrackChance the search selects a random state. |
27 | */ | 31 | */ |
28 | public var int randomBacktrackChance = 20; | 32 | public var int randomBacktrackChance = 20; |
29 | 33 | ||
30 | /** | 34 | /** |
31 | * Describes the required diversity between the solutions. | 35 | * Describes the required diversity between the solutions. |
32 | * Null means that the solutions have to have different state codes only. | 36 | * Null means that the solutions have to have different state codes only. |
@@ -44,7 +48,9 @@ class ViatraReasonerConfiguration extends LogicSolverConfiguration{ | |||
44 | /** | 48 | /** |
45 | * Configuration for cutting search space. | 49 | * Configuration for cutting search space. |
46 | */ | 50 | */ |
47 | public var SearchSpaceConstraint searchSpaceConstraints = new SearchSpaceConstraint | 51 | public var SearchSpaceConstraint searchSpaceConstraints = new SearchSpaceConstraint |
52 | |||
53 | public var List<CostObjectiveConfiguration> costObjectives = newArrayList | ||
48 | } | 54 | } |
49 | 55 | ||
50 | class DiversityDescriptor { | 56 | class DiversityDescriptor { |
@@ -73,4 +79,16 @@ class SearchSpaceConstraint { | |||
73 | public static val UNLIMITED_MAXDEPTH = Integer.MAX_VALUE | 79 | public static val UNLIMITED_MAXDEPTH = Integer.MAX_VALUE |
74 | public var int maxDepth = UNLIMITED_MAXDEPTH | 80 | public var int maxDepth = UNLIMITED_MAXDEPTH |
75 | public var List<Function1<ModelGenerationMethod, ModelGenerationMethodBasedGlobalConstraint>> additionalGlobalConstraints = new LinkedList | 81 | public var List<Function1<ModelGenerationMethod, ModelGenerationMethodBasedGlobalConstraint>> additionalGlobalConstraints = new LinkedList |
76 | } \ No newline at end of file | 82 | } |
83 | |||
84 | class CostObjectiveConfiguration { | ||
85 | public var List<CostObjectiveElementConfiguration> elements = newArrayList | ||
86 | public var ObjectiveKind kind | ||
87 | public var ObjectiveThreshold threshold | ||
88 | public var boolean findExtremum | ||
89 | } | ||
90 | |||
91 | class CostObjectiveElementConfiguration { | ||
92 | public var String patternQualifiedName | ||
93 | public var int weight | ||
94 | } | ||