FRAMES NO FRAMES

Rounding, Inward & Outward
PREVIOUS NEXT
Description
Description

The member functions:

IlcActivity::requires

IlcActivity::provides

IlcActivity::requiresNot

all accept an argument, outward. This argument is important only when one of the timetables of the resource that is required or provided by the invoking activity has a time step greater than one.

The time step of a timetable is defined by the argument timeStep of the member function makeTimetableConstraint (IlcCapResource and IlcStateResource).

The meaning of the argument outward is best illustrated by an example. Let's say we have a unary resource; its timetable starts at time 0, its time step is 5, and an activity of duration 5 requires the resource with time extent IlcTimeExtent::IlcFromStartToEnd. Let's assume further that it starts at time 1 (one). We represent those ideas like this:

/* Must be during search (e.g., inside a goal) */

IloSolver solver = getSolver();
IlcScheduler schedule(solver, 0, 100);
IlcUnaryResource resource(schedule, IlcFalse);
solver.add(resource.makeTimetableConstraint(5));
IlcActivity act(schedule, 5);
solver.add(act.requires(resource, 1,
                        IlcFromStartToEnd,
                        outward));
act.setStartTime(1);

If outward is IlcTrue, the activity uses the resource from time 0 (zero) to time 10. That is, the occupancy of the activity is rounded outward toward the nearest valid times that correspond to time steps.

In contrast, if outward is IlcFalse, the activity does not use the resource at all. That is, the occupancy of the activity is rounded inward toward the nearest valid times that correspond to time steps.

Outward rounding is useful when you want to express the idea that even if an activity requires a resource only part of a time period, the resource is still considered in use for the entire time period. In contrast, inward rounding corresponds to a situation where an activity requires a resource only when the activity uses the resource throughout the entire time period.

Rounding arguments are not used for instances of IlcDiscreteEnergy, for which only the energy consumed in time buckets is relevant, nor for instances of IlcContinuousReservoir, for which the time step of the timetable is always 1.

See Also

IlcActivity, IlcResourceConstraint, Timetable

PREVIOUS NEXT