Examples of IEnvironment


Examples of memory.IEnvironment

        initGraph(ArrayUtils.append(ivars, new IntVar[]{cost}), cautomaton)
    ));
    }

    private static StoredValuedDirectedMultiGraph initGraph(IntVar[] vars, ICostAutomaton pi) {
    IEnvironment environment = vars[0].getSolver().getEnvironment();
        int aid = 0;
        int nid = 0;

        int size = vars.length - 1;
View Full Code Here

Examples of memory.IEnvironment

        final int[] removed = new int[list.length - end];
        System.arraycopy(list, end, removed, 0, list.length - end);

        this.list = newList;
        this.position = newPosition;
        final IEnvironment env = last.getEnvironment();
        this.last = null;
        this.last = env.makeInt(list.length - 1);
        for (int i = 0; i < removed.length; i++) {
            remove(removed[i]);
        }
    }
View Full Code Here

Examples of memory.IEnvironment

   */
  public PropKLoops(IntVar[] succs, int offSet, IntVar nbLoops) {
    super(ArrayUtils.append(succs, new IntVar[]{nbLoops}), PropagatorPriority.UNARY, true);
    this.n = succs.length;
    this.offSet = offSet;
    IEnvironment environment = solver.getEnvironment();
    this.possibleLoops = SetFactory.makeStoredSet(SetType.BIPARTITESET, n, solver);
    this.nbMinLoops = environment.makeInt();
  }
View Full Code Here

Examples of memory.IEnvironment

        this.sets = new SetVar[sets.length];
        for (int i = 0; i < sets.length; i++) {
            this.sets[i] = (SetVar) vars[i];
        }
        this.nbEmpty = (IntVar) vars[n];
    IEnvironment environment = solver.getEnvironment();
        this.canBeEmpty = SetFactory.makeStoredSet(SetType.BIPARTITESET, n, solver);
        this.isEmpty = SetFactory.makeStoredSet(SetType.BIPARTITESET, n, solver);
        this.nbAlreadyEmpty = environment.makeInt();
        this.nbMaybeEmpty = environment.makeInt();
    }
View Full Code Here

Examples of memory.IEnvironment

    //////////////////////////////////////////////////////////////////////////////////////

    public BitsetIntVarImpl(String name, int[] sortedValues, Solver solver) {
        super(name, solver);
        IEnvironment env = solver.getEnvironment();
        OFFSET = sortedValues[0];
        int capacity = sortedValues[sortedValues.length - 1] - OFFSET + 1;
        this.VALUES = env.makeBitSet(capacity);
        for (int i = 0; i < sortedValues.length; i++) {
            this.VALUES.set(sortedValues[i] - OFFSET);
        }
        this.LB = env.makeInt(0);
        this.UB = env.makeInt(capacity - 1);
        this.SIZE = env.makeInt(VALUES.cardinality());
        LENGTH = capacity;
    }
View Full Code Here

Examples of memory.IEnvironment

        LENGTH = capacity;
    }

    public BitsetIntVarImpl(String name, int offset, BitSet values, Solver solver) {
        super(name, solver);
        IEnvironment env = solver.getEnvironment();
        OFFSET = offset;
        int cardinality = values.cardinality();
        this.VALUES = env.makeBitSet(cardinality);
        for (int i = 0; i > -1; i = values.nextSetBit(i+1)) {
            this.VALUES.set(i);
        }
        this.LB = env.makeInt(0);
        this.UB = env.makeInt(VALUES.prevSetBit(VALUES.size()));
        this.SIZE = env.makeInt(cardinality);
        LENGTH = this.UB.get();
    }
View Full Code Here

Examples of memory.IEnvironment

        LENGTH = this.UB.get();
    }

    public BitsetIntVarImpl(String name, int min, int max, Solver solver) {
        super(name, solver);
        IEnvironment env = solver.getEnvironment();
        this.OFFSET = min;
        int capacity = max - min + 1;
        this.VALUES = env.makeBitSet(capacity);
        for (int i = 0; i <= max - min; i++) {
            this.VALUES.set(i);
        }
        this.LB = env.makeInt(0);
        this.UB = env.makeInt(max - min);
        this.SIZE = env.makeInt(capacity);
        LENGTH = capacity;
    }
View Full Code Here

Examples of memory.IEnvironment

        super(x, y, table);
        offset0 = x.getLB();
        offset1 = y.getLB();
        currentSupport0 = new IStateInt[x.getUB() - offset0 + 1];
        currentSupport1 = new IStateInt[y.getUB() - offset1 + 1];
        IEnvironment environment = solver.getEnvironment();
        for (int i = 0; i < currentSupport0.length; i++) {
            currentSupport0[i] = environment.makeInt();
            currentSupport0[i].set(-1);
        }
        for (int i = 0; i < currentSupport1.length; i++) {
            currentSupport1[i] = environment.makeInt();
            currentSupport1[i].set(-1);
        }

    }
View Full Code Here

Examples of memory.IEnvironment

                        }
                        prev = val;
                    }
                }
                if (s == Sort.detect) {
                    IEnvironment environment = solver.getEnvironment();
                    if (isDsc) {
                        s = Sort.desc;
                        environment.save(new Operation() {
                            @Override
                            public void undo() {
                                s = Sort.detect;
                            }
                        });
                    } else if (isAsc) {
                        s = Sort.asc;
                        environment.save(new Operation() {
                            @Override
                            public void undo() {
                                s = Sort.detect;
                            }
                        });
                    } else {
                        s = Sort.none;
                        environment.save(new Operation() {
                            @Override
                            public void undo() {
                                s = Sort.detect;
                            }
                        });
View Full Code Here

Examples of memory.IEnvironment

        this.arity = vs.length;
        this.blocks = new int[arity];
        this.offsets = new int[arity];
        this.supports = new IStateInt[arity][];

        IEnvironment environment = solver.getEnvironment();
        for (int i = 0; i < arity; i++) {
            offsets[i] = vs[i].getLB();
            this.supports[i] = new IStateInt[vars[i].getDomainSize()];
            for (int j = 0; j < supports[i].length; j++) {
                this.supports[i][j] = environment.makeInt(0);
            }

        }
        this.tab = relation.getTableLists();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.