diff options
author | 2019-08-01 01:00:12 +0200 | |
---|---|---|
committer | 2019-08-01 01:00:12 +0200 | |
commit | 7021a4d1f2805ebf3145cbc3893761d12f23361f (patch) | |
tree | b75c51136d3b593f94bf517a8552a1dbf8abdd2b /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend | |
parent | Build Cbc wrapper under Ubuntu 18.04 (diff) | |
download | VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.tar.gz VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.tar.zst VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.zip |
Configurability and better statistics for measurements
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend index ffa9e6e6..52a390a8 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/RelationConstraintCalculator.xtend | |||
@@ -20,6 +20,7 @@ class RelationConstraints { | |||
20 | @Data | 20 | @Data |
21 | class RelationMultiplicityConstraint { | 21 | class RelationMultiplicityConstraint { |
22 | Relation relation | 22 | Relation relation |
23 | Relation inverseRelation | ||
23 | boolean containment | 24 | boolean containment |
24 | boolean container | 25 | boolean container |
25 | int lowerBound | 26 | int lowerBound |
@@ -47,7 +48,7 @@ class RelationMultiplicityConstraint { | |||
47 | } | 48 | } |
48 | 49 | ||
49 | def constrainsRemainingInverse() { | 50 | def constrainsRemainingInverse() { |
50 | !containment && inverseUpperBoundFinite | 51 | lowerBound >= 1 && !containment && inverseUpperBoundFinite |
51 | } | 52 | } |
52 | 53 | ||
53 | def constrainsRemainingContents() { | 54 | def constrainsRemainingContents() { |
@@ -119,8 +120,8 @@ class RelationConstraintCalculator { | |||
119 | inverseUpperMultiplicity = upperMultiplicities.get(relation) | 120 | inverseUpperMultiplicity = upperMultiplicities.get(relation) |
120 | container = containmentRelations.contains(inverseRelation) | 121 | container = containmentRelations.contains(inverseRelation) |
121 | } | 122 | } |
122 | val constraint = new RelationMultiplicityConstraint(relation, containment, container, lowerMultiplicity, | 123 | val constraint = new RelationMultiplicityConstraint(relation, inverseRelation, containment, container, |
123 | upperMultiplicity, inverseUpperMultiplicity) | 124 | lowerMultiplicity, upperMultiplicity, inverseUpperMultiplicity) |
124 | if (constraint.isActive) { | 125 | if (constraint.isActive) { |
125 | if (relation.parameters.size != 2) { | 126 | if (relation.parameters.size != 2) { |
126 | throw new IllegalArgumentException('''Relation «relation.name» has multiplicity or containment constraints, but it is not binary''') | 127 | throw new IllegalArgumentException('''Relation «relation.name» has multiplicity or containment constraints, but it is not binary''') |