Package javaff.data

Examples of javaff.data.Action


    {
      Set acts = p.getActions();
      Iterator lit = acts.iterator();
      while (lit.hasNext())
      {
        Action a = (Action) lit.next();
        if (a instanceof StartInstantAction)
        {
          StartInstantAction sa = (StartInstantAction) a;
          if (!acts.contains(sa.getSibling())) ((TotalOrderPlan)p).addAction(sa.getSibling());
        }
View Full Code Here


    {
      Variable v = (Variable) pit.next();
      PDDLObject o = (PDDLObject) vit.next();
      varMap.put(v,o);
    }
    Action a = this.ground(varMap);
    return a;
   
   
  }
View Full Code Here

    Set goals = new HashSet(problem.goal.getConditionalPropositions());

    ListIterator toit = top.listIteratorEnd();
    while (toit.hasPrevious())
    {
      Action a = (Action) toit.previous();

      getAOrderings(a, top, pop);
      getBOrderings(a, top, pop);
      getCOrderings(a, top, pop, goals);

      goals.addAll(a.getConditionalPropositions());
    }
   
    return pop;
  }
View Full Code Here

    {
      Proposition c = (Proposition) cit.next();
      ListIterator bit = top.listIterator(a);
      while (bit.hasPrevious())
      {
        Action b = (Action) bit.previous();
        Set achieves = b.getAddPropositions();
        if (achieves.contains(c))
        {
          pop.addOrder(b,a,c);
          break;
        }
View Full Code Here

    {
      Proposition d = (Proposition) dit.next();
      ListIterator bit = top.listIterator(a);
      while (bit.hasPrevious())
      {
        Action b = (Action) bit.previous();
        Set conds = b.getConditionalPropositions();
        if (conds.contains(d))
        {
          pop.addOrder(b,a,d);
        }
      }
View Full Code Here

    {
      Proposition ad = (Proposition) adit.next();
      ListIterator bit = top.listIterator(a);
      while (bit.hasPrevious())
      {
        Action b = (Action) bit.previous();
        Set dels = b.getDeletePropositions();
        if (dels.contains(ad))
        {
          pop.addOrder(b,a,ad);
        }
      }
View Full Code Here

  }

  public Action getEarliest(Set s)
  {
    Iterator sit = s.iterator();
    Action c = null;
    while (sit.hasNext())
    {
      Action a = (Action) sit.next();
      if (c==null) c = a;
      else if (TheArray[Timepoints.indexOf(c)][0].compareTo(TheArray[Timepoints.indexOf(a)][0])>0) c = a;
    }
    return c;
  }
View Full Code Here

        HValue = new BigDecimal(RelaxedPlan.getPlanLength());

        Iterator it = RelaxedPlan.iterator();
        while (it.hasNext())
        {
          Action a = (Action) it.next();
          if (RPG.getLayer(a) == 0) helpfulActions.add(a);
        }
      }
      else HValue = javaff.JavaFF.MAX_DURATION;
      RPCalculated = true;
View Full Code Here

    SS.calculateRP(); // get the relaxed plan to the goal, to make sure helpful actions exist for S
    Set ns = new HashSet();
    Iterator ait = SS.helpfulActions.iterator(); // iterate over helpful actions
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
      if (a.isApplicable(S)) ns.add(a); // and add them to the set to return if they're applicable
    }
    return ns;
  }
View Full Code Here

    Iterator bcit = conditions.keySet().iterator();
    while (bcit.hasNext())
    {
      BinaryComparator bc = (BinaryComparator) bcit.next();
      BigDecimal comp = bc.second.getValue(null);
      Action a = (Action) conditions.get(bc);
     
      if (bc.type == MetricSymbolStore.LESS_THAN || bc.type == MetricSymbolStore.LESS_THAN_EQUAL)
      {
        BigDecimal value = findBeforeMin(a);

        if (value.compareTo(comp) >= 0)
        {
          //move an unordered consumer back
          Set u = getUnorderedConsumers(a);
          Action a2 = stn.getEarliest(u);
          stn.addConstraint(TemporalConstraint.getConstraint((InstantAction)a2, (InstantAction)a));
          changed = true;
        }
      }
      else if (bc.type == MetricSymbolStore.GREATER_THAN || bc.type == MetricSymbolStore.GREATER_THAN_EQUAL)
      {
        BigDecimal value = findBeforeMax(a);
        if (value.compareTo(comp) <= 0)
        {
          //move an unordered producer back
          Set u = getUnorderedProducers(a);
          Action a2 = stn.getEarliest(u);
          stn.addConstraint(TemporalConstraint.getConstraint((InstantAction)a2, (InstantAction)a));
          changed = true
        }
      }
    }
View Full Code Here

TOP

Related Classes of javaff.data.Action

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.