Class RoutingModel.ResourceGroup
- java.lang.Object
-
- com.google.ortools.constraintsolver.RoutingModel.ResourceGroup
-
- Enclosing class:
- RoutingModel
public static class RoutingModel.ResourceGroup extends java.lang.ObjectA 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRoutingModel.ResourceGroup.AttributesAttributes for a dimension.static classRoutingModel.ResourceGroup.ResourceA Resource sets attributes (costs/constraints) for a set of dimensions.
-
Field Summary
Fields Modifier and Type Field Description protected booleanswigCMemOwn
-
Constructor Summary
Constructors Constructor Description ResourceGroup(long cPtr, boolean cMemoryOwn)ResourceGroup(RoutingModel model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intAddResource(RoutingModel.ResourceGroup.Attributes attributes, RoutingDimension dimension)Adds a Resource with the given attributes for the corresponding
dimension.voiddelete()protected voidfinalize()SWIGTYPE_p_absl__flat_hash_setT_operations_research__RoutingModel__DimensionIndex_tGetAffectedDimensionIndices()static longgetCPtr(RoutingModel.ResourceGroup obj)RoutingModel.ResourceGroup.ResourceGetResource(int resource_index)SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_tGetResources()int[]GetVehiclesRequiringAResource()voidNotifyVehicleRequiresAResource(int vehicle)Notifies that the given vehicle index requires a resource from this
group if the vehicle is used (i.e.intSize()static longswigRelease(RoutingModel.ResourceGroup obj)booleanVehicleRequiresAResource(int vehicle)
-
-
-
Constructor Detail
-
ResourceGroup
public ResourceGroup(long cPtr, boolean cMemoryOwn)
-
ResourceGroup
public ResourceGroup(RoutingModel model)
-
-
Method Detail
-
getCPtr
public static long getCPtr(RoutingModel.ResourceGroup obj)
-
swigRelease
public static long swigRelease(RoutingModel.ResourceGroup obj)
-
finalize
protected void finalize()
- Overrides:
finalizein classjava.lang.Object
-
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)
-
GetResources
public SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_t GetResources()
-
GetResource
public RoutingModel.ResourceGroup.Resource GetResource(int resource_index)
-
GetAffectedDimensionIndices
public SWIGTYPE_p_absl__flat_hash_setT_operations_research__RoutingModel__DimensionIndex_t GetAffectedDimensionIndices()
-
Size
public int Size()
-
-