Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class SimpleBoundCosts
Note: This documentation is automatically generated.
A structure meant to store soft bounds and associated violation constants.
It is 'Simple' because it has one BoundCost per element,
in contrast to 'Multiple'. Design notes:
- it is meant to store model information to be shared through pointers,
so it disallows copy and assign to avoid accidental duplication.
- it keeps soft bounds as an array of structs to help cache,
because code that uses such bounds typically use both bound and cost.
- soft bounds are named pairs, prevents some mistakes.
- using operator[] to access elements is not interesting,
because the structure will be accessed through pointers, moreover having
to type bound_cost reminds the user of the order if they do a copy
assignment of the element.
Arguments: const SimpleBoundCosts&) = delete;
SimpleBoundCosts operator=(const SimpleBoundCosts&) = delete;
private:
std::vector<BoundCost> bound_costs_;
};
#endif // !defined SWIG
/// Dimensions represent quantities accumulated at nodes along the routes. They
/// represent quantities such as weights or volumes carried along the route, or
/// distance or times.
///
/// Quantities at a node are represented by "cumul" variables and the increase
/// or decrease of quantities between nodes are represented by "transit"
/// variables. These variables are linked as follows:
///
/// if j == next(i),
/// cumuls(j) = cumuls(i) + transits(i) + slacks(i) +
/// state_dependent_transits(i
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eSimpleBoundCosts\u003c/code\u003e stores soft bounds and violation constants for elements, with one \u003ccode\u003eBoundCost\u003c/code\u003e per element.\u003c/p\u003e\n"],["\u003cp\u003eIt's designed for shared use via pointers, thus disallowing copy and assignment to prevent unintended duplication.\u003c/p\u003e\n"],["\u003cp\u003eThe structure utilizes an array of structs for \u003ccode\u003ebound_costs_\u003c/code\u003e to enhance caching, as bound and cost are often used together.\u003c/p\u003e\n"],["\u003cp\u003eDirect element access through \u003ccode\u003eoperator[]\u003c/code\u003e is discouraged in favor of pointer-based access and the \u003ccode\u003ebound_cost\u003c/code\u003e methods for clarity and safety.\u003c/p\u003e\n"]]],["`SimpleBoundCosts` is a C++ structure for storing soft bounds and violation costs, designed for sharing via pointers and preventing accidental duplication. It stores one `BoundCost` per element in an array of structs for efficient caching, with soft bounds represented as named pairs. Copy and assignment operations are disabled. Key methods include `bound_cost`, for accessing `BoundCost` elements, and `Size` for retrieving the number of bounds. The constructor takes the number of bounds and a default `BoundCost`.\n"],null,["# SimpleBoundCosts\n\nC++ Reference: class SimpleBoundCosts\n=====================================\n\n\nNote: This documentation is automatically generated.\n\nA structure meant to store soft bounds and associated violation constants. It is 'Simple' because it has one BoundCost per element, in contrast to 'Multiple'. Design notes: \n- it is meant to store model information to be shared through pointers, so it disallows copy and assign to avoid accidental duplication. \n- it keeps soft bounds as an array of structs to help cache, because code that uses such bounds typically use both bound and cost. \n- soft bounds are named pairs, prevents some mistakes. \n- using operator\\[\\] to access elements is not interesting, because the structure will be accessed through pointers, moreover having to type bound_cost reminds the user of the order if they do a copy assignment of the element.\n\n| Method ||\n|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`bound_cost`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing.h#L2567) | Return type: `BoundCost& ` Arguments: `int element` \u003cbr /\u003e |\n| [`bound_cost`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing.h#L2568) | Return type: `BoundCost ` Arguments: `int element` \u003cbr /\u003e |\n| [`SimpleBoundCosts`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing.h#L2565) | \u003cbr /\u003e Arguments: `int num_bounds, BoundCost default_bound_cost` \u003cbr /\u003e |\n| [`SimpleBoundCosts`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing.h#L2570) | \u003cbr /\u003e Arguments: `const SimpleBoundCosts&) = delete; SimpleBoundCosts operator=(const SimpleBoundCosts&) = delete; private: std::vector\u003cBoundCost\u003e bound_costs_; }; #endif // !defined SWIG /// Dimensions represent quantities accumulated at nodes along the routes. They /// represent quantities such as weights or volumes carried along the route, or /// distance or times. /// /// Quantities at a node are represented by \"cumul\" variables and the increase /// or decrease of quantities between nodes are represented by \"transit\" /// variables. These variables are linked as follows: /// /// if j == next(i), /// cumuls(j) = cumuls(i) + transits(i) + slacks(i) + /// state_dependent_transits(i` \u003cbr /\u003e |\n| [`Size`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing.h#L2569) | Return type: `int ` \u003cbr /\u003e |"]]