Please somebody help me with this error Thanks, i Using the JaCoP Library, It´s a transport Problem and i need find the OptimalSearch it's constraints programming
Exception in thread "main" java.lang.NullPointerException
at JaCoP.core.IntVar.singleton(IntVar.java:378)
at JaCoP.core.IntVar.putModelConstraint(IntVar.java:301)
at JaCoP.constraints.SumWeight.impose(SumWeight.java:301)
at JaCoP.core.Store.impose(Store.java:851)
at transporte.Transporte.model(Transporte.java:73)
at transporte.Transporte.main(Transporte.java:86)
Java Result: 1
http://pastebin.com/ZV4j234S Example Class
http://pastebin.com/at7nfAwE Transport Class
The Proble was solve with the correct instance of the variable cost Ex:
i write the code that:
IntVar cost = new IntVar(); <--- The Bad Instance IntVar cost = new IntVar(store, "Costo", 0, 10000); <-- The correct instance
0 and 10000 are variables and can change the values.