This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
ptidej_solver [2014/03/31 14:49] yann [Problem Motifs Definitions] |
ptidej_solver [2014/03/31 14:51] yann [Problem Motifs Definitions] |
||
---|---|---|---|
Line 24: | Line 24: | ||
pb.addVar(superEntity); | pb.addVar(superEntity); | ||
- | final InheritancePathConstraint c1 = | + | final StrictInheritanceConstraint c1 = |
- | new InheritancePathConstraint( | + | new StrictInheritanceConstraint( |
- | "SuperEntity -|>- ... -|>- SubEntity", | + | "SuperEntity -|>- SubEntity", |
- | "throw new RuntimeException(\"SuperEntity -|>- ... -|>- SubEntity\");", | + | "throw new RuntimeException(\"SuperEntity -|>- SubEntity\");", |
subEntity, | subEntity, | ||
superEntity, | superEntity, | ||
Line 49: | Line 49: | ||
</code> | </code> | ||
- | In this problem, two roles are defined: that of ''SubClass'' and of ''SuperClass''. For classes to play the roles of ''SubClass' and ''SuperClass'', the ''SubClass'' must inherit from the ''SuperClass'' (even if zero, one, or more entities stands between the ''SubClass'' and the ''SuperClass'' in the inheritance tree) and the ''SubClass'' must be composed of instances of the ''SuperClass''. | + | In this problem, two roles are defined: that of ''SubClass'' and of ''SuperClass''. For classes to play the roles of ''SubClass'' and ''SuperClass'', the ''SubClass'' must inherit from the ''SuperClass'' (even if zero, one, or more entities stands between the ''SubClass'' and the ''SuperClass'' in the inheritance tree) and the ''SubClass'' must be composed of instances of the ''SuperClass''. |
===== Constraints Definitions ===== | ===== Constraints Definitions ===== |