Package pddl4j

Examples of pddl4j.Parser


//        options.put(RequireKey.EXISTENTIAL_PRECONDITIONS, false);
//        options.put(RequireKey.UNIVERSAL_PRECONDITIONS, false);
//        options.put(RequireKey.CONDITIONAL_EFFECTS, false);

    try {
      Parser pddlParser = new Parser(options);
      PDDLObject pddlDomain = pddlParser.parse(new File(domain));
      PDDLObject pddlProblem = pddlParser.parse(new File(problem));
      ErrorManager mgr = pddlParser.getErrorManager();
      // If the parser produces errors we print it and stop
      if (mgr.contains(Message.ERROR)) {
        for(String m : mgr.getMessages(Message.ALL))
          logger.severe(m);
      } else {// else we print the warnings
        for(String m : mgr.getMessages(Message.WARNING))
          logger.severe(m);
      }
      if (pddlDomain != null && pddlProblem != null) {
        this.pddlObject = pddlParser.link(pddlDomain, pddlProblem);
      } else if (pddlDomain == null ){
        throw new pddl4j.ParserException("Parse error in PDDL Domain");
      } else if (pddlProblem == null){
        throw new pddl4j.ParserException("Parse error in PDDL Problem");
      }
View Full Code Here

TOP

Related Classes of pddl4j.Parser

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.