Examples of GoalAnd


Examples of com.exigen.ie.constrainer.GoalAnd

    //C.displayOnBacktrack(vars);
    C.traceFailures(vars);

    IntValueSelector value_selector = new IntValueSelectorMin();
    IntVarSelector var_selector = new IntVarSelectorMinSize(vars);
    Goal print = new GoalAnd(new GoalPrint(vars),new GoalPrintObject(C,cost));
    Goal solution = new GoalAnd(print,
                                new GoalGenerate(vars,var_selector,value_selector),
                                print);

    //if (!C.execute(new GoalMinimize(solution,cost)))
    if (!C.execute(solution))
View Full Code Here

Examples of com.exigen.ie.constrainer.GoalAnd

    //C.displayOnBacktrack(vars);
    C.traceFailures(vars);

    IntValueSelector value_selector = new IntValueSelectorMin();
    IntVarSelector var_selector = new IntVarSelectorMinSize(vars);
    Goal print = new GoalAnd(new GoalPrint(vars),new GoalPrintObject(C,cost));
    Goal solution = new GoalAnd(print,
                                new GoalGenerate(vars,var_selector,value_selector),
                                print);

    //if (!C.execute(new GoalMinimize(solution,cost)))
    if (!C.execute(solution))
View Full Code Here

Examples of com.exigen.ie.constrainer.GoalAnd

    Goal strategy = makeGoal(searchStrategy);
    com.exigen.ie.constrainer.Goal goal = (com.exigen.ie.constrainer.Goal)strategy.getImpl();
    for (int i = 1; i < getSearchStrategies().size(); i++) {
      strategy = makeGoal(getSearchStrategies().elementAt(i));
      com.exigen.ie.constrainer.Goal nextGoal = (com.exigen.ie.constrainer.Goal)strategy.getImpl();
      goal = new GoalAnd(goal,nextGoal);
    }
   
    //clearSolutions();
    com.exigen.ie.constrainer.Goal saveGoal = new GoalSaveSolution(this);
    com.exigen.ie.constrainer.Goal totalGoal = new GoalAnd(goal,saveGoal);
   
    IntExp cObj = (IntExp)objectiveVar.getImpl();
    if ( objective.equals(Objective.MAXIMIZE) ) {
      cObj = cObj.mul(-1);
    }
View Full Code Here

Examples of com.exigen.ie.constrainer.GoalAnd

   * </ul>
   * If fails, the latest found solution is considered as the optimal one.
   */
  public Goal execute() throws Failure
  {
    constrainer().execute(new GoalAnd(_goal_limit_cost,
                                      _goal_find_solution,
                                      _goal_save_cost,
                                      _goal_decrement_cost,
                                      _goal_fail));
    if (_number_of_solutions > 0)
    {
      //Debug.on();Debug.print("Found solution with the cost = "+_saved_cost);Debug.off();
      if (_goal_saves_solution)
        return null;
      else
        return new GoalAnd(new SetSavedCost(constrainer()),_goal_find_solution);
    }
    else
    {
      constrainer().fail();
      return null;
View Full Code Here

Examples of com.exigen.ie.constrainer.GoalAnd

  }

  Goal setCost()
  {
    //Debug.on();Debug.print("Set Cost [ " + bestCostMin() + " ; " + bestCostMax() + " ]");Debug.off();
    return new GoalAnd(_cost.moreOrEqual(bestCostMin()),
                       _cost.lessOrEqual(bestCostMax()));
  }
View Full Code Here

Examples of com.exigen.ie.constrainer.GoalAnd

                           +" Failures="+_number_of_failures
                           +" Number of solutions="+_number_of_solutions);
        if (_goal_saves_solution)
          return null;
        else
          return new GoalAnd(setCost(),findSolution()); // success
      }
      else
      {
        constrainer().fail("no solutions");
        return null;
      }
    }

    // dichotomized search
    boolean restore = true;
    _number_of_attempts++;
    //Debug.on();Debug.print(cost()+". Try cost ["+bestCostMin()+";"+best_cost+"]");Debug.off();
    if (!constrainer().execute(new GoalAnd(cost().moreOrEqual(bestCostMin()),
                                           cost().lessOrEqual(best_cost),
                                           findSolution(),
                                           _goal_set_cost_max),
                               restore))
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.