Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <diffn_util.h>
Classes | |
struct | Rectangle |
Public Member Functions | |
void | Clear () |
void | AddRectangle (IntegerValue x_min, IntegerValue x_max, IntegerValue y_min, IntegerValue y_max) |
Adds a rectangle to the current shape. | |
void | AddMandatoryConsumption (IntegerValue x_min, IntegerValue x_max, IntegerValue y_height) |
void | BuildResidualCapacityProfile (std::vector< Rectangle > *result) |
IntegerValue | GetBoundingArea () |
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.
Definition at line 270 of file diffn_util.h.
void operations_research::sat::CapacityProfile::AddMandatoryConsumption | ( | 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.
Definition at line 660 of file diffn_util.cc.
void operations_research::sat::CapacityProfile::AddRectangle | ( | IntegerValue | x_min, |
IntegerValue | x_max, | ||
IntegerValue | y_min, | ||
IntegerValue | y_max ) |
Adds a rectangle to the current shape.
Definition at line 649 of file diffn_util.cc.
void operations_research::sat::CapacityProfile::BuildResidualCapacityProfile | ( | 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.
Definition at line 670 of file diffn_util.cc.
void operations_research::sat::CapacityProfile::Clear | ( | ) |
Definition at line 644 of file diffn_util.cc.
IntegerValue operations_research::sat::CapacityProfile::GetBoundingArea | ( | ) |
Returns the exact area of the bounding polyline of all rectangles added.
Definition at line 716 of file diffn_util.cc.