@Test(groups="1s", timeOut=60000) public void cosTest() { Model m = new Model(); IntVar[] X = m.intVarArray("X",5,0,5); IntVar[] Y = m.intVarArray("Y",5,0,5); m.allDifferent(Y).post(); m.arithm(Y[1],"=",Y[3]).post(); Solver s = m.getSolver(); s.setSearch( Search.conflictOrderingSearch( Search.intVarSearch(new InputOrder<>(m), var -> { Assert.assertFalse(var.getName().contains("Y")); return var.getLB(); },X) ), greedySearch(inputOrderLBSearch(Y)) ); while(s.solve()); }
public ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy) { super(mainStrategy.vars); this.model = model; this.mainStrategy = mainStrategy; vars = new ArrayList<>(); var2pos = new TIntIntHashMap(16, .5f, -1, -1); prev = new TIntArrayList(); next = new TIntArrayList(); pcft = -1; this.scope = new HashSet<>(Arrays.asList(mainStrategy.vars)); }
ConflictOrderingSearch extends AbstractStrategy<V> implements IMonitorContradiction { public ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy) { super(mainStrategy.vars); this.model = model; this.mainStrategy = mainStrategy; vars = new ArrayList<>(); var2pos = new TIntIntHashMap(16, .5f, -1, -1); prev = new TIntArrayList(); next = new TIntArrayList(); pcft = -1; this.scope = new HashSet<>(Arrays.asList(mainStrategy.vars)); } }
ConflictOrderingSearch extends AbstractStrategy<V> implements IMonitorContradiction { public ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy) { super(mainStrategy.vars); this.model = model; this.mainStrategy = mainStrategy; vars = new ArrayList<>(); var2pos = new TIntIntHashMap(16, .5f, -1, -1); prev = new TIntArrayList(); next = new TIntArrayList(); pcft = -1; this.scope = new HashSet<>(Arrays.asList(mainStrategy.vars)); } ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy); }
ConflictOrderingSearch extends AbstractStrategy<V> implements IMonitorContradiction { public ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy) { super(mainStrategy.vars); this.model = model; this.mainStrategy = mainStrategy; vars = new ArrayList<>(); var2pos = new TIntIntHashMap(16, .5f, -1, -1); prev = new TIntArrayList(); next = new TIntArrayList(); pcft = -1; this.scope = new HashSet<>(Arrays.asList(mainStrategy.vars)); } ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy); @Override boolean init(); @Override void remove(); @SuppressWarnings("unchecked") @Override Decision<V> getDecision(); @Override void onContradiction(ContradictionException cex); }
ConflictOrderingSearch extends AbstractStrategy<V> implements IMonitorContradiction { public ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy) { super(mainStrategy.vars); this.model = model; this.mainStrategy = mainStrategy; vars = new ArrayList<>(); var2pos = new TIntIntHashMap(16, .5f, -1, -1); prev = new TIntArrayList(); next = new TIntArrayList(); pcft = -1; this.scope = new HashSet<>(Arrays.asList(mainStrategy.vars)); } ConflictOrderingSearch(Model model, AbstractStrategy<V> mainStrategy); @Override boolean init(); @Override void remove(); @SuppressWarnings("unchecked") @Override Decision<V> getDecision(); @Override void onContradiction(ContradictionException cex);  }