struct Google::Maps::RouteOptimization::ShipmentModel
- Google::Maps::RouteOptimization::ShipmentModel
- Struct
- Value
- Object
Included Modules
- Google::Resource
- JSON::Serializable
- MessagePack::Serializable
Extended Modules
- JSON::Schema
Defined in:
maps.crConstructors
Instance Method Summary
-
#duration_distance_matrices : Array(DurationDistanceMatrix)
Specifies duration and distance matrices used in the model.
-
#durationDistanceMatrixDstTags : Array(String)
Tags defining the destinations of the duration and distance matrices; durationDistanceMatrices(i).rows(j).durations(k) (resp.
-
#durationDistanceMatrixSrcTags : Array(String)
Tags defining the sources of the duration and distance matrices; durationDistanceMatrices(i).rows(j) defines durations and distances from visits with tag durationDistanceMatrixSrcTags(j) to other visits in matrix i.
-
#global_duration_cost_per_hour : Float64
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles.
-
#global_end_time : Time
If unset, 00:00:00 UTC, January 1, 1971 (i.e.
-
#global_start_time : Time
Global start and end time of the model: no times outside of this range can be considered valid.
-
#max_active_vehicles : Int64
Constrains the maximum number of active vehicles.
-
#precedence_rules : Array(PrecedenceRule)
Set of precedence rules which must be enforced in the model.
-
#shipment_type_incompatibilities : Array(ShipmentTypeIncompatibility)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility).
-
#shipment_type_requirements : Array(ShipmentTypeRequirement)
Sets of shipmentType requirements (see ShipmentTypeRequirement).
-
#shipments : Array(Shipment)
Set of shipments which must be performed in the model.
-
#transition_attributes : Array(TransitionAttributes)
Transition attributes added to the model.
-
#vehicles : Array(Vehicle)
Set of vehicles which can be used to perform visits.
Macros inherited from module Google::Resource
define(name, *fields)
define,
field(var, key = nil, **options, &block)
field,
field!(var, key = nil, **options, &block)
field!,
field?(var, key = nil, **options, &block)
field?
Constructor Detail
Instance Method Detail
Specifies duration and distance matrices used in the model. If this field is empty, Google Maps or geodesic distances will be used instead, depending on the value of the useGeodesicDistances field. If it is not empty, useGeodesicDistances cannot be true and neither durationDistanceMatrixSrcTags nor durationDistanceMatrixDstTags can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
model { vehicles { startTags: "locA" endTags: "locA" } shipments { pickups { tags: "locB" } } durationDistanceMatrixSrcTags: "locA" durationDistanceMatrixSrcTags: "locB" durationDistanceMatrixDstTags: "locA" durationDistanceMatrixDstTags: "locB" durationDistanceMatrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } } There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
model { vehicles { startTags: "locA" endTags: "locB" startTags: "fast" } vehicles { startTags: "locB" endTags: "locB" startTags: "slow" } vehicles { startTags: "locB" endTags: "locB" startTags: "fast" } shipments { pickups { tags: "locC" } } durationDistanceMatrixSrcTags: "locA" durationDistanceMatrixSrcTags: "locB" durationDistanceMatrixSrcTags: "locC" durationDistanceMatrixDstTags: "locB" durationDistanceMatrixDstTags: "locC" durationDistanceMatrices { vehicleStartTag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } durationDistanceMatrices { vehicleStartTag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
Tags defining the destinations of the duration and distance matrices; durationDistanceMatrices(i).rows(j).durations(k) (resp. durationDistanceMatrices(i).rows(j).meters(k)) defines the duration (resp. the distance) of the travel from visits with tag durationDistanceMatrixSrcTags(j) to visits with tag durationDistanceMatrixDstTags(k) in matrix i.
Tags correspond to VisitRequest.tags or Vehicle.start_tags. A given VisitRequest or Vehicle must match exactly one tag in this field. Note that a Vehicle's source, destination and matrix tags may be the same; similarly a VisitRequest's source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then durationDistanceMatrices must not be empty.
Tags defining the sources of the duration and distance matrices; durationDistanceMatrices(i).rows(j) defines durations and distances from visits with tag durationDistanceMatrixSrcTags(j) to other visits in matrix i.
Tags correspond to VisitRequest.tags or Vehicle.start_tags. A given VisitRequest or Vehicle must match exactly one tag in this field. Note that a Vehicle's source, destination and matrix tags may be the same; similarly a VisitRequest's source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then durationDistanceMatrices must not be empty.
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as Shipment.penalty_cost.
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
Global start and end time of the model: no times outside of this range can be considered valid.
The model's time span must be less than a year, i.e. the globalEndTime and the globalStartTime must be within 31536000 seconds of each other.
When using cost_per_*hour fields, you might want to set this window to a smaller interval to increase performance (eg. if you model a single day, you should set the global time limits to that day). If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used as default.
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive.
Set of precedence rules which must be enforced in the model.
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility).
Sets of shipmentType requirements (see ShipmentTypeRequirement).