Esempio n. 1
0
  protected DomOverWDeg(Solver solver, long seed) {
    this.solver = solver;
    rand = new Random(seed);
    counter = new FailPerPropagator(solver.getCstrs(), solver);
    vid2dsize = new TIntIntHashMap();
    vid2degree = new TIntIntHashMap();
    vid2weig = new TIntIntHashMap();
    pid2ari = new TIntObjectHashMap<IStateInt>();
    pid2arity = new TIntIntHashMap(10, 0.5F, -1, -1);

    Variable[] vars = solver.getVars();
    for (int i = 0; i < vars.length; i++) {
      vars[i].addMonitor(this);
    }
    Constraint[] cstrs = solver.getCstrs();
    for (int i = 0; i < cstrs.length; i++) {
      Propagator[] props = cstrs[i].getPropagators();
      for (int j = 0; j < props.length; j++) {
        pid2ari.put(props[j].getId(), solver.getEnvironment().makeInt(props[j].arity()));
      }
    }
  }