Google OR-Tools: operations_research::RoutingModel::ResourceGroup Class Reference
A ResourceGroup defines a set of available Resources with attributes on one or multiple dimensions. For every ResourceGroup in the model, each (used) vehicle in the solution which requires a resource (see NotifyVehicleRequiresResource()) from this group must be assigned to exactly 1 resource, and each resource can in turn be assigned to at most 1 vehicle requiring it. This vehicle-to-resource assignment will apply the corresponding Attributes to the dimensions affected by the resource group. NOTE: As of 2021/07, each ResourceGroup can only affect a single RoutingDimension at a time, i.e. all Resources in a group must apply attributes to the same single dimension.
Definition at line 410 of file routing.h.
#include <routing.h>
◆ AddResource()
Adds a Resource with the given attributes for the corresponding dimension. Returns the index of the added resource in resources_.
Definition at line 1155 of file routing.cc.
◆ ClearAllowedResourcesForVehicle()
| void operations_research::RoutingModel::ResourceGroup::ClearAllowedResourcesForVehicle |
( |
int | vehicle | ) |
|
|
inline |
◆ GetAffectedDimensionIndices()
| const absl::flat_hash_set< DimensionIndex > & operations_research::RoutingModel::ResourceGroup::GetAffectedDimensionIndices |
( |
| ) |
const |
|
inline |
◆ GetDimensionAttributesForClass()
◆ GetResource()
| const Resource & operations_research::RoutingModel::ResourceGroup::GetResource |
( |
int | resource_index | ) |
const |
|
inline |
◆ GetResourceClassesCount()
| int operations_research::RoutingModel::ResourceGroup::GetResourceClassesCount |
( |
| ) |
const |
|
inline |
◆ GetResourceClassIndex()
| ResourceClassIndex operations_research::RoutingModel::ResourceGroup::GetResourceClassIndex |
( |
int | resource_index | ) |
const |
|
inline |
◆ GetResourceIndicesInClass()
| const std::vector< int > & operations_research::RoutingModel::ResourceGroup::GetResourceIndicesInClass |
( |
ResourceClassIndex | resource_class | ) |
const |
|
inline |
◆ GetResourceIndicesPerClass()
◆ GetResources()
| const std::vector< Resource > & operations_research::RoutingModel::ResourceGroup::GetResources |
( |
| ) |
const |
|
inline |
◆ GetResourcesMarkedAllowedForVehicle()
| const absl::flat_hash_set< int > & operations_research::RoutingModel::ResourceGroup::GetResourcesMarkedAllowedForVehicle |
( |
int | vehicle | ) |
const |
|
inline |
◆ GetVehiclesRequiringAResource()
| const std::vector< int > & operations_research::RoutingModel::ResourceGroup::GetVehiclesRequiringAResource |
( |
| ) |
const |
|
inline |
◆ Index()
| int operations_research::RoutingModel::ResourceGroup::Index |
( |
| ) |
const |
|
inline |
◆ IsResourceAllowedForVehicle()
| bool operations_research::RoutingModel::ResourceGroup::IsResourceAllowedForVehicle |
( |
int | resource, |
|
|
int | vehicle ) const |
|
inline |
◆ NotifyVehicleRequiresAResource()
| void operations_research::ResourceGroup::NotifyVehicleRequiresAResource |
( |
int | vehicle | ) |
|
Notifies that the given vehicle index requires a resource from this group if the vehicle is used (i.e. if its route is non-empty or vehicle_used_when_empty_[vehicle] is true).
Definition at line 1168 of file routing.cc.
◆ SetAllowedResourcesForVehicle()
| void operations_research::RoutingModel::ResourceGroup::SetAllowedResourcesForVehicle |
( |
int | vehicle, |
|
|
const std::vector< int > & | allowed_resource_indices ) |
|
inline |
◆ Size()
| int operations_research::RoutingModel::ResourceGroup::Size |
( |
| ) |
const |
|
inline |
◆ VehicleRequiresAResource()
| bool operations_research::RoutingModel::ResourceGroup::VehicleRequiresAResource |
( |
int | vehicle | ) |
const |
|
inline |
|
friend class RoutingModel
|
friend |
The documentation for this class was generated from the following files: