@Test public void testCopyEmptySolutionSuccess() { final Solution emptySolution = new Solution(null); Assert.assertNotSame(emptySolution, emptySolution.copySolution()); }
public Solution copySolution() { Solution ret = new Solution(model, varsToStore); ret.empty = empty; if (intmap != null) { ret.intmap = new TIntIntHashMap(intmap); } if (realmap != null) { ret.realmap = new TIntObjectHashMap<>(realmap); } if (setmap != null) { ret.setmap = new TIntObjectHashMap<>(setmap); } return ret; }
Solution implements ICause { public Solution copySolution() { Solution ret = new Solution(model, varsToStore); ret.empty = empty; if (intmap != null) { ret.intmap = new TIntIntHashMap(intmap); } if (realmap != null) { ret.realmap = new TIntObjectHashMap<>(realmap); } if (setmap != null) { ret.setmap = new TIntObjectHashMap<>(setmap); } return ret; } }
Solution implements ICause { public Solution copySolution() { Solution ret = new Solution(model, varsToStore); ret.empty = empty; if (intmap != null) { ret.intmap = new TIntIntHashMap(intmap); } if (realmap != null) { ret.realmap = new TIntObjectHashMap<>(realmap); } if (setmap != null) { ret.setmap = new TIntObjectHashMap<>(setmap); } return ret; } Solution(Model model, Variable... varsToStore); }
Solution implements ICause { public Solution copySolution() { Solution ret = new Solution(model, varsToStore); ret.empty = empty; if (intmap != null) { ret.intmap = new TIntIntHashMap(intmap); } if (realmap != null) { ret.realmap = new TIntObjectHashMap<>(realmap); } if (setmap != null) { ret.setmap = new TIntObjectHashMap<>(setmap); } return ret; } Solution(Model model, Variable... varsToStore); Solution record(); @Override String toString(); Solution copySolution(); int getIntVal(IntVar v); void setIntVal(IntVar var, int val); int[] getSetVal(SetVar s); void setSetVal(SetVar var, int[] val); double[] getRealBounds(RealVar r); void setRealBounds(RealVar var, double[] val); void restore(); boolean exists(); List<IntVar> retrieveIntVars(boolean includeBoolVar); List<BoolVar> retrieveBoolVars(); List<SetVar> retrieveSetVars(); List<RealVar> retrieveRealVars(); }
Solution implements ICause { public Solution copySolution() { Solution ret = new Solution(model, varsToStore); ret.empty = empty; if (intmap != null) { ret.intmap = new TIntIntHashMap(intmap); } if (realmap != null) { ret.realmap = new TIntObjectHashMap<>(realmap); } if (setmap != null) { ret.setmap = new TIntObjectHashMap<>(setmap); } return ret; } Solution(Model model, Variable... varsToStore); Solution record(); @Override String toString(); Solution copySolution(); int getIntVal(IntVar v); void setIntVal(IntVar var, int val); int[] getSetVal(SetVar s); void setSetVal(SetVar var, int[] val); double[] getRealBounds(RealVar r); void setRealBounds(RealVar var, double[] val); void restore(); boolean exists(); List<IntVar> retrieveIntVars(boolean includeBoolVar); List<BoolVar> retrieveBoolVars(); List<SetVar> retrieveSetVars(); List<RealVar> retrieveRealVars();  }