Determining Wake-up Events for Real-Interval Constraints

Instances of classes derived from OZ_CtWakeUp indicate to the runtime system which wake-up event occurred. Therefore, member functions to initialize an RIWakeUp instance according to a possible event are defined. They will be used to determine the wake-up event of a propagator upon a certain parameter when imposing a propagator(see Section ``Extending OZ_Expect'').

class RIWakeUp : public OZ_CtWakeUp {
public:
  static OZ_CtWakeUp wakeupMin(void) {
    OZ_CtWakeUp ri_wakeup_min;
    ri_wakeup_min.init();
    ri_wakeup_min.setWakeUp(0);
    return ri_wakeup_min;
  }
  static OZ_CtWakeUp wakeupMax(void) {
    OZ_CtWakeUp ri_wakeup_max;
    ri_wakeup_max.init();
    ri_wakeup_max.setWakeUp(1);
    return ri_wakeup_max;
  }
  static OZ_CtWakeUp wakeupMinMax(void) {
    OZ_CtWakeUp ri_wakeup_minmax;
    ri_wakeup_minmax.init();
    ri_wakeup_minmax.setWakeUp(0);
    ri_wakeup_minmax.setWakeUp(1);
    return ri_wakeup_minmax;
  }
};

An instance of RIWakeUp is computed from an instance of RI and a profile (stored before the constraint has be modified) by

OZ_CtWakeUp RI::getWakeUpDescriptor(OZ_CtProfile * p)

(see Section ``The Actual Real-Interval Constraint''). The definition of the profile class RIProfile for real-intervals is given below.

class RIProfile : public OZ_CtProfile {
private:
  ri_float _l_u;
 
public:
  RIProfile(void) {}
  virtual void init(OZ_Ct * c) {
    RI * ri = (RI *) c;
    _l = ri->_l;
    _u = ri->_u;
  }
};

The function RIProfile::init(OZ_Ct * c) takes a snapshot of c to enable the detection of the abovementioned wake-up events, i. e., modified lower/upper bound resp. both.


Tobias Müller
Version 1.4.0 (20080702)