Package javaff.data.metric

Examples of javaff.data.metric.ResourceOperator


      ActionOperators.put(pga,s);
      Set os = pga.getOperators();
      Iterator oit = os.iterator();
      while (oit.hasNext())
      {
        ResourceOperator ro = (ResourceOperator) oit.next();
        s.add(makeOperator(ro));
      }
    }
  }
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) || stn.BS(a2,a) ) value = ro.applyMax(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)
      {
        if (stn.B(a2,a)) value = ro.applyMin(value, stn);
      }
    }
    return value;
  }
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)
      {
        if (stn.B(a2,a) || stn.BS(a2,a)) value = ro.applyMax(value, stn);
      }
    }
    return value;
  }
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 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

          //change an before producers back
          Set u = getBeforeOperators(a);
          Iterator uit = u.iterator();
          while (uit.hasNext())
          {
            ResourceOperator ro = (ResourceOperator) uit.next();
            if (ro.change instanceof DurationFunction)
            {
              DurationFunction df = (DurationFunction) ro.change;
              DurativeAction da = df.durativeAction;
              if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP) stn.decreaseMax(da, diff);
              else if (ro.type == MetricSymbolStore.DECREASE || ro.type == MetricSymbolStore.SCALE_DOWN) stn.increaseMin(da, diff);
              change = true;
              break;
            }
          }
        }
      }

     
      else if (bc.type == MetricSymbolStore.GREATER_THAN || bc.type == MetricSymbolStore.GREATER_THAN_EQUAL)
      {
        BigDecimal value = findBeforeMin(a);
        if (value.compareTo(comp) < 0)
        {
          BigDecimal diff = comp.subtract(value);
          //change an before producers back
          Set u = getBeforeOperators(a);
          Iterator uit = u.iterator();
          while (uit.hasNext())
          {
            ResourceOperator ro = (ResourceOperator) uit.next();
            if (ro.change instanceof DurationFunction)
            {
              DurationFunction df = (DurationFunction) ro.change;
              DurativeAction da = df.durativeAction;
              if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP) stn.increaseMin(da, diff);
View Full Code Here

  public void minimize()
  {
    Iterator roit = operators.keySet().iterator();
    while (roit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) roit.next();
      if (ro.change instanceof DurationFunction)
      {
        DurativeAction da = ((DurationFunction)ro.change).durativeAction;
        if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP)
        {
View Full Code Here

  public void maximize()
  {
    Iterator roit = operators.keySet().iterator();
    while (roit.hasNext())
    {
      ResourceOperator ro = (ResourceOperator) roit.next();
      if (ro.change instanceof DurationFunction)
      {
        DurativeAction da = ((DurationFunction)ro.change).durativeAction;
        if (ro.type == MetricSymbolStore.INCREASE || ro.type == MetricSymbolStore.SCALE_UP)
        {
View Full Code Here

      }

      Iterator roit = a.getOperators().iterator();
      while (roit.hasNext())
      {
        ResourceOperator ro = (ResourceOperator) roit.next();
        NamedFunction res = (NamedFunction) ro.resource;
        PrecedenceResourceGraph prg = (PrecedenceResourceGraph) graphs.get(res);
        if (prg == null)
        {
          prg = new PrecedenceResourceGraph(stn);
          graphs.put(res,prg);
        }
        prg.addOperator(new ResourceOperator( ro.type, res, ro.change.makeOnlyDurationDependent(state)), a);
      }

    }


    Iterator git = graphs.keySet().iterator();

    while (git.hasNext())
    {
      NamedFunction nf = (NamedFunction) git.next();
      PrecedenceResourceGraph prg = (PrecedenceResourceGraph) graphs.get(nf);
      prg.addOperator(new ResourceOperator(MetricSymbolStore.INCREASE, nf, new NumberFunction(nf.getValue(problem.getTemporalMetricInitialState()))), stn.START);
      boolean changesMade = true;
      while (changesMade)
      {
        changesMade = prg.meetConditions();
        stn.constrain();
View Full Code Here

TOP

Related Classes of javaff.data.metric.ResourceOperator

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.