@Test(groups = "1s", timeOut=60000) public void testApply() throws Exception { m.getEnvironment().worldPush(); dp.buildNext(); dp.apply(); IntDecision d1 = dp.makeIntDecision(vars[0], DecisionOperatorFactory.makeIntEq(), 4); d1.setRefutable(true); Assert.assertTrue(d1.hasNext()); Assert.assertEquals(d1.getPosition(), 0); dp.pushDecision(d1); Assert.assertEquals(dp.size(), 2); Assert.assertEquals(dp.last.get(), 1); m.getEnvironment().worldPush(); dp.buildNext(); dp.apply(); Assert.assertTrue(d1.hasNext()); Assert.assertEquals(dp.size(), 2); Assert.assertEquals(dp.last.get(), 2); IntDecision d2 = dp.makeIntDecision(vars[1], DecisionOperatorFactory.makeIntEq(), 4); d1.setRefutable(true); IntDecision d3 = dp.makeIntDecision(vars[2], DecisionOperatorFactory.makeIntEq(), 4); d1.setRefutable(true); dp.pushDecision(d2); Assert.assertTrue(d2.hasNext()); Assert.assertEquals(dp.size(), 3); Assert.assertEquals(dp.last.get(), 2); dp.pushDecision(d3); Assert.assertTrue(d3.hasNext()); Assert.assertEquals(dp.size(), 3); Assert.assertEquals(dp.last.get(), 2); m.getEnvironment().worldPush(); dp.buildNext(); dp.apply(); Assert.assertTrue(d3.hasNext()); Assert.assertTrue(d2.hasNext()); Assert.assertEquals(dp.size(), 3); Assert.assertEquals(dp.last.get(), 3); }
public void apply() throws ContradictionException { int p = last.get(); if(p == decisions.size()-1) { decisions.get(p).apply(); last.add(1); } }
DecisionPath extends DecisionMaker implements Serializable { public void apply() throws ContradictionException { int p = last.get(); if(p == decisions.size()-1) { decisions.get(p).apply(); last.add(1); } } }
DecisionPath extends DecisionMaker implements Serializable { public void apply() throws ContradictionException { int p = last.get(); if(p == decisions.size()-1) { decisions.get(p).apply(); last.add(1); } } DecisionPath(IEnvironment environment); }
DecisionPath extends DecisionMaker implements Serializable { public void apply() throws ContradictionException { int p = last.get(); if(p == decisions.size()-1) { decisions.get(p).apply(); last.add(1); } } 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 apply() throws ContradictionException { int p = last.get(); if(p == decisions.size()-1) { decisions.get(p).apply(); last.add(1); } } 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();  }