@Test(groups = "1s", timeOut=60000) public void testPushDecision() throws Exception { Assert.assertEquals(dp.size(), 1); Assert.assertEquals(dp.last.get(), 1); IntDecision d1 = dp.makeIntDecision(vars[0], DecisionOperatorFactory.makeIntEq(), 4); dp.pushDecision(d1); Assert.assertEquals(d1.getPosition(), 1); Assert.assertEquals(dp.size(), 2); Assert.assertEquals(dp.last.get(), 1); IntDecision d2 = dp.makeIntDecision(vars[1], DecisionOperatorFactory.makeIntEq(), 4); Assert.assertEquals(d2.getArity(), 2); dp.pushDecision(d2); Assert.assertEquals(d2.getPosition(), 1); Assert.assertEquals(dp.size(), 2); Assert.assertEquals(dp.last.get(), 1); }
public void pushDecision(Decision decision) { int p = last.get(); decision.setPosition(p); if(decisions.size() == p){ decisions.add(decision); }else if(decisions.size() == p + 1) { decisions.set(p, decision); }else throw new SolverException("Cannot add decision to decision path"); }
DecisionPath extends DecisionMaker implements Serializable { public void pushDecision(Decision decision) { int p = last.get(); decision.setPosition(p); if(decisions.size() == p){ decisions.add(decision); }else if(decisions.size() == p + 1) { decisions.set(p, decision); }else throw new SolverException("Cannot add decision to decision path"); } }
DecisionPath extends DecisionMaker implements Serializable { public void pushDecision(Decision decision) { int p = last.get(); decision.setPosition(p); if(decisions.size() == p){ decisions.add(decision); }else if(decisions.size() == p + 1) { decisions.set(p, decision); }else throw new SolverException("Cannot add decision to decision path"); } DecisionPath(IEnvironment environment); }
DecisionPath extends DecisionMaker implements Serializable { public void pushDecision(Decision decision) { int p = last.get(); decision.setPosition(p); if(decisions.size() == p){ decisions.add(decision); }else if(decisions.size() == p + 1) { decisions.set(p, decision); }else throw new SolverException("Cannot add decision to decision path"); } DecisionPath(IEnvironment environment); void buildNext(); void apply(); void pushDecision(Decision decision); void synchronize(); void synchronize(boolean free); Decision getLastDecision(); int size(); Decision getDecision(int i); void transferInto(Collection<Decision> aList, boolean includeRootDecision); String lastDecisionToString(); @Override String toString(); }
DecisionPath extends DecisionMaker implements Serializable { public void pushDecision(Decision decision) { int p = last.get(); decision.setPosition(p); if(decisions.size() == p){ decisions.add(decision); }else if(decisions.size() == p + 1) { decisions.set(p, decision); }else throw new SolverException("Cannot add decision to decision path"); } DecisionPath(IEnvironment environment); void buildNext(); void apply(); void pushDecision(Decision decision); void synchronize(); void synchronize(boolean free); Decision getLastDecision(); int size(); Decision getDecision(int i); void transferInto(Collection<Decision> aList, boolean includeRootDecision); String lastDecisionToString(); @Override String toString();  }