Advertisement
vilmosnagy

Untitled

May 2nd, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public class Choco {
  2.     public static void main(String[] args) {
  3.         Solver solver = new Solver();
  4.         IntVar X = VF.enumerated("X", 0, 5, solver);
  5.         IntVar Y = VF.enumerated("Y", -1, 3, solver);
  6.         Tuples tuples = new Tuples(true);
  7.         tuples.add(1, -2);
  8.         tuples.add(1, 1);
  9.         tuples.add(4, 2);
  10.         tuples.add(1, 4);
  11.         solver.post(ICF.sum(new IntVar[]{X, Y}, VF.integer("2", 2, 2, solver)));
  12.         solver.post(ICF.table(X, Y, tuples, "AC2001"));
  13.         solver.findAllSolutions();
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement