Hi,
I try the the features of Oscar.cbls. I start with the examples here :
https://bitbucket.org/oscarlib/oscar/wiki/StartCBLSI have the following compilattion errors :
NQueensEasy1.scala:34: type mismatch;
found : scala.collection.immutable.Range.Inclusive
required: Int
val queens = Array.tabulate(N)(q => CBLSIntVar(0 to N-1,init(q),"queen" + q))
NQueensEasy1.scala:39: value + is not a member of Nothing
c.add(allDifferent(Array.tabulate(N)(q => (queens(q) + q).toIntVar)))
NQueensEasy1.scala:39: polymorphic expression cannot be instantiated to expected type;
found : [T]Array[T]
required: Iterable[oscar.cbls.invariants.core.computation.IntValue]
c.add(allDifferent(Array.tabulate(N)(q => (queens(q) + q).toIntVar)))
NQueensEasy1.scala:40: ambiguous reference to overloaded definition,
both method - in class Int of type (x: Char)Int
and method - in class Int of type (x: Byte)Int
match argument types (Nothing)
Error occurred in an application involving default arguments.
c.add(allDifferent(Array.tabulate(N)(q => (q - queens(q)).toIntVar)))
NQueensEasy1.scala:40: polymorphic expression cannot be instantiated to expected type;
found : [T]Array[T]
required: Iterable[oscar.cbls.invariants.core.computation.IntValue]
c.add(allDifferent(Array.tabulate(N)(q => (q - queens(q)).toIntVar)))
NQueensEasy1.scala:57: value :=: is not a member of Nothing
queens(q1) :=: queens(q2)
NQueensEasy1.scala:67: value mkString is not a member of Array[Nothing]
println(queens.mkString(","))
Any idea ?
Thanks in advance for your help,
Maxime.