Package graphplan.graph.draw

Examples of graphplan.graph.draw.TextDrawVisitor


  @Test
  public void testAccept() {
    addLevels();
    try {
      TextDrawVisitor textDrawVisitor = new TextDrawVisitor();
      planningGraph.accept(textDrawVisitor);
      logger.info("****************************************************");
      logger.info("Visitor results");
      logger.info(textDrawVisitor.toString());
      logger.info("****************************************************");
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here


    }
   
    actionLevel.addAction(operator);
    assertTrue(planningGraph.addGraphLevel(actionLevel));
   
    TextDrawVisitor visitor = new TextDrawVisitor();
    planningGraph.accept(visitor);
    logger.info(visitor.toString());

    logger.info("Testing addition of proposition level");
    PropositionLevel level = new PropositionLevel();
    for (Proposition proposition : initialPropositions) {
      level.addProposition(proposition);
    }
    assertTrue("Failed to add proposition level "+level,planningGraph.addGraphLevel(level));
   

    visitor = new TextDrawVisitor();
    planningGraph.accept(visitor);
    logger.info(visitor.toString());
  }
View Full Code Here

  @Test
  public void testGoalsPossible() {
    assertTrue("Same goals not possible",planningGraph.goalsPossible(initialPropositions, 0));
      logger.info("*************************************************");
      logger.info("Goals: "+initialPropositions+" possible in graph");
      TextDrawVisitor visitor = new TextDrawVisitor();
      planningGraph.accept(visitor);
      logger.info(visitor.toString());
      logger.info("*************************************************");
  }
 
View Full Code Here

  @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());
View Full Code Here

      } else op.setIndex(this.operators.ceiling(op).getIndex());
    }
  }
 
  public String toString() {
    TextDrawVisitor visitor = new TextDrawVisitor();
    if(this.accept(visitor)) {
      return visitor.toString();
    } else {
      return super.toString();
    }
  }
View Full Code Here

TOP

Related Classes of graphplan.graph.draw.TextDrawVisitor

Copyright © 2018 www.massapicom. 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.