diff options
author | 2020-07-07 15:00:13 +0200 | |
---|---|---|
committer | 2020-07-07 15:00:13 +0200 | |
commit | a7b9a3eef14fc165909d00c65bb6fc1744a8ebd8 (patch) | |
tree | dd816939088926b3009432afa22be0e2a116436f /Application/hu.bme.mit.inf.dslreasoner.application/src | |
parent | Add modified VIATRA-DSE version (diff) | |
download | VIATRA-Generator-a7b9a3eef14fc165909d00c65bb6fc1744a8ebd8.tar.gz VIATRA-Generator-a7b9a3eef14fc165909d00c65bb6fc1744a8ebd8.tar.zst VIATRA-Generator-a7b9a3eef14fc165909d00c65bb6fc1744a8ebd8.zip |
Trying to fix performance regressions
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend index b1be56cb..bc4fa42f 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | |||
@@ -10,6 +10,9 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Threshold | |||
10 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration | 10 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration |
11 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SMTSolver | 11 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SMTSolver |
12 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SmtSolverConfiguration | 12 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SmtSolverConfiguration |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints | ||
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver | ||
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy | ||
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveConfiguration | 16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveConfiguration |
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveElementConfiguration | 17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveElementConfiguration |
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor | 18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor |
@@ -98,42 +101,47 @@ class SolverLoader { | |||
98 | console.writeError('''Malformed number format: «e.message»''') | 101 | console.writeError('''Malformed number format: «e.message»''') |
99 | } | 102 | } |
100 | } | 103 | } |
101 | if(config.containsKey("numeric-solver-at-end")) { | 104 | if (config.containsKey("numeric-solver-at-end")) { |
102 | val stringValue = config.get("numeric-solver-at-end") | 105 | val stringValue = config.get("numeric-solver-at-end") |
103 | if(stringValue.equals("true")) { | 106 | if (stringValue.equals("true")) { |
104 | println("numeric-solver-at-end") | 107 | println("numeric-solver-at-end") |
105 | c.runIntermediateNumericalConsistencyChecks = false | 108 | c.runIntermediateNumericalConsistencyChecks = false |
106 | } | 109 | } |
107 | } | 110 | } |
108 | if(config.containsKey("fitness-punishSize")) { | 111 | if (config.containsKey("fitness-punishSize")) { |
109 | val stringValue = config.get("fitness-punishSize") | 112 | val stringValue = config.get("fitness-punishSize") |
110 | try { | 113 | c.punishSize = Boolean.parseBoolean(stringValue) |
111 | c.punishSize = Boolean.parseBoolean(stringValue) | ||
112 | } catch(Exception e) {} | ||
113 | } | 114 | } |
114 | if(config.containsKey("fitness-scope")) { | 115 | if (config.containsKey("fitness-scope")) { |
115 | val stringValue = config.get("fitness-scope") | 116 | val stringValue = config.get("fitness-scope") |
116 | try { | 117 | c.scopeWeight = Integer.parseInt(stringValue) |
117 | c.scopeWeight = Integer.parseInt(stringValue) | ||
118 | } catch(Exception e) {} | ||
119 | } | 118 | } |
120 | if(config.containsKey("fitness-missing-containent")) { | 119 | if (config.containsKey("fitness-missing-containment")) { |
121 | val stringValue = config.get("fitness-missing-containent") | 120 | val stringValue = config.get("fitness-missing-containment") |
122 | try { | 121 | c.conaintmentWeight = Integer.parseInt(stringValue) |
123 | c.conaintmentWeight = Integer.parseInt(stringValue) | ||
124 | } catch(Exception e) {} | ||
125 | } | 122 | } |
126 | if(config.containsKey("fitness-missing-noncontainent")) { | 123 | if (config.containsKey("fitness-missing-noncontainment")) { |
127 | val stringValue = config.get("fitness-missing-noncontainent") | 124 | val stringValue = config.get("fitness-missing-noncontainment") |
128 | try { | 125 | c.nonContainmentWeight = Integer.parseInt(stringValue) |
129 | c.nonContainmentWeight = Integer.parseInt(stringValue) | ||
130 | } catch(Exception e) {} | ||
131 | } | 126 | } |
132 | if(config.containsKey("fitness-missing-wf")) { | 127 | if (config.containsKey("fitness-missing-wf")) { |
133 | val stringValue = config.get("fitness-missing-wf") | 128 | val stringValue = config.get("fitness-missing-wf") |
134 | try { | 129 | c.unfinishedWFWeight = Integer.parseInt(stringValue) |
135 | c.unfinishedWFWeight = Integer.parseInt(stringValue) | 130 | } |
136 | } catch(Exception e) {} | 131 | if (config.containsKey("fitness-objectCreationCosts")) { |
132 | val stringValue = config.get("fitness-objectCreationCosts") | ||
133 | c.calculateObjectCreationCosts = Boolean.parseBoolean(stringValue) | ||
134 | } | ||
135 | if (config.containsKey("scopePropagator")) { | ||
136 | val stringValue = config.get("scopePropagator") | ||
137 | c.scopePropagatorStrategy = switch (stringValue) { | ||
138 | case "polyhedral": new ScopePropagatorStrategy.Polyhedral( | ||
139 | PolyhedralScopePropagatorConstraints.Relational, PolyhedralScopePropagatorSolver.Clp, true) | ||
140 | case "hybrid": new ScopePropagatorStrategy.Polyhedral( | ||
141 | PolyhedralScopePropagatorConstraints.Relational, PolyhedralScopePropagatorSolver.Clp, false) | ||
142 | case "typeHierarchy": ScopePropagatorStrategy.BasicTypeHierarchy | ||
143 | default: throw new IllegalArgumentException("Unknown scope propagator: " + stringValue) | ||
144 | } | ||
137 | } | 145 | } |
138 | for (objectiveEntry : objectiveEntries) { | 146 | for (objectiveEntry : objectiveEntries) { |
139 | val costObjectiveConfig = new CostObjectiveConfiguration | 147 | val costObjectiveConfig = new CostObjectiveConfiguration |