informarte / yuck

Yuck is a local-search constraint solver with FlatZinc interface
Other
56 stars 11 forks source link

Exception on constraint "fzn_global_cardinality_low_up_closed" #6

Closed vladiulianbogdan closed 4 years ago

vladiulianbogdan commented 4 years ago

Hello,

I have downloaded the yuck solver from the releases page (https://github.com/informarte/yuck/releases) and I've tried to run my model. I get the following exception. Is this an installation problem or there is a constraint incompatibility? I think the fzn_global_cardinality_low_up_closed constraint comes from the minizinc "alldifferent_except_0" that I am using.

Exception in thread "main" scala.MatchError: fzn_global_cardinality_low_up_closed(X_INTRODUCED_239_, X_INTRODUCED_242_, X_INTRODUCED_241_, X_INTRODUCED_240_) (of class yuck.flatzinc.ast.Constraint)
    at yuck.flatzinc.compiler.ConstraintFactory.compileNonImplicitConstraint(ConstraintFactory.scala:165)
    at yuck.flatzinc.compiler.ConstraintFactory.$anonfun$compileConstraint$4(ConstraintFactory.scala:155)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.flatzinc.compiler.ConstraintFactory.compileConstraint(ConstraintFactory.scala:155)
    at yuck.flatzinc.compiler.ConstraintFactory.$anonfun$run$1(ConstraintFactory.scala:131)
    at scala.collection.Iterator$$anon$10.nextCur(Iterator.scala:583)
    at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:597)
    at scala.collection.mutable.Growable.addAll(Growable.scala:61)
    at scala.collection.mutable.Growable.addAll$(Growable.scala:59)
    at scala.collection.mutable.ArrayBuffer.addAll(ArrayBuffer.scala:147)
    at scala.collection.mutable.ArrayBuffer.addAll(ArrayBuffer.scala:40)
    at scala.collection.mutable.Growable.$plus$plus$eq(Growable.scala:68)
    at scala.collection.mutable.Growable.$plus$plus$eq$(Growable.scala:68)
    at scala.collection.mutable.AbstractBuffer.$plus$plus$eq(Buffer.scala:231)
    at yuck.flatzinc.compiler.ConstraintFactory.run(ConstraintFactory.scala:130)
    at yuck.flatzinc.compiler.FlatZincCompiler.$anonfun$run$2(FlatZincCompiler.scala:61)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.$anonfun$withTimedLogScope$1(LazyLogger.scala:150)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.withTimedLogScope(LazyLogger.scala:149)
    at yuck.flatzinc.compiler.FlatZincCompiler.$anonfun$run$1(FlatZincCompiler.scala:61)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.withRootLogLevel(LazyLogger.scala:165)
    at yuck.flatzinc.compiler.FlatZincCompiler.run(FlatZincCompiler.scala:60)
    at yuck.flatzinc.compiler.FlatZincCompiler.call(FlatZincCompiler.scala:31)
    at yuck.flatzinc.runner.FlatZincSolverGenerator$BaseSolverGenerator.call(FlatZincSolverGenerator.scala:61)
    at yuck.flatzinc.runner.FlatZincSolverGenerator$BaseSolverGenerator.call(FlatZincSolverGenerator.scala:54)
    at yuck.core.OnDemandGeneratedSolver.$anonfun$call$3(Solver.scala:134)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.$anonfun$withTimedLogScope$1(LazyLogger.scala:150)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.withTimedLogScope(LazyLogger.scala:149)
    at yuck.core.OnDemandGeneratedSolver.call(Solver.scala:133)
    at yuck.core.ParallelSolver$SolverRunner.$anonfun$run$3(Solver.scala:199)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.$anonfun$withTimedLogScope$1(LazyLogger.scala:150)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.util.logging.LazyLogger.withTimedLogScope(LazyLogger.scala:149)
    at yuck.core.ParallelSolver$SolverRunner.$anonfun$run$2(Solver.scala:198)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.core.ParallelSolver$SolverRunner.$anonfun$run$1(Solver.scala:197)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at yuck.util.arm.package$.$anonfun$scoped$1(package.scala:42)
    at yuck.util.arm.package$.using(package.scala:26)
    at yuck.util.arm.package$.scoped(package.scala:42)
    at yuck.core.ParallelSolver$SolverRunner.run(Solver.scala:196)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

If I remove that constraint I get the following one:

Exception in thread "main" scala.MatchError: int_eq_imp(X_INTRODUCED_2543_, X_INTRODUCED_47_, X_INTRODUCED_2541_) (of class yuck.flatzinc.ast.Constraint)
informarte commented 4 years ago

@vladiulianbogdan, the error messages suggest that you applied Yuck to a FlatZinc model that was not compiled for Yuck, so I think you are experiencing a setup problem. Please re-consult the installation section of the README! In case you need more support, please provide details like your operating system and precisely how you apply Yuck to your problem.