The “before-or-after” constraint

Ioan Popescu

Purpose

A first step in implementing the changeover constraint. Basically, the before-or-after constraint between activities A and B ensures that there is enough time between them to insert a changeover.

(A before-or-after B) = (A before B) or (B before A)

Each “before” relationship has its own offset.

PODL Keyword

	before-or-after

PODL syntax and semantics

The fact that activity A is before activity B with an offset of 2 time units, or it is after B with an offset of 3 time units, is expressed in PODL like this:

       (activity :name B
			...
			...
	)

       (activity :name A
		 :temporal-relation
		  ( before-or-after 	:activity B
					:interval 2 3)
		 ...
		 ...
	)

Implementation

The main topic here is the disjunctive nature of this constraint. This gave the opportunity of “don’t-know-nondeterminism” by exploring both alternatives in the same time and keeping the result in the domains of the variables. When the alternative is known then the other one is discarded.

The propagation of the constraint

         (A before-or-after B) = (A before B) or (B before A)

follows each branch of the disjunct and saves the union of the solutions into the domains of the variables taking advantage of the bit vector of the IntervalVariable.