Stay organized with collections Save and categorize content based on your preferences.

C++ Reference: class CapacityProfile

Note: This documentation is automatically generated.

This class is used by the no_overlap_2d constraint to maintain the envelope of a set of rectangles. This envelope is not the convex hull, but the exact polyline (aligned with the x and y axis) that contains all the rectangles passed with the AddRectangle() call.

Return type: void

Arguments: IntegerValue x_min, IntegerValue x_max, IntegerValue y_height

Adds a mandatory profile consumption. All mandatory usages will be subtracted from the y_max-y_min profile to build the residual capacity.


Return type: void

Arguments: IntegerValue x_min, IntegerValue x_max, IntegerValue y_min, IntegerValue y_max

Adds a rectangle to the current shape.


Return type: void

Arguments: std::vector<Rectangle>* result

Returns the profile of the function: capacity(x) = max(y_max of rectangles overlapping x) - min(y_min of rectangle overlapping x) - sum(y_height of mandatory rectangles overlapping x) where a rectangle overlaps x if x_min <= x < x_max. Note the profile can contain negative heights in case the mandatory part exceeds the range on the y axis. Note that it adds a sentinel (kMinIntegerValue, 0) at the start. It is useful when we reverse the direction on the x axis.


Return type: void


Return type: IntegerValue

Returns the exact area of the bounding polyline of all rectangles added. Note that this will redo the computation each time.


Arguments: IntegerValue start, IntegerValue height