@Test
public void testExpandGraph() {
try {
logger.info("*************************************************");
TextDrawVisitor visitor = new TextDrawVisitor();
planningGraph.accept(visitor);
logger.info("Initial Graph is: "+visitor.toString());
planningGraph.expandGraph();
visitor.reset();
planningGraph.accept(visitor);
logger.info("Expanded Graph is: "+visitor.toString());
logger.info("*************************************************");
logger.info("Testing dinner date problem");
operatorFactory.resetOperatorTemplates();
PropositionLevel level = new PropositionLevel();
for(Proposition proposition : descriptions[0].getInitialState()) {
level.addProposition(proposition);
}
for(Operator operator: descriptions[0].getOperators()) {
try {
operatorFactory.addOperatorTemplate(operator);
} catch (OperatorFactoryException e) {
fail(e.getMessage());
}
}
planningGraph = new PlanningGraph(level);
visitor.reset();
planningGraph.accept(visitor);
logger.info("Initial Graph is: "+visitor.toString());
logger.info("Expanding Graph...");
planningGraph.expandGraph();
visitor.reset();
planningGraph.accept(visitor);
logger.info("Expanded Graph is: "+visitor.toString());
logger.info("Expanding Graph...");
planningGraph.expandGraph();
visitor.reset();
planningGraph.accept(visitor);
logger.info("Expanded Graph is: "+visitor.toString());
logger.info("*************************************************");
} catch (PlanningGraphException e) {
fail(e.toString());