5276b92b
Eduardo Eloy
added multi-crite...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import org.chocosolver.solver.Model;
import org.chocosolver.solver.Solution;
import org.chocosolver.solver.Solver;
import org.chocosolver.solver.constraints.Constraint;
import org.chocosolver.solver.objective.ParetoOptimizer;
import org.chocosolver.solver.variables.IntVar;
import java.io.FileWriter;
public class teste {
public static void main(String[] args) {
Model m = new Model("test");
IntVar soilSum = m.intVar(30, 200);
IntVar one = m.intVar(1);
IntVar soilToMaximize = m.intVar(-9999999,999999);
m.arithm(soilToMaximize, "=", one, "-", soilSum).post();
m.setObjective(Model.MAXIMIZE, soilToMaximize);
Solver s = m.getSolver();
if (s.solve()) {
System.out.println(soilToMaximize);
System.out.println(soilSum);
}
}
}
|