Package com.exigen.ie.tools

Examples of com.exigen.ie.tools.FastVector


  } //~ ObserverCardValue


  public IntExpCardinality(Constrainer constrainer, Vector vars, int card_value) throws Failure
  {
    this(constrainer, new FastVector(vars), card_value);
  }
View Full Code Here


  {
    super(constrainer,name);
    if (constrainer.showVariableNames())
      _name = name;

    _observers = new FastVector(); //10,5);

    _in_process = false;
  }
View Full Code Here

  final public void notifyObservers(EventOfInterest interest) throws Failure
  {
//    Debug.on(); Debug.print("* "+interest); Debug.off();
//   FastVector observers = (FastVector)_observers.clone();
    FastVector observers = _observers;
    _constrainer.incrementNumberOfNotifications();
    int size = observers.size();
    for(int i=0; i < size ; ++i)
    {
      Observer observer = (Observer)observers.elementAt(i);
      if (observer.interestedIn(interest))
      {
//        Debug.on(); Debug.print("Observer "+i+": "+observer);Debug.off();
        observer.update(this,interest);
      }
View Full Code Here

    _max_occupied_memory = _initial_memory;
    _name = new String(s);

    _active_undoable_once = new FastStack();

    _intvars = new FastVector();
    _floatvars = new FastVector();
    _intsetvars = new FastVector();
    _constraints = new FastVector();
    // _goals = new FastVector();

    // _execution_stack = new FastStack();
    // _alternative_stack = new FastStack();
    // _reversibility_stack = new FastStack();

    _reversibility_stack = new UndoStack();
    _goal_stack = new GoalStack(_reversibility_stack);

    _propagation_queue = new FastQueue();

    // _goal_CP_marker = new GoalDisplay(this, "ChoicePointMarker");
    // _undo_CP_marker = new UndoImpl();

    // _save_goal = new GoalDisplay(this,"Save");
    // _restore_goal = new GoalAnd(new GoalDisplay(this, "\nRestore!"),
    // new GoalFail(this));

    _show_internal_names = false;
    _show_variable_names = true;
    _choice_point = 0;
    _number_of_choice_points = 0;
    _number_of_failures = 0;
    _number_of_notifications = 0;
    _failure_display_frequency = 0;
    _number_of_undos = 0;
    _choice_point_objects = new FastVector();
    _failure_objects = new FastVector();
    _backtrack_objects = new FastVector();
    _trace_goals = false;
    _time_limit = 0;
    _time_limit_exceeded = false;

    // _failure = new Failure();
View Full Code Here

  public IntExpArray distribute(IntExpArray vars, int[] values)
      throws Failure {

    IntArrayCards vcards = vars.cards();

    FastVector cards = new FastVector();

    for (int i = 0; i < values.length; ++i) {
      cards.addElement(vcards.cardAt(values[i]));
      // cards.addElement(addIntVar(0,vars.size(),"Count of "+values[i]));
    }
    // redundant constraint
    return new IntExpArray(this, cards);
  }
View Full Code Here

   * Initializes an array of instantiation goals for the variables.
   */
  void initGoals()
  {
    int size = _vars.size();
    _goals = new FastVector(size);
    for(int i=0; i < size; i++)
    {
      FloatExp exp = _vars.elementAt(i);
      Goal goal = new GoalFloatInstantiate((FloatVar)exp);
      _goals.addElement(goal);
View Full Code Here

                             // contains 3 intervals [(0;2), (5;6), (9;9)]

  public DomainImplWithHoles(IntVar var, int min, int max) //throws Failure
  {
    super(var,min,max);
    _values = new FastVector();
    _values.addElement(new DomainInterval(min,max));
  }
View Full Code Here

  public Schedule(Constrainer c, int start, int end)
  {
    _constrainer = c;
    _scheduleStart = start;
    _scheduleEnd = end;
    _jobs = new FastVector();
    _resources = new FastVector();
    _requirements = new FastVector();
  }
View Full Code Here

   * @return An array of resource objects
   */
  public Resource[] getAssignedResources(Job job)
  {
    int i;
    FastVector v = new FastVector(_requirements.size());
    for (i = 0; i < _requirements.size(); i++)
    {
      AlternativeResourceConstraint c =
        (AlternativeResourceConstraint) _requirements.elementAt(i);
      if (job.equals(c.getJob()))
      {
        Resource r = c.getResource();
        if (r != null)
          v.add(r);
      }
    }
    Resource[] res = new Resource[v.size()];
    for (i = 0; i < _requirements.size(); i++)
      res[i] = (Resource) v.elementAt(i);
    return res;
  }
View Full Code Here

   * @return An array of job objects
   */
  public Job[] getAssignedJobs(Resource res)
  {
    int i;
    FastVector v = new FastVector(_requirements.size());
    for (i = 0; i < _requirements.size(); i++)
    {
      AlternativeResourceConstraint c =
        (AlternativeResourceConstraint) _requirements.elementAt(i);
      if (res.equals(c.getResource()))
      {
        v.add(c.getJob());
      }
    }
    Job[] jobs = new Job[v.size()];
    for (i = 0; i < _requirements.size(); i++)
      jobs[i] = (Job) v.elementAt(i);
    return jobs;
  }
View Full Code Here

TOP

Related Classes of com.exigen.ie.tools.FastVector

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.