Package pddl4j.exp.action

Examples of pddl4j.exp.action.ActionDef


      List<Proposition> goalState    = new ArrayList<Proposition>();
     
      logger.finest("--> Actions\n");
     
      while(actionsIterator.hasNext()){
        ActionDef actionDef = actionsIterator.next();
        logger.finest(actionDef.toString());
       
        Exp precontidion = (Exp) ((Action)actionDef).getPrecondition();
        Exp effect = (Exp) ((Action)actionDef).getEffect();
       
        List<String> parameterTypes = new ArrayList<String>();
       
        OperatorImpl operatorImpl = new OperatorImpl(actionDef.getName());
        List<Term> termsOp = new ArrayList<Term>();
        for(pddl4j.exp.term.Term term: actionDef.getParameters()){
          termsOp.add(new VarTerm(term.getImage().replace("?", "").toUpperCase()));
          parameterTypes.add(term.getTypeSet().toString());
         
          Set<String> setVar = this.types.get(term.getTypeSet().toString());
         
          for(Constant c: this.pddlObject.getTypedDomain(term.getTypeSet())){
            if(setVar == null){
              setVar = new HashSet<String>();
              setVar.add(c.toString());
              this.types.put(term.getTypeSet().toString(), setVar);
            } else setVar.add(c.toString());
          }
        }

        this.parameterTypes.put(actionDef.getName(), parameterTypes);
       
        operatorImpl.addTerms(termsOp);
       
        operatorImpl.getPreconds().addAll(this.getPropositionFromDomainExp(precontidion));
        operatorImpl.getEffects().addAll(this.getPropositionFromDomainExp(effect));
View Full Code Here

TOP

Related Classes of pddl4j.exp.action.ActionDef

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.