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.Method | |
---|---|
AddMandatoryConsumption | Return type: Arguments: Adds a mandatory profile consumption. All mandatory usages will be subtracted from the y_max-y_min profile to build the residual capacity. |
AddRectangle | Return type: Arguments: Adds a rectangle to the current shape. |
BuildResidualCapacityProfile | Return type: Arguments: 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. |
Clear | Return type: |
GetBoundingArea | Return type: Returns the exact area of the bounding polyline of all rectangles added. Note that this will redo the computation each time. |
Rectangle | Arguments: |