The AmongVar constraint seems to assume that all variable domains are of the type JaCoP.core.IntervalDomain. But when variables are instantiated using the constructor IntVar(Store store, String name, int min, int max), the domain may actually be of type JaCoP.core.SmallDenseDomain (if max - min <= 63), which results in the following exception:
Exception in thread "main" java.lang.ClassCastException: JaCoP.core.SmallDenseDomain cannot be cast to JaCoP.core.IntervalDomain
at JaCoP.constraints.AmongVar.consistency(AmongVar.java:589)
at JaCoP.core.Store.consistency(Store.java:640)
at JaCoP.core.Store.imposeWithConsistency(Store.java:888)
Thank you for the bug report.
We will look into it right away.
In the meantime make sure that you use IntervalDomain for all your variables that are used within AmongVar.
best,
Radek