public void Demon() {
   Solver solver = new Solver("DemonTest");
   IntVar x = solver.MakeIntVar(new int[] {2, 4, -1, 6, 11, 10}, "x");
   NetDemon demon = new SetMaxDemon(x);
   Assert.Equal(11, x.Max());
   demon.Run(solver);
   Assert.Equal(10, x.Max());
 }
Example #2
0
    static void DemonTest()
    {
        Solver   solver = new Solver("DemonTest");
        IntVar   x      = solver.MakeIntVar(new int[] { 2, 4, -1, 6, 11, 10 }, "x");
        NetDemon demon  = new SetMaxDemon(x);

        CheckLongEq(x.Max(), 11, "Bad test setup");
        demon.Run(solver);
        CheckLongEq(x.Max(), 10, "The demon did not run.");
    }
Example #3
0
 static void DemonTest() {
   Solver solver = new Solver("DemonTest");
   IntVar x = solver.MakeIntVar(new int[] {2, 4, -1, 6, 11, 10}, "x");
   NetDemon demon = new SetMaxDemon(x);
   CheckLongEq(x.Max(), 11, "Bad test setup");
   demon.Run(solver);
   CheckLongEq(x.Max(), 10, "The demon did not run.");
 }