Module org.maxicp

Class ThetaTree

java.lang.Object
org.maxicp.cp.engine.constraints.scheduling.ThetaTree

public class ThetaTree extends Object
Data Structure described in Global Constraints in Scheduling, 2008 Petr Vilim, PhD thesis See The thesis.
Author:
Pierre Schaus
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThetaTree(int size)
    Creates a theta-tree able to store the specified number of activities, each identified as a number between 0 and size-1.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The earliest completion time of the activities present in the theta-tree
    void
    insert(int pos, int est, int dur)
    Insert activity in leaf nodes at given position such that it is taken into account for the getEct() computation.
    void
    remove(int pos)
    Remove activity at given position that it has no impact on the earliest completion time computation
    void
    Remove all the activities from this theta-tree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ThetaTree

      public ThetaTree(int size)
      Creates a theta-tree able to store the specified number of activities, each identified as a number between 0 and size-1. The activities inserted in a theta tree are assumed to be of increasing earliest start time. That is activity identified as i must possibly start earlier than activity i+1.
      Parameters:
      size - the number of activities that can possibly be inserted in the tree
  • Method Details

    • reset

      public void reset()
      Remove all the activities from this theta-tree
    • insert

      public void insert(int pos, int est, int dur)
      Insert activity in leaf nodes at given position such that it is taken into account for the getEct() computation.
      Parameters:
      pos - the index of the leaf node (assumed to start at 0 from left to right)
      est - earliest start time
      dur - duration
    • remove

      public void remove(int pos)
      Remove activity at given position that it has no impact on the earliest completion time computation
      Parameters:
      pos - the index of the leaf nodes, assumed to start at 0 from left to right
    • getEct

      public int getEct()
      The earliest completion time of the activities present in the theta-tree
      Returns:
      the earliest completion time of the activities present in the theta-tree