Class RoutingModel.ResourceGroup
java.lang.Object
com.google.ortools.constraintsolver.RoutingModel.ResourceGroup
- Enclosing class:
RoutingModel
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.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAttributes for a dimension.static classA Resource sets attributes (costs/constraints) for a set of dimensions. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAddResource(RoutingModel.ResourceGroup.Attributes attributes, RoutingDimension dimension) Adds a Resource with the given attributes for the corresponding
dimension.voidClearAllowedResourcesForVehicle(int vehicle) voiddelete()protected voidfinalize()static longGetDimensionAttributesForClass(RoutingDimension dimension, int rc_index) GetResource(int resource_index) intintGetResourceClassIndex(int resource_index) int[]GetResourceIndicesInClass(int resource_class) GetResourcesMarkedAllowedForVehicle(int vehicle) int[]intIndex()booleanIsResourceAllowedForVehicle(int resource, int vehicle) voidNotifyVehicleRequiresAResource(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).voidSetAllowedResourcesForVehicle(int vehicle, int[] allowed_resource_indices) intSize()static longbooleanVehicleRequiresAResource(int vehicle)
-
Field Details
-
swigCMemOwn
protected transient boolean swigCMemOwn
-
-
Constructor Details
-
ResourceGroup
public ResourceGroup(long cPtr, boolean cMemoryOwn)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
-
delete
public void delete() -
AddResource
public int AddResource(RoutingModel.ResourceGroup.Attributes attributes, RoutingDimension dimension) Adds a Resource with the given attributes for the corresponding
dimension. Returns the index of the added resource in resources_. -
NotifyVehicleRequiresAResource
public void 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). -
GetVehiclesRequiringAResource
public int[] GetVehiclesRequiringAResource() -
VehicleRequiresAResource
public boolean VehicleRequiresAResource(int vehicle) -
SetAllowedResourcesForVehicle
public void SetAllowedResourcesForVehicle(int vehicle, int[] allowed_resource_indices) -
ClearAllowedResourcesForVehicle
public void ClearAllowedResourcesForVehicle(int vehicle) -
GetResourcesMarkedAllowedForVehicle
-
IsResourceAllowedForVehicle
public boolean IsResourceAllowedForVehicle(int resource, int vehicle) -
GetResources
public SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_t GetResources() -
GetResource
-
GetAffectedDimensionIndices
-
GetResourceClassesCount
public int GetResourceClassesCount() -
GetResourceIndicesInClass
public int[] GetResourceIndicesInClass(int resource_class) -
GetResourceIndicesPerClass
public SWIGTYPE_p_util_intops__StrongVectorT_operations_research__RoutingModel__ResourceClassIndex_std__vectorT_int_t_t GetResourceIndicesPerClass() -
GetResourceClassIndex
public int GetResourceClassIndex(int resource_index) -
GetDimensionAttributesForClass
public RoutingModel.ResourceGroup.Attributes GetDimensionAttributesForClass(RoutingDimension dimension, int rc_index) -
Size
public int Size() -
Index
public int Index()
-