Package javaff.data

Examples of javaff.data.Action


    BigDecimal value = new BigDecimal(0);
    Iterator opit = operators.keySet().iterator();
    while (opit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) opit.next();
      Action a2 = (Action) operators.get(ro);
      if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP)
      {
        if (stn.B(a2,a) || stn.BS(a2,a) ) value = ro.applyMax(value, stn); // WARNING This is not taking into the account the order of the actions

      }
View Full Code Here


    BigDecimal value = new BigDecimal(0);
    Iterator opit = operators.keySet().iterator();
    while (opit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) opit.next();
      Action a2 = (Action) operators.get(ro);
      if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP)
      {
        if (stn.B(a2,a)) value = ro.applyMin(value, stn); // WARNING This is not taking into the account the order of the actions
      }
      else if (ro.type == MetricSymbolStore.DECREASE || ro.type == MetricSymbolStore.SCALE_DOWN)
View Full Code Here

    Set rSet = new HashSet();
    Iterator opit = operators.keySet().iterator();
    while (opit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) opit.next();
      Action a2 = (Action) operators.get(ro);
      if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP)
      {
        if (stn.U(a2,a)) rSet.add(a2);
      }
    }
View Full Code Here

    Set actionsFromS = S.getActions(); // get the logically appicable actions in S
    Set ns = new HashSet();
    Iterator ait = actionsFromS.iterator(); // Get an iterator over these actions
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
      if (a.isApplicable(S)) ns.add(a); // Check they are applicable (will check numeric/temporal constraints)
    }
    return ns;
  }
View Full Code Here

    Set rSet = new HashSet();
    Iterator opit = operators.keySet().iterator();
    while (opit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) opit.next();
      Action a2 = (Action) operators.get(ro);
      if (ro.type == MetricSymbolStore.DECREASE || ro.type == MetricSymbolStore.SCALE_DOWN)
      {
        if (stn.U(a2,a)) rSet.add(a2);
      }
    }
View Full Code Here

    Set rSet = new HashSet();
    Iterator opit = operators.keySet().iterator();
    while (opit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) opit.next();
      Action a2 = (Action) operators.get(ro);
      rSet.add(ro);
    }
    return rSet;
  }
View Full Code Here

    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 = findBeforeMax(a);
        if (value.compareTo(comp) > 0)
View Full Code Here

  {
    Set rSet = new HashSet();
    Iterator ait = actions.iterator();
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
      rSet.add(this.apply(a));
    }
    return rSet;
  }
View Full Code Here

  protected void setActionMap(Set gactions)
  {
    Iterator ait = gactions.iterator();
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
      PGAction pga = new PGAction(a);
      actionMap.put(a, pga);
      actions.add(pga);
    }
  }
View Full Code Here

    Map states = new Hashtable(); //Maps (Actions => states (which the actions are applied in))
    Iterator ait = top.getActions().iterator();
    TemporalMetricState state = problem.getTemporalMetricInitialState();
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
      if (a instanceof StartInstantAction)
      {
        StartInstantAction sia = (StartInstantAction) a;
        List l = TemporalConstraint.getBounds(sia, sia.getSibling(), sia.parent.getMaxDuration(state), sia.parent.getMinDuration(state));
        stn.addConstraints(new HashSet(l));
      }
      states.put(a, state);
      state = (TemporalMetricState) state.apply(a);
    }

   
   
    stn.consistent();

    // sort out the resources
    Map graphs = new Hashtable(); //Maps (NamedResources => PrecedenceGraphs)
    ait = top.getActions().iterator();
    while (ait.hasNext())
    {
      Action a = (Action) ait.next();
     
      Iterator bcit = a.getComparators().iterator();
      while (bcit.hasNext())
      {
        //WARNING WARNING WARNING - assumes comparators are of the form (NamedFunction </>/<=/>= StaticFunction)
                           BinaryComparator bc = (BinaryComparator) bcit.next();
        NamedFunction res = (NamedFunction) bc.first;
        PrecedenceResourceGraph prg = (PrecedenceResourceGraph) graphs.get(res);
        if (prg == null)
        {
          prg = new PrecedenceResourceGraph(stn);
          graphs.put(res,prg);
        }
        state = (TemporalMetricState) states.get(a);
        BigDecimal d = bc.second.getValue(state);
        prg.addCondition(new BinaryComparator( bc.type, res, new NumberFunction(d)), a);
      }

      Iterator roit = a.getOperators().iterator();
      while (roit.hasNext())
      {
        ResourceOperator ro = (ResourceOperator) roit.next();
        NamedFunction res = (NamedFunction) ro.resource;
        PrecedenceResourceGraph prg = (PrecedenceResourceGraph) graphs.get(res);
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.