nextbillionai 0.1.0.pre.alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +44 -0
- data/README.md +259 -0
- data/SECURITY.md +27 -0
- data/lib/nextbillionai/client.rb +168 -0
- data/lib/nextbillionai/errors.rb +214 -0
- data/lib/nextbillionai/file_part.rb +55 -0
- data/lib/nextbillionai/internal/transport/base_client.rb +573 -0
- data/lib/nextbillionai/internal/transport/pooled_net_requester.rb +209 -0
- data/lib/nextbillionai/internal/type/array_of.rb +167 -0
- data/lib/nextbillionai/internal/type/base_model.rb +539 -0
- data/lib/nextbillionai/internal/type/base_page.rb +55 -0
- data/lib/nextbillionai/internal/type/boolean.rb +77 -0
- data/lib/nextbillionai/internal/type/converter.rb +300 -0
- data/lib/nextbillionai/internal/type/enum.rb +156 -0
- data/lib/nextbillionai/internal/type/file_input.rb +108 -0
- data/lib/nextbillionai/internal/type/hash_of.rb +187 -0
- data/lib/nextbillionai/internal/type/request_parameters.rb +42 -0
- data/lib/nextbillionai/internal/type/union.rb +241 -0
- data/lib/nextbillionai/internal/type/unknown.rb +81 -0
- data/lib/nextbillionai/internal/util.rb +914 -0
- data/lib/nextbillionai/internal.rb +20 -0
- data/lib/nextbillionai/models/access.rb +27 -0
- data/lib/nextbillionai/models/address.rb +107 -0
- data/lib/nextbillionai/models/area_list_params.rb +26 -0
- data/lib/nextbillionai/models/area_list_response.rb +44 -0
- data/lib/nextbillionai/models/autocomplete_suggest_params.rb +99 -0
- data/lib/nextbillionai/models/autocomplete_suggest_response.rb +253 -0
- data/lib/nextbillionai/models/autosuggest_suggest_params.rb +99 -0
- data/lib/nextbillionai/models/autosuggest_suggest_response.rb +253 -0
- data/lib/nextbillionai/models/batch_create_params.rb +54 -0
- data/lib/nextbillionai/models/batch_create_response.rb +41 -0
- data/lib/nextbillionai/models/batch_retrieve_params.rb +35 -0
- data/lib/nextbillionai/models/batch_retrieve_response.rb +76 -0
- data/lib/nextbillionai/models/browse_search_params.rb +98 -0
- data/lib/nextbillionai/models/browse_search_response.rb +252 -0
- data/lib/nextbillionai/models/categories.rb +36 -0
- data/lib/nextbillionai/models/contact_object.rb +48 -0
- data/lib/nextbillionai/models/contacts.rb +47 -0
- data/lib/nextbillionai/models/direction_compute_route_params.rb +684 -0
- data/lib/nextbillionai/models/direction_compute_route_response.rb +629 -0
- data/lib/nextbillionai/models/discover_retrieve_params.rb +99 -0
- data/lib/nextbillionai/models/discover_retrieve_response.rb +253 -0
- data/lib/nextbillionai/models/distance_matrix/json_create_params.rb +16 -0
- data/lib/nextbillionai/models/distance_matrix/json_retrieve_params.rb +220 -0
- data/lib/nextbillionai/models/distance_matrix/json_retrieve_response.rb +82 -0
- data/lib/nextbillionai/models/fleetify/document_template_content_request.rb +189 -0
- data/lib/nextbillionai/models/fleetify/document_template_content_response.rb +168 -0
- data/lib/nextbillionai/models/fleetify/document_template_create_params.rb +50 -0
- data/lib/nextbillionai/models/fleetify/document_template_create_response.rb +79 -0
- data/lib/nextbillionai/models/fleetify/document_template_delete_params.rb +29 -0
- data/lib/nextbillionai/models/fleetify/document_template_delete_response.rb +32 -0
- data/lib/nextbillionai/models/fleetify/document_template_list_params.rb +28 -0
- data/lib/nextbillionai/models/fleetify/document_template_list_response.rb +85 -0
- data/lib/nextbillionai/models/fleetify/document_template_retrieve_params.rb +29 -0
- data/lib/nextbillionai/models/fleetify/document_template_retrieve_response.rb +80 -0
- data/lib/nextbillionai/models/fleetify/document_template_update_params.rb +50 -0
- data/lib/nextbillionai/models/fleetify/document_template_update_response.rb +78 -0
- data/lib/nextbillionai/models/fleetify/route_create_params.rb +276 -0
- data/lib/nextbillionai/models/fleetify/route_create_response.rb +196 -0
- data/lib/nextbillionai/models/fleetify/route_redispatch_params.rb +139 -0
- data/lib/nextbillionai/models/fleetify/route_redispatch_response.rb +432 -0
- data/lib/nextbillionai/models/fleetify/routes/document_submission.rb +12 -0
- data/lib/nextbillionai/models/fleetify/routes/route_step_completion_mode.rb +31 -0
- data/lib/nextbillionai/models/fleetify/routes/route_step_geofence_config.rb +53 -0
- data/lib/nextbillionai/models/fleetify/routes/route_steps_request.rb +174 -0
- data/lib/nextbillionai/models/fleetify/routes/route_steps_response.rb +273 -0
- data/lib/nextbillionai/models/fleetify/routes/step_complete_params.rb +69 -0
- data/lib/nextbillionai/models/fleetify/routes/step_create_params.rb +193 -0
- data/lib/nextbillionai/models/fleetify/routes/step_create_response.rb +40 -0
- data/lib/nextbillionai/models/fleetify/routes/step_delete_params.rb +37 -0
- data/lib/nextbillionai/models/fleetify/routes/step_delete_response.rb +33 -0
- data/lib/nextbillionai/models/fleetify/routes/step_update_params.rb +195 -0
- data/lib/nextbillionai/models/fleetify/routes/step_update_response.rb +40 -0
- data/lib/nextbillionai/models/fleetify/routing_response.rb +86 -0
- data/lib/nextbillionai/models/geocode_batch_create_params.rb +112 -0
- data/lib/nextbillionai/models/geocode_batch_create_response.rb +139 -0
- data/lib/nextbillionai/models/geocode_retrieve_params.rb +99 -0
- data/lib/nextbillionai/models/geocode_retrieve_response.rb +253 -0
- data/lib/nextbillionai/models/geocode_structured_retrieve_params.rb +132 -0
- data/lib/nextbillionai/models/geocode_structured_retrieve_response.rb +254 -0
- data/lib/nextbillionai/models/geofence/batch_create_params.rb +40 -0
- data/lib/nextbillionai/models/geofence/batch_create_response.rb +45 -0
- data/lib/nextbillionai/models/geofence/batch_delete_params.rb +37 -0
- data/lib/nextbillionai/models/geofence/batch_list_params.rb +36 -0
- data/lib/nextbillionai/models/geofence/batch_list_response.rb +47 -0
- data/lib/nextbillionai/models/geofence/console_preview_params.rb +16 -0
- data/lib/nextbillionai/models/geofence/console_preview_response.rb +41 -0
- data/lib/nextbillionai/models/geofence/console_search_params.rb +24 -0
- data/lib/nextbillionai/models/geofence/console_search_response.rb +62 -0
- data/lib/nextbillionai/models/geofence/polygon_geojson.rb +34 -0
- data/lib/nextbillionai/models/geofence.rb +202 -0
- data/lib/nextbillionai/models/geofence_contains_params.rb +56 -0
- data/lib/nextbillionai/models/geofence_contains_response.rb +99 -0
- data/lib/nextbillionai/models/geofence_create_params.rb +26 -0
- data/lib/nextbillionai/models/geofence_create_response.rb +49 -0
- data/lib/nextbillionai/models/geofence_delete_params.rb +26 -0
- data/lib/nextbillionai/models/geofence_entity_create.rb +328 -0
- data/lib/nextbillionai/models/geofence_list_params.rb +58 -0
- data/lib/nextbillionai/models/geofence_list_response.rb +52 -0
- data/lib/nextbillionai/models/geofence_retrieve_params.rb +26 -0
- data/lib/nextbillionai/models/geofence_retrieve_response.rb +41 -0
- data/lib/nextbillionai/models/geofence_update_params.rb +322 -0
- data/lib/nextbillionai/models/isochrone_compute_params.rb +153 -0
- data/lib/nextbillionai/models/isochrone_compute_response.rb +187 -0
- data/lib/nextbillionai/models/lookup_by_id_params.rb +35 -0
- data/lib/nextbillionai/models/lookup_by_id_response.rb +94 -0
- data/lib/nextbillionai/models/map_create_segment_params.rb +14 -0
- data/lib/nextbillionai/models/map_view.rb +43 -0
- data/lib/nextbillionai/models/mdm_create_distance_matrix_params.rb +385 -0
- data/lib/nextbillionai/models/mdm_create_distance_matrix_response.rb +50 -0
- data/lib/nextbillionai/models/mdm_get_distance_matrix_status_params.rb +35 -0
- data/lib/nextbillionai/models/mdm_get_distance_matrix_status_response.rb +64 -0
- data/lib/nextbillionai/models/multigeocode/place_create_params.rb +276 -0
- data/lib/nextbillionai/models/multigeocode/place_create_response.rb +24 -0
- data/lib/nextbillionai/models/multigeocode/place_delete_params.rb +28 -0
- data/lib/nextbillionai/models/multigeocode/place_delete_response.rb +31 -0
- data/lib/nextbillionai/models/multigeocode/place_item.rb +154 -0
- data/lib/nextbillionai/models/multigeocode/place_retrieve_params.rb +28 -0
- data/lib/nextbillionai/models/multigeocode/place_retrieve_response.rb +107 -0
- data/lib/nextbillionai/models/multigeocode/place_update_params.rb +118 -0
- data/lib/nextbillionai/models/multigeocode/place_update_response.rb +31 -0
- data/lib/nextbillionai/models/multigeocode_search_params.rb +135 -0
- data/lib/nextbillionai/models/multigeocode_search_response.rb +117 -0
- data/lib/nextbillionai/models/navigation_retrieve_route_params.rb +328 -0
- data/lib/nextbillionai/models/navigation_retrieve_route_response.rb +875 -0
- data/lib/nextbillionai/models/optimization/driver_assignment_assign_params.rb +679 -0
- data/lib/nextbillionai/models/optimization/driver_assignment_assign_response.rb +307 -0
- data/lib/nextbillionai/models/optimization/job.rb +460 -0
- data/lib/nextbillionai/models/optimization/location.rb +28 -0
- data/lib/nextbillionai/models/optimization/shipment.rb +589 -0
- data/lib/nextbillionai/models/optimization/v2_retrieve_result_params.rb +37 -0
- data/lib/nextbillionai/models/optimization/v2_retrieve_result_response.rb +743 -0
- data/lib/nextbillionai/models/optimization/v2_submit_params.rb +1841 -0
- data/lib/nextbillionai/models/optimization/vehicle.rb +92 -0
- data/lib/nextbillionai/models/optimization_compute_params.rb +212 -0
- data/lib/nextbillionai/models/optimization_compute_response.rb +347 -0
- data/lib/nextbillionai/models/optimization_re_optimize_params.rb +217 -0
- data/lib/nextbillionai/models/position.rb +26 -0
- data/lib/nextbillionai/models/post_response.rb +48 -0
- data/lib/nextbillionai/models/postalcode_retrieve_coordinates_params.rb +108 -0
- data/lib/nextbillionai/models/postalcode_retrieve_coordinates_response.rb +305 -0
- data/lib/nextbillionai/models/restriction_create_params.rb +51 -0
- data/lib/nextbillionai/models/restriction_delete_params.rb +26 -0
- data/lib/nextbillionai/models/restriction_delete_response.rb +25 -0
- data/lib/nextbillionai/models/restriction_list_by_bbox_params.rb +197 -0
- data/lib/nextbillionai/models/restriction_list_by_bbox_response.rb +9 -0
- data/lib/nextbillionai/models/restriction_list_params.rb +197 -0
- data/lib/nextbillionai/models/restriction_list_response.rb +62 -0
- data/lib/nextbillionai/models/restriction_retrieve_params.rb +34 -0
- data/lib/nextbillionai/models/restriction_set_state_params.rb +50 -0
- data/lib/nextbillionai/models/restriction_update_params.rb +37 -0
- data/lib/nextbillionai/models/restrictions_item_list_params.rb +123 -0
- data/lib/nextbillionai/models/restrictions_item_list_response.rb +171 -0
- data/lib/nextbillionai/models/revgeocode_retrieve_params.rb +77 -0
- data/lib/nextbillionai/models/revgeocode_retrieve_response.rb +253 -0
- data/lib/nextbillionai/models/rich_group_request.rb +292 -0
- data/lib/nextbillionai/models/rich_group_response.rb +249 -0
- data/lib/nextbillionai/models/route_report_create_params.rb +62 -0
- data/lib/nextbillionai/models/route_report_create_response.rb +452 -0
- data/lib/nextbillionai/models/skynet/asset/event_list_params.rb +96 -0
- data/lib/nextbillionai/models/skynet/asset/event_list_response.rb +361 -0
- data/lib/nextbillionai/models/skynet/asset/location_get_last_params.rb +48 -0
- data/lib/nextbillionai/models/skynet/asset/location_get_last_response.rb +65 -0
- data/lib/nextbillionai/models/skynet/asset/location_list_params.rb +130 -0
- data/lib/nextbillionai/models/skynet/asset/location_list_response.rb +242 -0
- data/lib/nextbillionai/models/skynet/asset/track_location.rb +124 -0
- data/lib/nextbillionai/models/skynet/asset_bind_params.rb +40 -0
- data/lib/nextbillionai/models/skynet/asset_create_params.rb +116 -0
- data/lib/nextbillionai/models/skynet/asset_create_response.rb +59 -0
- data/lib/nextbillionai/models/skynet/asset_delete_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/asset_details.rb +223 -0
- data/lib/nextbillionai/models/skynet/asset_list_params.rb +120 -0
- data/lib/nextbillionai/models/skynet/asset_list_response.rb +67 -0
- data/lib/nextbillionai/models/skynet/asset_retrieve_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/asset_retrieve_response.rb +55 -0
- data/lib/nextbillionai/models/skynet/asset_track_params.rb +184 -0
- data/lib/nextbillionai/models/skynet/asset_update_attributes_params.rb +48 -0
- data/lib/nextbillionai/models/skynet/asset_update_params.rb +104 -0
- data/lib/nextbillionai/models/skynet/config_retrieve_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/config_retrieve_response.rb +71 -0
- data/lib/nextbillionai/models/skynet/config_test_webhook_params.rb +28 -0
- data/lib/nextbillionai/models/skynet/config_test_webhook_response.rb +28 -0
- data/lib/nextbillionai/models/skynet/config_update_params.rb +55 -0
- data/lib/nextbillionai/models/skynet/meta_data.rb +10 -0
- data/lib/nextbillionai/models/skynet/metadata.rb +10 -0
- data/lib/nextbillionai/models/skynet/monitor.rb +291 -0
- data/lib/nextbillionai/models/skynet/monitor_create_params.rb +418 -0
- data/lib/nextbillionai/models/skynet/monitor_create_response.rb +55 -0
- data/lib/nextbillionai/models/skynet/monitor_delete_params.rb +28 -0
- data/lib/nextbillionai/models/skynet/monitor_list_params.rb +89 -0
- data/lib/nextbillionai/models/skynet/monitor_list_response.rb +68 -0
- data/lib/nextbillionai/models/skynet/monitor_retrieve_params.rb +28 -0
- data/lib/nextbillionai/models/skynet/monitor_retrieve_response.rb +54 -0
- data/lib/nextbillionai/models/skynet/monitor_update_params.rb +360 -0
- data/lib/nextbillionai/models/skynet/namespaced_apikey_create_params.rb +39 -0
- data/lib/nextbillionai/models/skynet/namespaced_apikey_create_response.rb +101 -0
- data/lib/nextbillionai/models/skynet/namespaced_apikey_delete_params.rb +50 -0
- data/lib/nextbillionai/models/skynet/namespaced_apikey_delete_response.rb +35 -0
- data/lib/nextbillionai/models/skynet/pagination.rb +50 -0
- data/lib/nextbillionai/models/skynet/search/polygon_create_params.rb +295 -0
- data/lib/nextbillionai/models/skynet/search/polygon_get_params.rb +190 -0
- data/lib/nextbillionai/models/skynet/search_around_params.rb +186 -0
- data/lib/nextbillionai/models/skynet/search_bound_params.rb +180 -0
- data/lib/nextbillionai/models/skynet/search_response.rb +207 -0
- data/lib/nextbillionai/models/skynet/simple_resp.rb +33 -0
- data/lib/nextbillionai/models/skynet/trip_delete_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/trip_end_params.rb +54 -0
- data/lib/nextbillionai/models/skynet/trip_get_summary_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/trip_get_summary_response.rb +226 -0
- data/lib/nextbillionai/models/skynet/trip_retrieve_params.rb +46 -0
- data/lib/nextbillionai/models/skynet/trip_retrieve_response.rb +188 -0
- data/lib/nextbillionai/models/skynet/trip_start_params.rb +154 -0
- data/lib/nextbillionai/models/skynet/trip_start_response.rb +57 -0
- data/lib/nextbillionai/models/skynet/trip_stop.rb +40 -0
- data/lib/nextbillionai/models/skynet/trip_update_params.rb +148 -0
- data/lib/nextbillionai/models/skynet_subscribe_params.rb +91 -0
- data/lib/nextbillionai/models/skynet_subscribe_response.rb +46 -0
- data/lib/nextbillionai/models/snap_to_road_snap_params.rb +247 -0
- data/lib/nextbillionai/models/snap_to_road_snap_response.rb +272 -0
- data/lib/nextbillionai/models.rb +158 -0
- data/lib/nextbillionai/request_options.rb +78 -0
- data/lib/nextbillionai/resources/areas.rb +39 -0
- data/lib/nextbillionai/resources/autocomplete.rb +49 -0
- data/lib/nextbillionai/resources/autosuggest.rb +49 -0
- data/lib/nextbillionai/resources/batch.rb +70 -0
- data/lib/nextbillionai/resources/browse.rb +49 -0
- data/lib/nextbillionai/resources/directions.rb +89 -0
- data/lib/nextbillionai/resources/discover.rb +49 -0
- data/lib/nextbillionai/resources/distance_matrix/json.rb +79 -0
- data/lib/nextbillionai/resources/distance_matrix.rb +18 -0
- data/lib/nextbillionai/resources/fleetify/document_templates.rb +163 -0
- data/lib/nextbillionai/resources/fleetify/routes/steps.rb +202 -0
- data/lib/nextbillionai/resources/fleetify/routes.rb +92 -0
- data/lib/nextbillionai/resources/fleetify.rb +22 -0
- data/lib/nextbillionai/resources/geocode.rb +127 -0
- data/lib/nextbillionai/resources/geofence/batch.rb +101 -0
- data/lib/nextbillionai/resources/geofence/console.rb +77 -0
- data/lib/nextbillionai/resources/geofence.rb +224 -0
- data/lib/nextbillionai/resources/isochrone.rb +59 -0
- data/lib/nextbillionai/resources/lookup.rb +41 -0
- data/lib/nextbillionai/resources/map.rb +32 -0
- data/lib/nextbillionai/resources/mdm.rb +100 -0
- data/lib/nextbillionai/resources/multigeocode/place.rb +165 -0
- data/lib/nextbillionai/resources/multigeocode.rb +70 -0
- data/lib/nextbillionai/resources/navigation.rb +72 -0
- data/lib/nextbillionai/resources/optimization/driver_assignment.rb +53 -0
- data/lib/nextbillionai/resources/optimization/v2.rb +100 -0
- data/lib/nextbillionai/resources/optimization.rb +110 -0
- data/lib/nextbillionai/resources/postalcode.rb +49 -0
- data/lib/nextbillionai/resources/restrictions.rb +325 -0
- data/lib/nextbillionai/resources/restrictions_items.rb +44 -0
- data/lib/nextbillionai/resources/revgeocode.rb +45 -0
- data/lib/nextbillionai/resources/route_report.rb +45 -0
- data/lib/nextbillionai/resources/skynet/asset/event.rb +57 -0
- data/lib/nextbillionai/resources/skynet/asset/location.rb +88 -0
- data/lib/nextbillionai/resources/skynet/asset.rb +303 -0
- data/lib/nextbillionai/resources/skynet/config.rb +99 -0
- data/lib/nextbillionai/resources/skynet/monitor.rb +206 -0
- data/lib/nextbillionai/resources/skynet/namespaced_apikeys.rb +72 -0
- data/lib/nextbillionai/resources/skynet/search/polygon.rb +106 -0
- data/lib/nextbillionai/resources/skynet/search.rb +114 -0
- data/lib/nextbillionai/resources/skynet/trip.rb +220 -0
- data/lib/nextbillionai/resources/skynet.rb +67 -0
- data/lib/nextbillionai/resources/snap_to_roads.rb +62 -0
- data/lib/nextbillionai/version.rb +5 -0
- data/lib/nextbillionai.rb +294 -0
- data/manifest.yaml +15 -0
- data/rbi/nextbillionai/client.rbi +121 -0
- data/rbi/nextbillionai/errors.rbi +178 -0
- data/rbi/nextbillionai/file_part.rbi +37 -0
- data/rbi/nextbillionai/internal/transport/base_client.rbi +301 -0
- data/rbi/nextbillionai/internal/transport/pooled_net_requester.rbi +80 -0
- data/rbi/nextbillionai/internal/type/array_of.rbi +104 -0
- data/rbi/nextbillionai/internal/type/base_model.rbi +310 -0
- data/rbi/nextbillionai/internal/type/base_page.rbi +43 -0
- data/rbi/nextbillionai/internal/type/boolean.rbi +58 -0
- data/rbi/nextbillionai/internal/type/converter.rbi +167 -0
- data/rbi/nextbillionai/internal/type/enum.rbi +82 -0
- data/rbi/nextbillionai/internal/type/file_input.rbi +59 -0
- data/rbi/nextbillionai/internal/type/hash_of.rbi +104 -0
- data/rbi/nextbillionai/internal/type/request_parameters.rbi +31 -0
- data/rbi/nextbillionai/internal/type/union.rbi +121 -0
- data/rbi/nextbillionai/internal/type/unknown.rbi +58 -0
- data/rbi/nextbillionai/internal/util.rbi +487 -0
- data/rbi/nextbillionai/internal.rbi +18 -0
- data/rbi/nextbillionai/models/access.rbi +41 -0
- data/rbi/nextbillionai/models/address.rbi +163 -0
- data/rbi/nextbillionai/models/area_list_params.rbi +42 -0
- data/rbi/nextbillionai/models/area_list_response.rbi +84 -0
- data/rbi/nextbillionai/models/autocomplete_suggest_params.rbi +166 -0
- data/rbi/nextbillionai/models/autocomplete_suggest_response.rbi +539 -0
- data/rbi/nextbillionai/models/autosuggest_suggest_params.rbi +166 -0
- data/rbi/nextbillionai/models/autosuggest_suggest_response.rbi +539 -0
- data/rbi/nextbillionai/models/batch_create_params.rbi +103 -0
- data/rbi/nextbillionai/models/batch_create_response.rbi +67 -0
- data/rbi/nextbillionai/models/batch_retrieve_params.rbi +58 -0
- data/rbi/nextbillionai/models/batch_retrieve_response.rbi +152 -0
- data/rbi/nextbillionai/models/browse_search_params.rbi +167 -0
- data/rbi/nextbillionai/models/browse_search_response.rbi +530 -0
- data/rbi/nextbillionai/models/categories.rbi +54 -0
- data/rbi/nextbillionai/models/contact_object.rbi +98 -0
- data/rbi/nextbillionai/models/contacts.rbi +87 -0
- data/rbi/nextbillionai/models/direction_compute_route_params.rbi +1442 -0
- data/rbi/nextbillionai/models/direction_compute_route_response.rbi +1364 -0
- data/rbi/nextbillionai/models/discover_retrieve_params.rbi +166 -0
- data/rbi/nextbillionai/models/discover_retrieve_response.rbi +539 -0
- data/rbi/nextbillionai/models/distance_matrix/json_create_params.rbi +34 -0
- data/rbi/nextbillionai/models/distance_matrix/json_retrieve_params.rbi +439 -0
- data/rbi/nextbillionai/models/distance_matrix/json_retrieve_response.rbi +202 -0
- data/rbi/nextbillionai/models/fleetify/document_template_content_request.rbi +379 -0
- data/rbi/nextbillionai/models/fleetify/document_template_content_response.rbi +330 -0
- data/rbi/nextbillionai/models/fleetify/document_template_create_params.rbi +80 -0
- data/rbi/nextbillionai/models/fleetify/document_template_create_response.rbi +168 -0
- data/rbi/nextbillionai/models/fleetify/document_template_delete_params.rbi +47 -0
- data/rbi/nextbillionai/models/fleetify/document_template_delete_response.rbi +46 -0
- data/rbi/nextbillionai/models/fleetify/document_template_list_params.rbi +47 -0
- data/rbi/nextbillionai/models/fleetify/document_template_list_response.rbi +185 -0
- data/rbi/nextbillionai/models/fleetify/document_template_retrieve_params.rbi +47 -0
- data/rbi/nextbillionai/models/fleetify/document_template_retrieve_response.rbi +170 -0
- data/rbi/nextbillionai/models/fleetify/document_template_update_params.rbi +95 -0
- data/rbi/nextbillionai/models/fleetify/document_template_update_response.rbi +166 -0
- data/rbi/nextbillionai/models/fleetify/route_create_params.rbi +595 -0
- data/rbi/nextbillionai/models/fleetify/route_create_response.rbi +360 -0
- data/rbi/nextbillionai/models/fleetify/route_redispatch_params.rbi +307 -0
- data/rbi/nextbillionai/models/fleetify/route_redispatch_response.rbi +810 -0
- data/rbi/nextbillionai/models/fleetify/routes/document_submission.rbi +12 -0
- data/rbi/nextbillionai/models/fleetify/routes/route_step_completion_mode.rbi +59 -0
- data/rbi/nextbillionai/models/fleetify/routes/route_step_geofence_config.rbi +111 -0
- data/rbi/nextbillionai/models/fleetify/routes/route_steps_request.rbi +362 -0
- data/rbi/nextbillionai/models/fleetify/routes/route_steps_response.rbi +538 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_complete_params.rbi +107 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_create_params.rbi +384 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_create_response.rbi +77 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_delete_params.rbi +58 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_delete_response.rbi +50 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_update_params.rbi +393 -0
- data/rbi/nextbillionai/models/fleetify/routes/step_update_response.rbi +77 -0
- data/rbi/nextbillionai/models/fleetify/routing_response.rbi +136 -0
- data/rbi/nextbillionai/models/geocode_batch_create_params.rbi +191 -0
- data/rbi/nextbillionai/models/geocode_batch_create_response.rbi +268 -0
- data/rbi/nextbillionai/models/geocode_retrieve_params.rbi +166 -0
- data/rbi/nextbillionai/models/geocode_retrieve_response.rbi +539 -0
- data/rbi/nextbillionai/models/geocode_structured_retrieve_params.rbi +207 -0
- data/rbi/nextbillionai/models/geocode_structured_retrieve_response.rbi +543 -0
- data/rbi/nextbillionai/models/geofence/batch_create_params.rbi +69 -0
- data/rbi/nextbillionai/models/geofence/batch_create_response.rbi +97 -0
- data/rbi/nextbillionai/models/geofence/batch_delete_params.rbi +63 -0
- data/rbi/nextbillionai/models/geofence/batch_list_params.rbi +58 -0
- data/rbi/nextbillionai/models/geofence/batch_list_response.rbi +96 -0
- data/rbi/nextbillionai/models/geofence/console_preview_params.rbi +34 -0
- data/rbi/nextbillionai/models/geofence/console_preview_response.rbi +104 -0
- data/rbi/nextbillionai/models/geofence/console_search_params.rbi +45 -0
- data/rbi/nextbillionai/models/geofence/console_search_response.rbi +138 -0
- data/rbi/nextbillionai/models/geofence/polygon_geojson.rbi +56 -0
- data/rbi/nextbillionai/models/geofence.rbi +326 -0
- data/rbi/nextbillionai/models/geofence_contains_params.rbi +90 -0
- data/rbi/nextbillionai/models/geofence_contains_response.rbi +255 -0
- data/rbi/nextbillionai/models/geofence_create_params.rbi +45 -0
- data/rbi/nextbillionai/models/geofence_create_response.rbi +97 -0
- data/rbi/nextbillionai/models/geofence_delete_params.rbi +45 -0
- data/rbi/nextbillionai/models/geofence_entity_create.rbi +603 -0
- data/rbi/nextbillionai/models/geofence_list_params.rbi +97 -0
- data/rbi/nextbillionai/models/geofence_list_response.rbi +111 -0
- data/rbi/nextbillionai/models/geofence_retrieve_params.rbi +45 -0
- data/rbi/nextbillionai/models/geofence_retrieve_response.rbi +96 -0
- data/rbi/nextbillionai/models/geofence_update_params.rbi +601 -0
- data/rbi/nextbillionai/models/isochrone_compute_params.rbi +248 -0
- data/rbi/nextbillionai/models/isochrone_compute_response.rbi +369 -0
- data/rbi/nextbillionai/models/lookup_by_id_params.rbi +58 -0
- data/rbi/nextbillionai/models/lookup_by_id_response.rbi +174 -0
- data/rbi/nextbillionai/models/map_create_segment_params.rbi +32 -0
- data/rbi/nextbillionai/models/map_view.rbi +70 -0
- data/rbi/nextbillionai/models/mdm_create_distance_matrix_params.rbi +868 -0
- data/rbi/nextbillionai/models/mdm_create_distance_matrix_response.rbi +88 -0
- data/rbi/nextbillionai/models/mdm_get_distance_matrix_status_params.rbi +58 -0
- data/rbi/nextbillionai/models/mdm_get_distance_matrix_status_response.rbi +141 -0
- data/rbi/nextbillionai/models/multigeocode/place_create_params.rbi +518 -0
- data/rbi/nextbillionai/models/multigeocode/place_create_response.rbi +39 -0
- data/rbi/nextbillionai/models/multigeocode/place_delete_params.rbi +47 -0
- data/rbi/nextbillionai/models/multigeocode/place_delete_response.rbi +46 -0
- data/rbi/nextbillionai/models/multigeocode/place_item.rbi +255 -0
- data/rbi/nextbillionai/models/multigeocode/place_retrieve_params.rbi +47 -0
- data/rbi/nextbillionai/models/multigeocode/place_retrieve_response.rbi +226 -0
- data/rbi/nextbillionai/models/multigeocode/place_update_params.rbi +245 -0
- data/rbi/nextbillionai/models/multigeocode/place_update_response.rbi +46 -0
- data/rbi/nextbillionai/models/multigeocode_search_params.rbi +205 -0
- data/rbi/nextbillionai/models/multigeocode_search_response.rbi +277 -0
- data/rbi/nextbillionai/models/navigation_retrieve_route_params.rbi +692 -0
- data/rbi/nextbillionai/models/navigation_retrieve_route_response.rbi +1894 -0
- data/rbi/nextbillionai/models/optimization/driver_assignment_assign_params.rbi +1306 -0
- data/rbi/nextbillionai/models/optimization/driver_assignment_assign_response.rbi +720 -0
- data/rbi/nextbillionai/models/optimization/job.rbi +798 -0
- data/rbi/nextbillionai/models/optimization/location.rbi +39 -0
- data/rbi/nextbillionai/models/optimization/shipment.rbi +1030 -0
- data/rbi/nextbillionai/models/optimization/v2_retrieve_result_params.rbi +60 -0
- data/rbi/nextbillionai/models/optimization/v2_retrieve_result_response.rbi +1318 -0
- data/rbi/nextbillionai/models/optimization/v2_submit_params.rbi +3695 -0
- data/rbi/nextbillionai/models/optimization/vehicle.rbi +168 -0
- data/rbi/nextbillionai/models/optimization_compute_params.rbi +453 -0
- data/rbi/nextbillionai/models/optimization_compute_response.rbi +885 -0
- data/rbi/nextbillionai/models/optimization_re_optimize_params.rbi +439 -0
- data/rbi/nextbillionai/models/position.rbi +40 -0
- data/rbi/nextbillionai/models/post_response.rbi +81 -0
- data/rbi/nextbillionai/models/postalcode_retrieve_coordinates_params.rbi +211 -0
- data/rbi/nextbillionai/models/postalcode_retrieve_coordinates_response.rbi +661 -0
- data/rbi/nextbillionai/models/restriction_create_params.rbi +119 -0
- data/rbi/nextbillionai/models/restriction_delete_params.rbi +45 -0
- data/rbi/nextbillionai/models/restriction_delete_response.rbi +42 -0
- data/rbi/nextbillionai/models/restriction_list_by_bbox_params.rbi +447 -0
- data/rbi/nextbillionai/models/restriction_list_by_bbox_response.rbi +13 -0
- data/rbi/nextbillionai/models/restriction_list_params.rbi +414 -0
- data/rbi/nextbillionai/models/restriction_list_response.rbi +120 -0
- data/rbi/nextbillionai/models/restriction_retrieve_params.rbi +59 -0
- data/rbi/nextbillionai/models/restriction_set_state_params.rbi +99 -0
- data/rbi/nextbillionai/models/restriction_update_params.rbi +65 -0
- data/rbi/nextbillionai/models/restrictions_item_list_params.rbi +325 -0
- data/rbi/nextbillionai/models/restrictions_item_list_response.rbi +436 -0
- data/rbi/nextbillionai/models/revgeocode_retrieve_params.rbi +132 -0
- data/rbi/nextbillionai/models/revgeocode_retrieve_response.rbi +539 -0
- data/rbi/nextbillionai/models/rich_group_request.rbi +507 -0
- data/rbi/nextbillionai/models/rich_group_response.rbi +464 -0
- data/rbi/nextbillionai/models/route_report_create_params.rbi +121 -0
- data/rbi/nextbillionai/models/route_report_create_response.rbi +982 -0
- data/rbi/nextbillionai/models/skynet/asset/event_list_params.rbi +177 -0
- data/rbi/nextbillionai/models/skynet/asset/event_list_response.rbi +721 -0
- data/rbi/nextbillionai/models/skynet/asset/location_get_last_params.rbi +106 -0
- data/rbi/nextbillionai/models/skynet/asset/location_get_last_response.rbi +136 -0
- data/rbi/nextbillionai/models/skynet/asset/location_list_params.rbi +265 -0
- data/rbi/nextbillionai/models/skynet/asset/location_list_response.rbi +503 -0
- data/rbi/nextbillionai/models/skynet/asset/track_location.rbi +209 -0
- data/rbi/nextbillionai/models/skynet/asset_bind_params.rbi +66 -0
- data/rbi/nextbillionai/models/skynet/asset_create_params.rbi +208 -0
- data/rbi/nextbillionai/models/skynet/asset_create_response.rbi +114 -0
- data/rbi/nextbillionai/models/skynet/asset_delete_params.rbi +100 -0
- data/rbi/nextbillionai/models/skynet/asset_details.rbi +387 -0
- data/rbi/nextbillionai/models/skynet/asset_list_params.rbi +213 -0
- data/rbi/nextbillionai/models/skynet/asset_list_response.rbi +140 -0
- data/rbi/nextbillionai/models/skynet/asset_retrieve_params.rbi +101 -0
- data/rbi/nextbillionai/models/skynet/asset_retrieve_response.rbi +122 -0
- data/rbi/nextbillionai/models/skynet/asset_track_params.rbi +329 -0
- data/rbi/nextbillionai/models/skynet/asset_update_attributes_params.rbi +82 -0
- data/rbi/nextbillionai/models/skynet/asset_update_params.rbi +189 -0
- data/rbi/nextbillionai/models/skynet/config_retrieve_params.rbi +104 -0
- data/rbi/nextbillionai/models/skynet/config_retrieve_response.rbi +163 -0
- data/rbi/nextbillionai/models/skynet/config_test_webhook_params.rbi +47 -0
- data/rbi/nextbillionai/models/skynet/config_test_webhook_response.rbi +47 -0
- data/rbi/nextbillionai/models/skynet/config_update_params.rbi +114 -0
- data/rbi/nextbillionai/models/skynet/meta_data.rbi +9 -0
- data/rbi/nextbillionai/models/skynet/metadata.rbi +9 -0
- data/rbi/nextbillionai/models/skynet/monitor.rbi +568 -0
- data/rbi/nextbillionai/models/skynet/monitor_create_params.rbi +792 -0
- data/rbi/nextbillionai/models/skynet/monitor_create_response.rbi +114 -0
- data/rbi/nextbillionai/models/skynet/monitor_delete_params.rbi +47 -0
- data/rbi/nextbillionai/models/skynet/monitor_list_params.rbi +166 -0
- data/rbi/nextbillionai/models/skynet/monitor_list_response.rbi +143 -0
- data/rbi/nextbillionai/models/skynet/monitor_retrieve_params.rbi +47 -0
- data/rbi/nextbillionai/models/skynet/monitor_retrieve_response.rbi +119 -0
- data/rbi/nextbillionai/models/skynet/monitor_update_params.rbi +690 -0
- data/rbi/nextbillionai/models/skynet/namespaced_apikey_create_params.rbi +64 -0
- data/rbi/nextbillionai/models/skynet/namespaced_apikey_create_response.rbi +182 -0
- data/rbi/nextbillionai/models/skynet/namespaced_apikey_delete_params.rbi +78 -0
- data/rbi/nextbillionai/models/skynet/namespaced_apikey_delete_response.rbi +52 -0
- data/rbi/nextbillionai/models/skynet/pagination.rbi +84 -0
- data/rbi/nextbillionai/models/skynet/search/polygon_create_params.rbi +583 -0
- data/rbi/nextbillionai/models/skynet/search/polygon_get_params.rbi +358 -0
- data/rbi/nextbillionai/models/skynet/search_around_params.rbi +346 -0
- data/rbi/nextbillionai/models/skynet/search_bound_params.rbi +341 -0
- data/rbi/nextbillionai/models/skynet/search_response.rbi +390 -0
- data/rbi/nextbillionai/models/skynet/simple_resp.rbi +52 -0
- data/rbi/nextbillionai/models/skynet/trip_delete_params.rbi +99 -0
- data/rbi/nextbillionai/models/skynet/trip_end_params.rbi +104 -0
- data/rbi/nextbillionai/models/skynet/trip_get_summary_params.rbi +104 -0
- data/rbi/nextbillionai/models/skynet/trip_get_summary_response.rbi +414 -0
- data/rbi/nextbillionai/models/skynet/trip_retrieve_params.rbi +101 -0
- data/rbi/nextbillionai/models/skynet/trip_retrieve_response.rbi +354 -0
- data/rbi/nextbillionai/models/skynet/trip_start_params.rbi +279 -0
- data/rbi/nextbillionai/models/skynet/trip_start_response.rbi +112 -0
- data/rbi/nextbillionai/models/skynet/trip_stop.rbi +69 -0
- data/rbi/nextbillionai/models/skynet/trip_update_params.rbi +274 -0
- data/rbi/nextbillionai/models/skynet_subscribe_params.rbi +170 -0
- data/rbi/nextbillionai/models/skynet_subscribe_response.rbi +75 -0
- data/rbi/nextbillionai/models/snap_to_road_snap_params.rbi +492 -0
- data/rbi/nextbillionai/models/snap_to_road_snap_response.rbi +546 -0
- data/rbi/nextbillionai/models.rbi +125 -0
- data/rbi/nextbillionai/request_options.rbi +59 -0
- data/rbi/nextbillionai/resources/areas.rbi +27 -0
- data/rbi/nextbillionai/resources/autocomplete.rbi +75 -0
- data/rbi/nextbillionai/resources/autosuggest.rbi +75 -0
- data/rbi/nextbillionai/resources/batch.rbi +50 -0
- data/rbi/nextbillionai/resources/browse.rbi +74 -0
- data/rbi/nextbillionai/resources/directions.rbi +320 -0
- data/rbi/nextbillionai/resources/discover.rbi +75 -0
- data/rbi/nextbillionai/resources/distance_matrix/json.rbi +129 -0
- data/rbi/nextbillionai/resources/distance_matrix.rbi +15 -0
- data/rbi/nextbillionai/resources/fleetify/document_templates.rbi +130 -0
- data/rbi/nextbillionai/resources/fleetify/routes/steps.rbi +270 -0
- data/rbi/nextbillionai/resources/fleetify/routes.rbi +114 -0
- data/rbi/nextbillionai/resources/fleetify.rbi +18 -0
- data/rbi/nextbillionai/resources/geocode.rbi +164 -0
- data/rbi/nextbillionai/resources/geofence/batch.rbi +70 -0
- data/rbi/nextbillionai/resources/geofence/console.rbi +89 -0
- data/rbi/nextbillionai/resources/geofence.rbi +249 -0
- data/rbi/nextbillionai/resources/isochrone.rbi +89 -0
- data/rbi/nextbillionai/resources/lookup.rbi +31 -0
- data/rbi/nextbillionai/resources/map.rbi +19 -0
- data/rbi/nextbillionai/resources/mdm.rbi +182 -0
- data/rbi/nextbillionai/resources/multigeocode/place.rbi +155 -0
- data/rbi/nextbillionai/resources/multigeocode.rbi +73 -0
- data/rbi/nextbillionai/resources/navigation.rbi +152 -0
- data/rbi/nextbillionai/resources/optimization/driver_assignment.rbi +54 -0
- data/rbi/nextbillionai/resources/optimization/v2.rbi +217 -0
- data/rbi/nextbillionai/resources/optimization.rbi +165 -0
- data/rbi/nextbillionai/resources/postalcode.rbi +54 -0
- data/rbi/nextbillionai/resources/restrictions.rbi +487 -0
- data/rbi/nextbillionai/resources/restrictions_items.rbi +46 -0
- data/rbi/nextbillionai/resources/revgeocode.rbi +63 -0
- data/rbi/nextbillionai/resources/route_report.rbi +41 -0
- data/rbi/nextbillionai/resources/skynet/asset/event.rbi +64 -0
- data/rbi/nextbillionai/resources/skynet/asset/location.rbi +106 -0
- data/rbi/nextbillionai/resources/skynet/asset.rbi +336 -0
- data/rbi/nextbillionai/resources/skynet/config.rbi +71 -0
- data/rbi/nextbillionai/resources/skynet/monitor.rbi +305 -0
- data/rbi/nextbillionai/resources/skynet/namespaced_apikeys.rbi +66 -0
- data/rbi/nextbillionai/resources/skynet/search/polygon.rbi +175 -0
- data/rbi/nextbillionai/resources/skynet/search.rbi +191 -0
- data/rbi/nextbillionai/resources/skynet/trip.rbi +210 -0
- data/rbi/nextbillionai/resources/skynet.rbi +60 -0
- data/rbi/nextbillionai/resources/snap_to_roads.rbi +103 -0
- data/rbi/nextbillionai/version.rbi +5 -0
- data/sig/nextbillionai/client.rbs +74 -0
- data/sig/nextbillionai/errors.rbs +110 -0
- data/sig/nextbillionai/file_part.rbs +21 -0
- data/sig/nextbillionai/internal/transport/base_client.rbs +131 -0
- data/sig/nextbillionai/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/nextbillionai/internal/type/array_of.rbs +48 -0
- data/sig/nextbillionai/internal/type/base_model.rbs +104 -0
- data/sig/nextbillionai/internal/type/base_page.rbs +24 -0
- data/sig/nextbillionai/internal/type/boolean.rbs +26 -0
- data/sig/nextbillionai/internal/type/converter.rbs +62 -0
- data/sig/nextbillionai/internal/type/enum.rbs +32 -0
- data/sig/nextbillionai/internal/type/file_input.rbs +25 -0
- data/sig/nextbillionai/internal/type/hash_of.rbs +48 -0
- data/sig/nextbillionai/internal/type/request_parameters.rbs +19 -0
- data/sig/nextbillionai/internal/type/union.rbs +52 -0
- data/sig/nextbillionai/internal/type/unknown.rbs +26 -0
- data/sig/nextbillionai/internal/util.rbs +185 -0
- data/sig/nextbillionai/internal.rbs +10 -0
- data/sig/nextbillionai/models/access.rbs +19 -0
- data/sig/nextbillionai/models/address.rbs +92 -0
- data/sig/nextbillionai/models/area_list_params.rbs +23 -0
- data/sig/nextbillionai/models/area_list_response.rbs +43 -0
- data/sig/nextbillionai/models/autocomplete_suggest_params.rbs +59 -0
- data/sig/nextbillionai/models/autocomplete_suggest_response.rbs +236 -0
- data/sig/nextbillionai/models/autosuggest_suggest_params.rbs +59 -0
- data/sig/nextbillionai/models/autosuggest_suggest_response.rbs +236 -0
- data/sig/nextbillionai/models/batch_create_params.rbs +47 -0
- data/sig/nextbillionai/models/batch_create_response.rbs +24 -0
- data/sig/nextbillionai/models/batch_retrieve_params.rbs +28 -0
- data/sig/nextbillionai/models/batch_retrieve_response.rbs +61 -0
- data/sig/nextbillionai/models/browse_search_params.rbs +61 -0
- data/sig/nextbillionai/models/browse_search_response.rbs +234 -0
- data/sig/nextbillionai/models/categories.rbs +23 -0
- data/sig/nextbillionai/models/contact_object.rbs +50 -0
- data/sig/nextbillionai/models/contacts.rbs +69 -0
- data/sig/nextbillionai/models/direction_compute_route_params.rbs +391 -0
- data/sig/nextbillionai/models/direction_compute_route_response.rbs +554 -0
- data/sig/nextbillionai/models/discover_retrieve_params.rbs +59 -0
- data/sig/nextbillionai/models/discover_retrieve_response.rbs +234 -0
- data/sig/nextbillionai/models/distance_matrix/json_create_params.rbs +17 -0
- data/sig/nextbillionai/models/distance_matrix/json_retrieve_params.rbs +114 -0
- data/sig/nextbillionai/models/distance_matrix/json_retrieve_response.rbs +77 -0
- data/sig/nextbillionai/models/fleetify/document_template_content_request.rbs +148 -0
- data/sig/nextbillionai/models/fleetify/document_template_content_response.rbs +135 -0
- data/sig/nextbillionai/models/fleetify/document_template_create_params.rbs +38 -0
- data/sig/nextbillionai/models/fleetify/document_template_create_response.rbs +75 -0
- data/sig/nextbillionai/models/fleetify/document_template_delete_params.rbs +25 -0
- data/sig/nextbillionai/models/fleetify/document_template_delete_response.rbs +21 -0
- data/sig/nextbillionai/models/fleetify/document_template_list_params.rbs +25 -0
- data/sig/nextbillionai/models/fleetify/document_template_list_response.rbs +75 -0
- data/sig/nextbillionai/models/fleetify/document_template_retrieve_params.rbs +25 -0
- data/sig/nextbillionai/models/fleetify/document_template_retrieve_response.rbs +75 -0
- data/sig/nextbillionai/models/fleetify/document_template_update_params.rbs +44 -0
- data/sig/nextbillionai/models/fleetify/document_template_update_response.rbs +75 -0
- data/sig/nextbillionai/models/fleetify/route_create_params.rbs +199 -0
- data/sig/nextbillionai/models/fleetify/route_create_response.rbs +159 -0
- data/sig/nextbillionai/models/fleetify/route_redispatch_params.rbs +118 -0
- data/sig/nextbillionai/models/fleetify/route_redispatch_response.rbs +359 -0
- data/sig/nextbillionai/models/fleetify/routes/document_submission.rbs +9 -0
- data/sig/nextbillionai/models/fleetify/routes/route_step_completion_mode.rbs +22 -0
- data/sig/nextbillionai/models/fleetify/routes/route_step_geofence_config.rbs +47 -0
- data/sig/nextbillionai/models/fleetify/routes/route_steps_request.rbs +134 -0
- data/sig/nextbillionai/models/fleetify/routes/route_steps_response.rbs +223 -0
- data/sig/nextbillionai/models/fleetify/routes/step_complete_params.rbs +56 -0
- data/sig/nextbillionai/models/fleetify/routes/step_create_params.rbs +148 -0
- data/sig/nextbillionai/models/fleetify/routes/step_create_response.rbs +42 -0
- data/sig/nextbillionai/models/fleetify/routes/step_delete_params.rbs +32 -0
- data/sig/nextbillionai/models/fleetify/routes/step_delete_response.rbs +23 -0
- data/sig/nextbillionai/models/fleetify/routes/step_update_params.rbs +159 -0
- data/sig/nextbillionai/models/fleetify/routes/step_update_response.rbs +42 -0
- data/sig/nextbillionai/models/fleetify/routing_response.rbs +66 -0
- data/sig/nextbillionai/models/geocode_batch_create_params.rbs +70 -0
- data/sig/nextbillionai/models/geocode_batch_create_response.rbs +128 -0
- data/sig/nextbillionai/models/geocode_retrieve_params.rbs +59 -0
- data/sig/nextbillionai/models/geocode_retrieve_response.rbs +234 -0
- data/sig/nextbillionai/models/geocode_structured_retrieve_params.rbs +94 -0
- data/sig/nextbillionai/models/geocode_structured_retrieve_response.rbs +236 -0
- data/sig/nextbillionai/models/geofence/batch_create_params.rbs +34 -0
- data/sig/nextbillionai/models/geofence/batch_create_response.rbs +45 -0
- data/sig/nextbillionai/models/geofence/batch_delete_params.rbs +32 -0
- data/sig/nextbillionai/models/geofence/batch_list_params.rbs +30 -0
- data/sig/nextbillionai/models/geofence/batch_list_response.rbs +37 -0
- data/sig/nextbillionai/models/geofence/console_preview_params.rbs +17 -0
- data/sig/nextbillionai/models/geofence/console_preview_response.rbs +49 -0
- data/sig/nextbillionai/models/geofence/console_search_params.rbs +25 -0
- data/sig/nextbillionai/models/geofence/console_search_response.rbs +56 -0
- data/sig/nextbillionai/models/geofence/polygon_geojson.rbs +25 -0
- data/sig/nextbillionai/models/geofence.rbs +161 -0
- data/sig/nextbillionai/models/geofence_contains_params.rbs +40 -0
- data/sig/nextbillionai/models/geofence_contains_response.rbs +105 -0
- data/sig/nextbillionai/models/geofence_create_params.rbs +25 -0
- data/sig/nextbillionai/models/geofence_create_response.rbs +43 -0
- data/sig/nextbillionai/models/geofence_delete_params.rbs +23 -0
- data/sig/nextbillionai/models/geofence_entity_create.rbs +216 -0
- data/sig/nextbillionai/models/geofence_list_params.rbs +42 -0
- data/sig/nextbillionai/models/geofence_list_response.rbs +61 -0
- data/sig/nextbillionai/models/geofence_retrieve_params.rbs +23 -0
- data/sig/nextbillionai/models/geofence_retrieve_response.rbs +45 -0
- data/sig/nextbillionai/models/geofence_update_params.rbs +227 -0
- data/sig/nextbillionai/models/isochrone_compute_params.rbs +96 -0
- data/sig/nextbillionai/models/isochrone_compute_response.rbs +159 -0
- data/sig/nextbillionai/models/lookup_by_id_params.rbs +28 -0
- data/sig/nextbillionai/models/lookup_by_id_response.rbs +94 -0
- data/sig/nextbillionai/models/map_create_segment_params.rbs +15 -0
- data/sig/nextbillionai/models/map_view.rbs +37 -0
- data/sig/nextbillionai/models/mdm_create_distance_matrix_params.rbs +270 -0
- data/sig/nextbillionai/models/mdm_create_distance_matrix_response.rbs +43 -0
- data/sig/nextbillionai/models/mdm_get_distance_matrix_status_params.rbs +28 -0
- data/sig/nextbillionai/models/mdm_get_distance_matrix_status_response.rbs +57 -0
- data/sig/nextbillionai/models/multigeocode/place_create_params.rbs +226 -0
- data/sig/nextbillionai/models/multigeocode/place_create_response.rbs +17 -0
- data/sig/nextbillionai/models/multigeocode/place_delete_params.rbs +25 -0
- data/sig/nextbillionai/models/multigeocode/place_delete_response.rbs +21 -0
- data/sig/nextbillionai/models/multigeocode/place_item.rbs +133 -0
- data/sig/nextbillionai/models/multigeocode/place_retrieve_params.rbs +25 -0
- data/sig/nextbillionai/models/multigeocode/place_retrieve_response.rbs +95 -0
- data/sig/nextbillionai/models/multigeocode/place_update_params.rbs +99 -0
- data/sig/nextbillionai/models/multigeocode/place_update_response.rbs +21 -0
- data/sig/nextbillionai/models/multigeocode_search_params.rbs +104 -0
- data/sig/nextbillionai/models/multigeocode_search_response.rbs +114 -0
- data/sig/nextbillionai/models/navigation_retrieve_route_params.rbs +206 -0
- data/sig/nextbillionai/models/navigation_retrieve_route_response.rbs +812 -0
- data/sig/nextbillionai/models/optimization/driver_assignment_assign_params.rbs +412 -0
- data/sig/nextbillionai/models/optimization/driver_assignment_assign_response.rbs +281 -0
- data/sig/nextbillionai/models/optimization/job.rbs +225 -0
- data/sig/nextbillionai/models/optimization/location.rbs +17 -0
- data/sig/nextbillionai/models/optimization/shipment.rbs +313 -0
- data/sig/nextbillionai/models/optimization/v2_retrieve_result_params.rbs +30 -0
- data/sig/nextbillionai/models/optimization/v2_retrieve_result_response.rbs +555 -0
- data/sig/nextbillionai/models/optimization/v2_submit_params.rbs +1138 -0
- data/sig/nextbillionai/models/optimization/vehicle.rbs +66 -0
- data/sig/nextbillionai/models/optimization_compute_params.rbs +146 -0
- data/sig/nextbillionai/models/optimization_compute_response.rbs +386 -0
- data/sig/nextbillionai/models/optimization_re_optimize_params.rbs +176 -0
- data/sig/nextbillionai/models/position.rbs +19 -0
- data/sig/nextbillionai/models/post_response.rbs +38 -0
- data/sig/nextbillionai/models/postalcode_retrieve_coordinates_params.rbs +84 -0
- data/sig/nextbillionai/models/postalcode_retrieve_coordinates_response.rbs +260 -0
- data/sig/nextbillionai/models/restriction_create_params.rbs +48 -0
- data/sig/nextbillionai/models/restriction_delete_params.rbs +23 -0
- data/sig/nextbillionai/models/restriction_delete_response.rbs +19 -0
- data/sig/nextbillionai/models/restriction_list_by_bbox_params.rbs +162 -0
- data/sig/nextbillionai/models/restriction_list_by_bbox_response.rbs +8 -0
- data/sig/nextbillionai/models/restriction_list_params.rbs +164 -0
- data/sig/nextbillionai/models/restriction_list_response.rbs +57 -0
- data/sig/nextbillionai/models/restriction_retrieve_params.rbs +30 -0
- data/sig/nextbillionai/models/restriction_set_state_params.rbs +43 -0
- data/sig/nextbillionai/models/restriction_update_params.rbs +32 -0
- data/sig/nextbillionai/models/restrictions_item_list_params.rbs +145 -0
- data/sig/nextbillionai/models/restrictions_item_list_response.rbs +166 -0
- data/sig/nextbillionai/models/revgeocode_retrieve_params.rbs +40 -0
- data/sig/nextbillionai/models/revgeocode_retrieve_response.rbs +236 -0
- data/sig/nextbillionai/models/rich_group_request.rbs +207 -0
- data/sig/nextbillionai/models/rich_group_response.rbs +207 -0
- data/sig/nextbillionai/models/route_report_create_params.rbs +47 -0
- data/sig/nextbillionai/models/route_report_create_response.rbs +408 -0
- data/sig/nextbillionai/models/skynet/asset/event_list_params.rbs +84 -0
- data/sig/nextbillionai/models/skynet/asset/event_list_response.rbs +303 -0
- data/sig/nextbillionai/models/skynet/asset/location_get_last_params.rbs +49 -0
- data/sig/nextbillionai/models/skynet/asset/location_get_last_response.rbs +60 -0
- data/sig/nextbillionai/models/skynet/asset/location_list_params.rbs +105 -0
- data/sig/nextbillionai/models/skynet/asset/location_list_response.rbs +216 -0
- data/sig/nextbillionai/models/skynet/asset/track_location.rbs +100 -0
- data/sig/nextbillionai/models/skynet/asset_bind_params.rbs +30 -0
- data/sig/nextbillionai/models/skynet/asset_create_params.rbs +89 -0
- data/sig/nextbillionai/models/skynet/asset_create_response.rbs +52 -0
- data/sig/nextbillionai/models/skynet/asset_delete_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/asset_details.rbs +175 -0
- data/sig/nextbillionai/models/skynet/asset_list_params.rbs +89 -0
- data/sig/nextbillionai/models/skynet/asset_list_response.rbs +70 -0
- data/sig/nextbillionai/models/skynet/asset_retrieve_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/asset_retrieve_response.rbs +54 -0
- data/sig/nextbillionai/models/skynet/asset_track_params.rbs +140 -0
- data/sig/nextbillionai/models/skynet/asset_update_attributes_params.rbs +30 -0
- data/sig/nextbillionai/models/skynet/asset_update_params.rbs +82 -0
- data/sig/nextbillionai/models/skynet/config_retrieve_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/config_retrieve_response.rbs +73 -0
- data/sig/nextbillionai/models/skynet/config_test_webhook_params.rbs +25 -0
- data/sig/nextbillionai/models/skynet/config_test_webhook_response.rbs +17 -0
- data/sig/nextbillionai/models/skynet/config_update_params.rbs +54 -0
- data/sig/nextbillionai/models/skynet/meta_data.rbs +7 -0
- data/sig/nextbillionai/models/skynet/metadata.rbs +7 -0
- data/sig/nextbillionai/models/skynet/monitor.rbs +220 -0
- data/sig/nextbillionai/models/skynet/monitor_create_params.rbs +226 -0
- data/sig/nextbillionai/models/skynet/monitor_create_response.rbs +52 -0
- data/sig/nextbillionai/models/skynet/monitor_delete_params.rbs +25 -0
- data/sig/nextbillionai/models/skynet/monitor_list_params.rbs +75 -0
- data/sig/nextbillionai/models/skynet/monitor_list_response.rbs +70 -0
- data/sig/nextbillionai/models/skynet/monitor_retrieve_params.rbs +25 -0
- data/sig/nextbillionai/models/skynet/monitor_retrieve_response.rbs +56 -0
- data/sig/nextbillionai/models/skynet/monitor_update_params.rbs +206 -0
- data/sig/nextbillionai/models/skynet/namespaced_apikey_create_params.rbs +30 -0
- data/sig/nextbillionai/models/skynet/namespaced_apikey_create_response.rbs +94 -0
- data/sig/nextbillionai/models/skynet/namespaced_apikey_delete_params.rbs +34 -0
- data/sig/nextbillionai/models/skynet/namespaced_apikey_delete_response.rbs +21 -0
- data/sig/nextbillionai/models/skynet/pagination.rbs +40 -0
- data/sig/nextbillionai/models/skynet/search/polygon_create_params.rbs +193 -0
- data/sig/nextbillionai/models/skynet/search/polygon_get_params.rbs +125 -0
- data/sig/nextbillionai/models/skynet/search_around_params.rbs +128 -0
- data/sig/nextbillionai/models/skynet/search_bound_params.rbs +123 -0
- data/sig/nextbillionai/models/skynet/search_response.rbs +185 -0
- data/sig/nextbillionai/models/skynet/simple_resp.rbs +21 -0
- data/sig/nextbillionai/models/skynet/trip_delete_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/trip_end_params.rbs +52 -0
- data/sig/nextbillionai/models/skynet/trip_get_summary_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/trip_get_summary_response.rbs +198 -0
- data/sig/nextbillionai/models/skynet/trip_retrieve_params.rbs +47 -0
- data/sig/nextbillionai/models/skynet/trip_retrieve_response.rbs +168 -0
- data/sig/nextbillionai/models/skynet/trip_start_params.rbs +120 -0
- data/sig/nextbillionai/models/skynet/trip_start_response.rbs +52 -0
- data/sig/nextbillionai/models/skynet/trip_stop.rbs +29 -0
- data/sig/nextbillionai/models/skynet/trip_update_params.rbs +113 -0
- data/sig/nextbillionai/models/skynet_subscribe_params.rbs +64 -0
- data/sig/nextbillionai/models/skynet_subscribe_response.rbs +38 -0
- data/sig/nextbillionai/models/snap_to_road_snap_params.rbs +173 -0
- data/sig/nextbillionai/models/snap_to_road_snap_response.rbs +215 -0
- data/sig/nextbillionai/models.rbs +115 -0
- data/sig/nextbillionai/request_options.rbs +36 -0
- data/sig/nextbillionai/resources/areas.rbs +12 -0
- data/sig/nextbillionai/resources/autocomplete.rbs +17 -0
- data/sig/nextbillionai/resources/autosuggest.rbs +17 -0
- data/sig/nextbillionai/resources/batch.rbs +19 -0
- data/sig/nextbillionai/resources/browse.rbs +17 -0
- data/sig/nextbillionai/resources/directions.rbs +37 -0
- data/sig/nextbillionai/resources/discover.rbs +17 -0
- data/sig/nextbillionai/resources/distance_matrix/json.rbs +23 -0
- data/sig/nextbillionai/resources/distance_matrix.rbs +9 -0
- data/sig/nextbillionai/resources/fleetify/document_templates.rbs +41 -0
- data/sig/nextbillionai/resources/fleetify/routes/steps.rbs +61 -0
- data/sig/nextbillionai/resources/fleetify/routes.rbs +30 -0
- data/sig/nextbillionai/resources/fleetify.rbs +11 -0
- data/sig/nextbillionai/resources/geocode.rbs +38 -0
- data/sig/nextbillionai/resources/geofence/batch.rbs +27 -0
- data/sig/nextbillionai/resources/geofence/console.rbs +26 -0
- data/sig/nextbillionai/resources/geofence.rbs +65 -0
- data/sig/nextbillionai/resources/isochrone.rbs +21 -0
- data/sig/nextbillionai/resources/lookup.rbs +13 -0
- data/sig/nextbillionai/resources/map.rbs +9 -0
- data/sig/nextbillionai/resources/mdm.rbs +34 -0
- data/sig/nextbillionai/resources/multigeocode/place.rbs +39 -0
- data/sig/nextbillionai/resources/multigeocode.rbs +24 -0
- data/sig/nextbillionai/resources/navigation.rbs +26 -0
- data/sig/nextbillionai/resources/optimization/driver_assignment.rbs +18 -0
- data/sig/nextbillionai/resources/optimization/v2.rbs +35 -0
- data/sig/nextbillionai/resources/optimization.rbs +34 -0
- data/sig/nextbillionai/resources/postalcode.rbs +16 -0
- data/sig/nextbillionai/resources/restrictions.rbs +107 -0
- data/sig/nextbillionai/resources/restrictions_items.rbs +21 -0
- data/sig/nextbillionai/resources/revgeocode.rbs +15 -0
- data/sig/nextbillionai/resources/route_report.rbs +14 -0
- data/sig/nextbillionai/resources/skynet/asset/event.rbs +23 -0
- data/sig/nextbillionai/resources/skynet/asset/location.rbs +31 -0
- data/sig/nextbillionai/resources/skynet/asset.rbs +86 -0
- data/sig/nextbillionai/resources/skynet/config.rbs +27 -0
- data/sig/nextbillionai/resources/skynet/monitor.rbs +64 -0
- data/sig/nextbillionai/resources/skynet/namespaced_apikeys.rbs +22 -0
- data/sig/nextbillionai/resources/skynet/search/polygon.rbs +38 -0
- data/sig/nextbillionai/resources/skynet/search.rbs +42 -0
- data/sig/nextbillionai/resources/skynet/trip.rbs +63 -0
- data/sig/nextbillionai/resources/skynet.rbs +26 -0
- data/sig/nextbillionai/resources/snap_to_roads.rbs +22 -0
- data/sig/nextbillionai/version.rbs +3 -0
- metadata +851 -0
|
@@ -0,0 +1,3695 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Nextbillionai
|
|
4
|
+
module Models
|
|
5
|
+
module Optimization
|
|
6
|
+
class V2SubmitParams < Nextbillionai::Internal::Type::BaseModel
|
|
7
|
+
extend Nextbillionai::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Nextbillionai::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Nextbillionai::Optimization::V2SubmitParams,
|
|
14
|
+
Nextbillionai::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# A key is a unique identifier that is required to authenticate a request to the
|
|
19
|
+
# API.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :key
|
|
22
|
+
|
|
23
|
+
# The locations object is used to define all the locations that will be used
|
|
24
|
+
# during the optimization process. Read more about this attribute in the
|
|
25
|
+
# [Location Object](#location-object) section.
|
|
26
|
+
sig { returns(Nextbillionai::Optimization::V2SubmitParams::Locations) }
|
|
27
|
+
attr_reader :locations
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
locations:
|
|
32
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::OrHash
|
|
33
|
+
).void
|
|
34
|
+
end
|
|
35
|
+
attr_writer :locations
|
|
36
|
+
|
|
37
|
+
# The vehicles attribute describes the characteristics and constraints of the
|
|
38
|
+
# vehicles that will be used for fulfilling the tasks. Read more about this
|
|
39
|
+
# attribute in the [Vehicle Object](#vehicle-object) section.
|
|
40
|
+
sig { returns(T::Array[Nextbillionai::Optimization::Vehicle]) }
|
|
41
|
+
attr_accessor :vehicles
|
|
42
|
+
|
|
43
|
+
# An array of arrays to denote the user-defined costs of traveling between each
|
|
44
|
+
# pair of geographic coordinates mentioned in the location array. The number of
|
|
45
|
+
# arrays should be equal to the number of coordinate points mentioned in the
|
|
46
|
+
# location array and each array should contain the same number of elements as
|
|
47
|
+
# well. Please note that cost_matrix is effective only when
|
|
48
|
+
# travel_cost=customized. Read more about this attribute in the
|
|
49
|
+
# [Custom Cost Matrix](#custom-cost-matrix) section.
|
|
50
|
+
sig { returns(T.nilable(T::Array[T::Array[Integer]])) }
|
|
51
|
+
attr_reader :cost_matrix
|
|
52
|
+
|
|
53
|
+
sig { params(cost_matrix: T::Array[T::Array[Integer]]).void }
|
|
54
|
+
attr_writer :cost_matrix
|
|
55
|
+
|
|
56
|
+
# depots object is used to collect the details of a depot. Depots can be used as a
|
|
57
|
+
# starting point and/or ending point for the routes and vehicles. They also can be
|
|
58
|
+
# used to fulfil pickup and delivery typejobs . The loads which are to be
|
|
59
|
+
# delivered at task locations will be picked from depots and loads picked-up from
|
|
60
|
+
# task locations will be delivered back to the depots. A depot can be configured
|
|
61
|
+
# using the following fields:
|
|
62
|
+
sig do
|
|
63
|
+
returns(
|
|
64
|
+
T.nilable(
|
|
65
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Depot]
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
attr_reader :depots
|
|
70
|
+
|
|
71
|
+
sig do
|
|
72
|
+
params(
|
|
73
|
+
depots:
|
|
74
|
+
T::Array[
|
|
75
|
+
Nextbillionai::Optimization::V2SubmitParams::Depot::OrHash
|
|
76
|
+
]
|
|
77
|
+
).void
|
|
78
|
+
end
|
|
79
|
+
attr_writer :depots
|
|
80
|
+
|
|
81
|
+
# Define the optimization job using any custom message. This description is
|
|
82
|
+
# returned as is in the response.
|
|
83
|
+
sig { returns(T.nilable(String)) }
|
|
84
|
+
attr_reader :description
|
|
85
|
+
|
|
86
|
+
sig { params(description: String).void }
|
|
87
|
+
attr_writer :description
|
|
88
|
+
|
|
89
|
+
# An array of arrays to denote the user-defined distances, in meters, for
|
|
90
|
+
# travelling between each pair of geographic coordinates mentioned in the location
|
|
91
|
+
# array. When this input is provided, actual distances between the locations will
|
|
92
|
+
# be ignored in favor of the values provided in this input for any distance
|
|
93
|
+
# calculations during the optimization process. The values provided here will also
|
|
94
|
+
# be used for cost calculations when travel_cost is “distance”.
|
|
95
|
+
#
|
|
96
|
+
# The number of arrays in the input should be equal to the number of coordinate
|
|
97
|
+
# points mentioned in the location array and each array, in turn, should contain
|
|
98
|
+
# the same number of elements as well.
|
|
99
|
+
#
|
|
100
|
+
# **Note:**
|
|
101
|
+
#
|
|
102
|
+
# - duration_matrix is mandatory when usingdistance_matrix.
|
|
103
|
+
# - When using distance_matrix route geometry will not be available in the
|
|
104
|
+
# optimized solution.
|
|
105
|
+
sig { returns(T.nilable(T::Array[T::Array[Integer]])) }
|
|
106
|
+
attr_reader :distance_matrix
|
|
107
|
+
|
|
108
|
+
sig { params(distance_matrix: T::Array[T::Array[Integer]]).void }
|
|
109
|
+
attr_writer :distance_matrix
|
|
110
|
+
|
|
111
|
+
# An array of arrays to denote the user-defined durations, in seconds, for
|
|
112
|
+
# travelling between each pair of geographic coordinates mentioned in the location
|
|
113
|
+
# array. When this input is provided, actual durations between the locations will
|
|
114
|
+
# be ignored in favor of the values provided in the matrix for any ETA
|
|
115
|
+
# calculations during the optimization process. The values provided in the matrix
|
|
116
|
+
# will also be used for cost calculations when travel_cost is “duration”.
|
|
117
|
+
#
|
|
118
|
+
# The number of arrays in the input should be equal to the number of coordinate
|
|
119
|
+
# points mentioned in the location array and each array, in turn, should contain
|
|
120
|
+
# the same number of elements as well.
|
|
121
|
+
#
|
|
122
|
+
# Please note that, unlike distance_matrix, duration_matrix can be used
|
|
123
|
+
# independently in following cases:
|
|
124
|
+
#
|
|
125
|
+
# - when travel_cost is “duration”
|
|
126
|
+
# - when travel_cost is “customized” and a cost_matrix is provided
|
|
127
|
+
#
|
|
128
|
+
# Also, the route geometry will not be available in the optimized solution when
|
|
129
|
+
# using duration_matrix.
|
|
130
|
+
sig { returns(T.nilable(T::Array[T::Array[Integer]])) }
|
|
131
|
+
attr_reader :duration_matrix
|
|
132
|
+
|
|
133
|
+
sig { params(duration_matrix: T::Array[T::Array[Integer]]).void }
|
|
134
|
+
attr_writer :duration_matrix
|
|
135
|
+
|
|
136
|
+
# The previous optimization request id used to retrieve solution for
|
|
137
|
+
# reoptimization
|
|
138
|
+
sig { returns(T.nilable(String)) }
|
|
139
|
+
attr_reader :existing_solution_id
|
|
140
|
+
|
|
141
|
+
sig { params(existing_solution_id: String).void }
|
|
142
|
+
attr_writer :existing_solution_id
|
|
143
|
+
|
|
144
|
+
# jobs object is used to collect the details of a particular job or task that
|
|
145
|
+
# needs to be completed as part of the optimization process. Each job can have
|
|
146
|
+
# either a pickup or delivery step, but not both. Read more about this attribute
|
|
147
|
+
# in the [Job Object](#job-object) section.
|
|
148
|
+
#
|
|
149
|
+
# Please note that either the jobs or the shipments attribute should be specified
|
|
150
|
+
# to build a valid request.
|
|
151
|
+
sig { returns(T.nilable(T::Array[Nextbillionai::Optimization::Job])) }
|
|
152
|
+
attr_reader :jobs
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
params(jobs: T::Array[Nextbillionai::Optimization::Job::OrHash]).void
|
|
156
|
+
end
|
|
157
|
+
attr_writer :jobs
|
|
158
|
+
|
|
159
|
+
# It represents the set of options that can be used to configure optimization
|
|
160
|
+
# algorithms so that the solver provides a solution that meets the desired
|
|
161
|
+
# business objectives.
|
|
162
|
+
sig do
|
|
163
|
+
returns(
|
|
164
|
+
T.nilable(Nextbillionai::Optimization::V2SubmitParams::Options)
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
attr_reader :options
|
|
168
|
+
|
|
169
|
+
sig do
|
|
170
|
+
params(
|
|
171
|
+
options:
|
|
172
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::OrHash
|
|
173
|
+
).void
|
|
174
|
+
end
|
|
175
|
+
attr_writer :options
|
|
176
|
+
|
|
177
|
+
# relations attribute is an array of individual relation objects. type parameter
|
|
178
|
+
# and steps object are mandatory when using this attribute.
|
|
179
|
+
#
|
|
180
|
+
# Please note:
|
|
181
|
+
#
|
|
182
|
+
# - The soft constraints are **not** effective when using the relations attribute.
|
|
183
|
+
# - In case a given relation can't be satisfied, the optimizer will flag all the
|
|
184
|
+
# tasks involved in that "relation" as unassigned.
|
|
185
|
+
#
|
|
186
|
+
# Read more about this attribute in the [Relations Object](#relations-object)
|
|
187
|
+
# section.
|
|
188
|
+
sig do
|
|
189
|
+
returns(
|
|
190
|
+
T.nilable(
|
|
191
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Relation]
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
end
|
|
195
|
+
attr_reader :relations
|
|
196
|
+
|
|
197
|
+
sig do
|
|
198
|
+
params(
|
|
199
|
+
relations:
|
|
200
|
+
T::Array[
|
|
201
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::OrHash
|
|
202
|
+
]
|
|
203
|
+
).void
|
|
204
|
+
end
|
|
205
|
+
attr_writer :relations
|
|
206
|
+
|
|
207
|
+
# The shipments object is used to collect the details of shipments that need to be
|
|
208
|
+
# completed as part of the optimization process.
|
|
209
|
+
#
|
|
210
|
+
# Each shipment should have a pickup and the corresponding delivery step.
|
|
211
|
+
#
|
|
212
|
+
# Please note that either the jobs or the shipments attribute should be specified
|
|
213
|
+
# to build a valid request.
|
|
214
|
+
sig do
|
|
215
|
+
returns(T.nilable(T::Array[Nextbillionai::Optimization::Shipment]))
|
|
216
|
+
end
|
|
217
|
+
attr_reader :shipments
|
|
218
|
+
|
|
219
|
+
sig do
|
|
220
|
+
params(
|
|
221
|
+
shipments: T::Array[Nextbillionai::Optimization::Shipment::OrHash]
|
|
222
|
+
).void
|
|
223
|
+
end
|
|
224
|
+
attr_writer :shipments
|
|
225
|
+
|
|
226
|
+
# This attribute is related to the re-optimization feature. It allows for the
|
|
227
|
+
# previous optimization result to be provided in case new orders are received and
|
|
228
|
+
# the solution needs to be re-planned. The solution attribute should contain the
|
|
229
|
+
# same routes as the previous optimization result. solution attribute is an array
|
|
230
|
+
# of objects with each object corresponding to one route.
|
|
231
|
+
sig do
|
|
232
|
+
returns(
|
|
233
|
+
T.nilable(
|
|
234
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Solution]
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
end
|
|
238
|
+
attr_reader :solution
|
|
239
|
+
|
|
240
|
+
sig do
|
|
241
|
+
params(
|
|
242
|
+
solution:
|
|
243
|
+
T::Array[
|
|
244
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::OrHash
|
|
245
|
+
]
|
|
246
|
+
).void
|
|
247
|
+
end
|
|
248
|
+
attr_writer :solution
|
|
249
|
+
|
|
250
|
+
# unassigned attribute is related to the re-optimization feature. This attribute
|
|
251
|
+
# should contain the tasks that were not assigned during an earlier optimization
|
|
252
|
+
# process. Please note that the unassigned part in request should be consistent
|
|
253
|
+
# with the unassigned part in the previous optimization result.
|
|
254
|
+
#
|
|
255
|
+
# Users can reduce the number of unassigned tasks in the re-optimized solution, by
|
|
256
|
+
# following strategies such as:
|
|
257
|
+
#
|
|
258
|
+
# - Extending the time windows for vehicles or tasks to give more flexibility
|
|
259
|
+
# - Adding more vehicles to the optimization problem
|
|
260
|
+
# - Adjusting the priority of different tasks to balance the workload more evenly
|
|
261
|
+
# - Modifying other constraints or parameters to make the problem more solvable
|
|
262
|
+
#
|
|
263
|
+
# Ultimately, the goal is to minimize the number of unassigned tasks while still
|
|
264
|
+
# meeting all the necessary constraints and objectives.
|
|
265
|
+
sig do
|
|
266
|
+
returns(
|
|
267
|
+
T.nilable(Nextbillionai::Optimization::V2SubmitParams::Unassigned)
|
|
268
|
+
)
|
|
269
|
+
end
|
|
270
|
+
attr_reader :unassigned
|
|
271
|
+
|
|
272
|
+
sig do
|
|
273
|
+
params(
|
|
274
|
+
unassigned:
|
|
275
|
+
Nextbillionai::Optimization::V2SubmitParams::Unassigned::OrHash
|
|
276
|
+
).void
|
|
277
|
+
end
|
|
278
|
+
attr_writer :unassigned
|
|
279
|
+
|
|
280
|
+
# An array of objects to specify geometry of all the zones involved. Each object
|
|
281
|
+
# corresponds to a single zone. A valid zone can be a
|
|
282
|
+
# [geoJSON](https://datatracker.ietf.org/doc/html/rfc7946#page-9) polygon,
|
|
283
|
+
# multi-polygon or a geofence created using
|
|
284
|
+
# [NextBillion.ai](http://NextBillion.ai)’s
|
|
285
|
+
# [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence).
|
|
286
|
+
#
|
|
287
|
+
# Please note that
|
|
288
|
+
#
|
|
289
|
+
# - Each zone should have a geometry specified either throughgeometry or through
|
|
290
|
+
# the geofence_id parameter.
|
|
291
|
+
# - When zone IDs are not provided for individual tasks (jobs or shipments) then
|
|
292
|
+
# the API will automatically allocate zones based on the task’s geolocation and
|
|
293
|
+
# the geometries of the zones provided here. Otherwise, if the zone IDs are
|
|
294
|
+
# provided while configuring individual tasks, the zone IDs will override the
|
|
295
|
+
# geometries provided here.
|
|
296
|
+
sig do
|
|
297
|
+
returns(
|
|
298
|
+
T.nilable(
|
|
299
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Zone]
|
|
300
|
+
)
|
|
301
|
+
)
|
|
302
|
+
end
|
|
303
|
+
attr_reader :zones
|
|
304
|
+
|
|
305
|
+
sig do
|
|
306
|
+
params(
|
|
307
|
+
zones:
|
|
308
|
+
T::Array[
|
|
309
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::OrHash
|
|
310
|
+
]
|
|
311
|
+
).void
|
|
312
|
+
end
|
|
313
|
+
attr_writer :zones
|
|
314
|
+
|
|
315
|
+
sig do
|
|
316
|
+
params(
|
|
317
|
+
key: String,
|
|
318
|
+
locations:
|
|
319
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::OrHash,
|
|
320
|
+
vehicles: T::Array[Nextbillionai::Optimization::Vehicle::OrHash],
|
|
321
|
+
cost_matrix: T::Array[T::Array[Integer]],
|
|
322
|
+
depots:
|
|
323
|
+
T::Array[
|
|
324
|
+
Nextbillionai::Optimization::V2SubmitParams::Depot::OrHash
|
|
325
|
+
],
|
|
326
|
+
description: String,
|
|
327
|
+
distance_matrix: T::Array[T::Array[Integer]],
|
|
328
|
+
duration_matrix: T::Array[T::Array[Integer]],
|
|
329
|
+
existing_solution_id: String,
|
|
330
|
+
jobs: T::Array[Nextbillionai::Optimization::Job::OrHash],
|
|
331
|
+
options:
|
|
332
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::OrHash,
|
|
333
|
+
relations:
|
|
334
|
+
T::Array[
|
|
335
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::OrHash
|
|
336
|
+
],
|
|
337
|
+
shipments: T::Array[Nextbillionai::Optimization::Shipment::OrHash],
|
|
338
|
+
solution:
|
|
339
|
+
T::Array[
|
|
340
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::OrHash
|
|
341
|
+
],
|
|
342
|
+
unassigned:
|
|
343
|
+
Nextbillionai::Optimization::V2SubmitParams::Unassigned::OrHash,
|
|
344
|
+
zones:
|
|
345
|
+
T::Array[
|
|
346
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::OrHash
|
|
347
|
+
],
|
|
348
|
+
request_options: Nextbillionai::RequestOptions::OrHash
|
|
349
|
+
).returns(T.attached_class)
|
|
350
|
+
end
|
|
351
|
+
def self.new(
|
|
352
|
+
# A key is a unique identifier that is required to authenticate a request to the
|
|
353
|
+
# API.
|
|
354
|
+
key:,
|
|
355
|
+
# The locations object is used to define all the locations that will be used
|
|
356
|
+
# during the optimization process. Read more about this attribute in the
|
|
357
|
+
# [Location Object](#location-object) section.
|
|
358
|
+
locations:,
|
|
359
|
+
# The vehicles attribute describes the characteristics and constraints of the
|
|
360
|
+
# vehicles that will be used for fulfilling the tasks. Read more about this
|
|
361
|
+
# attribute in the [Vehicle Object](#vehicle-object) section.
|
|
362
|
+
vehicles:,
|
|
363
|
+
# An array of arrays to denote the user-defined costs of traveling between each
|
|
364
|
+
# pair of geographic coordinates mentioned in the location array. The number of
|
|
365
|
+
# arrays should be equal to the number of coordinate points mentioned in the
|
|
366
|
+
# location array and each array should contain the same number of elements as
|
|
367
|
+
# well. Please note that cost_matrix is effective only when
|
|
368
|
+
# travel_cost=customized. Read more about this attribute in the
|
|
369
|
+
# [Custom Cost Matrix](#custom-cost-matrix) section.
|
|
370
|
+
cost_matrix: nil,
|
|
371
|
+
# depots object is used to collect the details of a depot. Depots can be used as a
|
|
372
|
+
# starting point and/or ending point for the routes and vehicles. They also can be
|
|
373
|
+
# used to fulfil pickup and delivery typejobs . The loads which are to be
|
|
374
|
+
# delivered at task locations will be picked from depots and loads picked-up from
|
|
375
|
+
# task locations will be delivered back to the depots. A depot can be configured
|
|
376
|
+
# using the following fields:
|
|
377
|
+
depots: nil,
|
|
378
|
+
# Define the optimization job using any custom message. This description is
|
|
379
|
+
# returned as is in the response.
|
|
380
|
+
description: nil,
|
|
381
|
+
# An array of arrays to denote the user-defined distances, in meters, for
|
|
382
|
+
# travelling between each pair of geographic coordinates mentioned in the location
|
|
383
|
+
# array. When this input is provided, actual distances between the locations will
|
|
384
|
+
# be ignored in favor of the values provided in this input for any distance
|
|
385
|
+
# calculations during the optimization process. The values provided here will also
|
|
386
|
+
# be used for cost calculations when travel_cost is “distance”.
|
|
387
|
+
#
|
|
388
|
+
# The number of arrays in the input should be equal to the number of coordinate
|
|
389
|
+
# points mentioned in the location array and each array, in turn, should contain
|
|
390
|
+
# the same number of elements as well.
|
|
391
|
+
#
|
|
392
|
+
# **Note:**
|
|
393
|
+
#
|
|
394
|
+
# - duration_matrix is mandatory when usingdistance_matrix.
|
|
395
|
+
# - When using distance_matrix route geometry will not be available in the
|
|
396
|
+
# optimized solution.
|
|
397
|
+
distance_matrix: nil,
|
|
398
|
+
# An array of arrays to denote the user-defined durations, in seconds, for
|
|
399
|
+
# travelling between each pair of geographic coordinates mentioned in the location
|
|
400
|
+
# array. When this input is provided, actual durations between the locations will
|
|
401
|
+
# be ignored in favor of the values provided in the matrix for any ETA
|
|
402
|
+
# calculations during the optimization process. The values provided in the matrix
|
|
403
|
+
# will also be used for cost calculations when travel_cost is “duration”.
|
|
404
|
+
#
|
|
405
|
+
# The number of arrays in the input should be equal to the number of coordinate
|
|
406
|
+
# points mentioned in the location array and each array, in turn, should contain
|
|
407
|
+
# the same number of elements as well.
|
|
408
|
+
#
|
|
409
|
+
# Please note that, unlike distance_matrix, duration_matrix can be used
|
|
410
|
+
# independently in following cases:
|
|
411
|
+
#
|
|
412
|
+
# - when travel_cost is “duration”
|
|
413
|
+
# - when travel_cost is “customized” and a cost_matrix is provided
|
|
414
|
+
#
|
|
415
|
+
# Also, the route geometry will not be available in the optimized solution when
|
|
416
|
+
# using duration_matrix.
|
|
417
|
+
duration_matrix: nil,
|
|
418
|
+
# The previous optimization request id used to retrieve solution for
|
|
419
|
+
# reoptimization
|
|
420
|
+
existing_solution_id: nil,
|
|
421
|
+
# jobs object is used to collect the details of a particular job or task that
|
|
422
|
+
# needs to be completed as part of the optimization process. Each job can have
|
|
423
|
+
# either a pickup or delivery step, but not both. Read more about this attribute
|
|
424
|
+
# in the [Job Object](#job-object) section.
|
|
425
|
+
#
|
|
426
|
+
# Please note that either the jobs or the shipments attribute should be specified
|
|
427
|
+
# to build a valid request.
|
|
428
|
+
jobs: nil,
|
|
429
|
+
# It represents the set of options that can be used to configure optimization
|
|
430
|
+
# algorithms so that the solver provides a solution that meets the desired
|
|
431
|
+
# business objectives.
|
|
432
|
+
options: nil,
|
|
433
|
+
# relations attribute is an array of individual relation objects. type parameter
|
|
434
|
+
# and steps object are mandatory when using this attribute.
|
|
435
|
+
#
|
|
436
|
+
# Please note:
|
|
437
|
+
#
|
|
438
|
+
# - The soft constraints are **not** effective when using the relations attribute.
|
|
439
|
+
# - In case a given relation can't be satisfied, the optimizer will flag all the
|
|
440
|
+
# tasks involved in that "relation" as unassigned.
|
|
441
|
+
#
|
|
442
|
+
# Read more about this attribute in the [Relations Object](#relations-object)
|
|
443
|
+
# section.
|
|
444
|
+
relations: nil,
|
|
445
|
+
# The shipments object is used to collect the details of shipments that need to be
|
|
446
|
+
# completed as part of the optimization process.
|
|
447
|
+
#
|
|
448
|
+
# Each shipment should have a pickup and the corresponding delivery step.
|
|
449
|
+
#
|
|
450
|
+
# Please note that either the jobs or the shipments attribute should be specified
|
|
451
|
+
# to build a valid request.
|
|
452
|
+
shipments: nil,
|
|
453
|
+
# This attribute is related to the re-optimization feature. It allows for the
|
|
454
|
+
# previous optimization result to be provided in case new orders are received and
|
|
455
|
+
# the solution needs to be re-planned. The solution attribute should contain the
|
|
456
|
+
# same routes as the previous optimization result. solution attribute is an array
|
|
457
|
+
# of objects with each object corresponding to one route.
|
|
458
|
+
solution: nil,
|
|
459
|
+
# unassigned attribute is related to the re-optimization feature. This attribute
|
|
460
|
+
# should contain the tasks that were not assigned during an earlier optimization
|
|
461
|
+
# process. Please note that the unassigned part in request should be consistent
|
|
462
|
+
# with the unassigned part in the previous optimization result.
|
|
463
|
+
#
|
|
464
|
+
# Users can reduce the number of unassigned tasks in the re-optimized solution, by
|
|
465
|
+
# following strategies such as:
|
|
466
|
+
#
|
|
467
|
+
# - Extending the time windows for vehicles or tasks to give more flexibility
|
|
468
|
+
# - Adding more vehicles to the optimization problem
|
|
469
|
+
# - Adjusting the priority of different tasks to balance the workload more evenly
|
|
470
|
+
# - Modifying other constraints or parameters to make the problem more solvable
|
|
471
|
+
#
|
|
472
|
+
# Ultimately, the goal is to minimize the number of unassigned tasks while still
|
|
473
|
+
# meeting all the necessary constraints and objectives.
|
|
474
|
+
unassigned: nil,
|
|
475
|
+
# An array of objects to specify geometry of all the zones involved. Each object
|
|
476
|
+
# corresponds to a single zone. A valid zone can be a
|
|
477
|
+
# [geoJSON](https://datatracker.ietf.org/doc/html/rfc7946#page-9) polygon,
|
|
478
|
+
# multi-polygon or a geofence created using
|
|
479
|
+
# [NextBillion.ai](http://NextBillion.ai)’s
|
|
480
|
+
# [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence).
|
|
481
|
+
#
|
|
482
|
+
# Please note that
|
|
483
|
+
#
|
|
484
|
+
# - Each zone should have a geometry specified either throughgeometry or through
|
|
485
|
+
# the geofence_id parameter.
|
|
486
|
+
# - When zone IDs are not provided for individual tasks (jobs or shipments) then
|
|
487
|
+
# the API will automatically allocate zones based on the task’s geolocation and
|
|
488
|
+
# the geometries of the zones provided here. Otherwise, if the zone IDs are
|
|
489
|
+
# provided while configuring individual tasks, the zone IDs will override the
|
|
490
|
+
# geometries provided here.
|
|
491
|
+
zones: nil,
|
|
492
|
+
request_options: {}
|
|
493
|
+
)
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
sig do
|
|
497
|
+
override.returns(
|
|
498
|
+
{
|
|
499
|
+
key: String,
|
|
500
|
+
locations: Nextbillionai::Optimization::V2SubmitParams::Locations,
|
|
501
|
+
vehicles: T::Array[Nextbillionai::Optimization::Vehicle],
|
|
502
|
+
cost_matrix: T::Array[T::Array[Integer]],
|
|
503
|
+
depots:
|
|
504
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Depot],
|
|
505
|
+
description: String,
|
|
506
|
+
distance_matrix: T::Array[T::Array[Integer]],
|
|
507
|
+
duration_matrix: T::Array[T::Array[Integer]],
|
|
508
|
+
existing_solution_id: String,
|
|
509
|
+
jobs: T::Array[Nextbillionai::Optimization::Job],
|
|
510
|
+
options: Nextbillionai::Optimization::V2SubmitParams::Options,
|
|
511
|
+
relations:
|
|
512
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Relation],
|
|
513
|
+
shipments: T::Array[Nextbillionai::Optimization::Shipment],
|
|
514
|
+
solution:
|
|
515
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Solution],
|
|
516
|
+
unassigned:
|
|
517
|
+
Nextbillionai::Optimization::V2SubmitParams::Unassigned,
|
|
518
|
+
zones:
|
|
519
|
+
T::Array[Nextbillionai::Optimization::V2SubmitParams::Zone],
|
|
520
|
+
request_options: Nextbillionai::RequestOptions
|
|
521
|
+
}
|
|
522
|
+
)
|
|
523
|
+
end
|
|
524
|
+
def to_hash
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
class Locations < Nextbillionai::Internal::Type::BaseModel
|
|
528
|
+
OrHash =
|
|
529
|
+
T.type_alias do
|
|
530
|
+
T.any(
|
|
531
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations,
|
|
532
|
+
Nextbillionai::Internal::AnyHash
|
|
533
|
+
)
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Indicate all the location coordinates that will be used during optimization. The
|
|
537
|
+
# coordinates should be specified in the format “latitude, longitude”. It is
|
|
538
|
+
# recommended to avoid adding duplicate location coordinates to this array. In
|
|
539
|
+
# case there are multiple tasks at the same location, users can repeat the index
|
|
540
|
+
# of the location while configuring all such tasks.
|
|
541
|
+
#
|
|
542
|
+
# Please use this array to determine the index of a location when setting the
|
|
543
|
+
# location_index parameter in jobs, shipments, vehicles or other parts of the
|
|
544
|
+
# request. The length of this array determines the valid values for location_index
|
|
545
|
+
# parameter.
|
|
546
|
+
sig { returns(T::Array[String]) }
|
|
547
|
+
attr_accessor :location
|
|
548
|
+
|
|
549
|
+
# A unique ID for the set of locations. It should be a positive integer.
|
|
550
|
+
sig { returns(T.nilable(Integer)) }
|
|
551
|
+
attr_reader :id
|
|
552
|
+
|
|
553
|
+
sig { params(id: Integer).void }
|
|
554
|
+
attr_writer :id
|
|
555
|
+
|
|
556
|
+
# Describe if the location is curbside. An array of strings indicates the side of
|
|
557
|
+
# the road from which to approach the location in the calculated route. If
|
|
558
|
+
# provided, the number of approaches must be equal to the number of locations.
|
|
559
|
+
# However, you can skip a coordinate and show its position in the list using “”
|
|
560
|
+
# (empty string). Please note these values are case-sensitive.
|
|
561
|
+
sig do
|
|
562
|
+
returns(
|
|
563
|
+
T.nilable(
|
|
564
|
+
T::Array[
|
|
565
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::OrSymbol
|
|
566
|
+
]
|
|
567
|
+
)
|
|
568
|
+
)
|
|
569
|
+
end
|
|
570
|
+
attr_reader :approaches
|
|
571
|
+
|
|
572
|
+
sig do
|
|
573
|
+
params(
|
|
574
|
+
approaches:
|
|
575
|
+
T::Array[
|
|
576
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::OrSymbol
|
|
577
|
+
]
|
|
578
|
+
).void
|
|
579
|
+
end
|
|
580
|
+
attr_writer :approaches
|
|
581
|
+
|
|
582
|
+
# The locations object is used to define all the locations that will be used
|
|
583
|
+
# during the optimization process. Read more about this attribute in the
|
|
584
|
+
# [Location Object](#location-object) section.
|
|
585
|
+
sig do
|
|
586
|
+
params(
|
|
587
|
+
location: T::Array[String],
|
|
588
|
+
id: Integer,
|
|
589
|
+
approaches:
|
|
590
|
+
T::Array[
|
|
591
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::OrSymbol
|
|
592
|
+
]
|
|
593
|
+
).returns(T.attached_class)
|
|
594
|
+
end
|
|
595
|
+
def self.new(
|
|
596
|
+
# Indicate all the location coordinates that will be used during optimization. The
|
|
597
|
+
# coordinates should be specified in the format “latitude, longitude”. It is
|
|
598
|
+
# recommended to avoid adding duplicate location coordinates to this array. In
|
|
599
|
+
# case there are multiple tasks at the same location, users can repeat the index
|
|
600
|
+
# of the location while configuring all such tasks.
|
|
601
|
+
#
|
|
602
|
+
# Please use this array to determine the index of a location when setting the
|
|
603
|
+
# location_index parameter in jobs, shipments, vehicles or other parts of the
|
|
604
|
+
# request. The length of this array determines the valid values for location_index
|
|
605
|
+
# parameter.
|
|
606
|
+
location:,
|
|
607
|
+
# A unique ID for the set of locations. It should be a positive integer.
|
|
608
|
+
id: nil,
|
|
609
|
+
# Describe if the location is curbside. An array of strings indicates the side of
|
|
610
|
+
# the road from which to approach the location in the calculated route. If
|
|
611
|
+
# provided, the number of approaches must be equal to the number of locations.
|
|
612
|
+
# However, you can skip a coordinate and show its position in the list using “”
|
|
613
|
+
# (empty string). Please note these values are case-sensitive.
|
|
614
|
+
approaches: nil
|
|
615
|
+
)
|
|
616
|
+
end
|
|
617
|
+
|
|
618
|
+
sig do
|
|
619
|
+
override.returns(
|
|
620
|
+
{
|
|
621
|
+
location: T::Array[String],
|
|
622
|
+
id: Integer,
|
|
623
|
+
approaches:
|
|
624
|
+
T::Array[
|
|
625
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::OrSymbol
|
|
626
|
+
]
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
end
|
|
630
|
+
def to_hash
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
module Approach
|
|
634
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
635
|
+
|
|
636
|
+
TaggedSymbol =
|
|
637
|
+
T.type_alias do
|
|
638
|
+
T.all(
|
|
639
|
+
Symbol,
|
|
640
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach
|
|
641
|
+
)
|
|
642
|
+
end
|
|
643
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
644
|
+
|
|
645
|
+
UNRESTRICTED =
|
|
646
|
+
T.let(
|
|
647
|
+
:unrestricted,
|
|
648
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::TaggedSymbol
|
|
649
|
+
)
|
|
650
|
+
CURB =
|
|
651
|
+
T.let(
|
|
652
|
+
:curb,
|
|
653
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::TaggedSymbol
|
|
654
|
+
)
|
|
655
|
+
EMPTY_STRING =
|
|
656
|
+
T.let(
|
|
657
|
+
:"\"\"(empty string)",
|
|
658
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::TaggedSymbol
|
|
659
|
+
)
|
|
660
|
+
|
|
661
|
+
sig do
|
|
662
|
+
override.returns(
|
|
663
|
+
T::Array[
|
|
664
|
+
Nextbillionai::Optimization::V2SubmitParams::Locations::Approach::TaggedSymbol
|
|
665
|
+
]
|
|
666
|
+
)
|
|
667
|
+
end
|
|
668
|
+
def self.values
|
|
669
|
+
end
|
|
670
|
+
end
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
class Depot < Nextbillionai::Internal::Type::BaseModel
|
|
674
|
+
OrHash =
|
|
675
|
+
T.type_alias do
|
|
676
|
+
T.any(
|
|
677
|
+
Nextbillionai::Optimization::V2SubmitParams::Depot,
|
|
678
|
+
Nextbillionai::Internal::AnyHash
|
|
679
|
+
)
|
|
680
|
+
end
|
|
681
|
+
|
|
682
|
+
# Provide an unique ID for the depot. The IDs are case sensitive.
|
|
683
|
+
sig { returns(String) }
|
|
684
|
+
attr_accessor :id
|
|
685
|
+
|
|
686
|
+
# Specify the index of coordinates (in the location array) denoting the depot’s
|
|
687
|
+
# location. The valid range of values is \[0, length of location array). If the
|
|
688
|
+
# location index exceeds the count of input locations in the location array, the
|
|
689
|
+
# API will report an error.
|
|
690
|
+
#
|
|
691
|
+
# Please note the location_index is mandatory when using the depots object.
|
|
692
|
+
sig { returns(Integer) }
|
|
693
|
+
attr_accessor :location_index
|
|
694
|
+
|
|
695
|
+
# Add a custom description for the depot.
|
|
696
|
+
sig { returns(T.nilable(String)) }
|
|
697
|
+
attr_reader :description
|
|
698
|
+
|
|
699
|
+
sig { params(description: String).void }
|
|
700
|
+
attr_writer :description
|
|
701
|
+
|
|
702
|
+
# Specify the time duration, in seconds, needed to load or unload the vehicle each
|
|
703
|
+
# time it starts or arrives at a depot, respectively. Default value is 0.
|
|
704
|
+
sig { returns(T.nilable(Integer)) }
|
|
705
|
+
attr_reader :service
|
|
706
|
+
|
|
707
|
+
sig { params(service: Integer).void }
|
|
708
|
+
attr_writer :service
|
|
709
|
+
|
|
710
|
+
# Specify the time-windows during which the depot is operational and allows
|
|
711
|
+
# vehicles to be loaded / unloaded. The time periods should be expressed as a UNIX
|
|
712
|
+
# timestamp in seconds.
|
|
713
|
+
#
|
|
714
|
+
# Please note that:
|
|
715
|
+
#
|
|
716
|
+
# - Multiple time-windows can be provided but those time windows should not
|
|
717
|
+
# overlap with each other.
|
|
718
|
+
# - Time windows should always be specified in the format of \[start_timestamp,
|
|
719
|
+
# end_timestamp\].
|
|
720
|
+
# - Depot's time-windows are ineffective used when max_activity_waiting_time is
|
|
721
|
+
# specified in the input.
|
|
722
|
+
# - Using relations along with depot time-window is not allowed and the service
|
|
723
|
+
# will return an error.
|
|
724
|
+
sig { returns(T.nilable(T::Array[T::Array[Integer]])) }
|
|
725
|
+
attr_reader :time_windows
|
|
726
|
+
|
|
727
|
+
sig { params(time_windows: T::Array[T::Array[Integer]]).void }
|
|
728
|
+
attr_writer :time_windows
|
|
729
|
+
|
|
730
|
+
sig do
|
|
731
|
+
params(
|
|
732
|
+
id: String,
|
|
733
|
+
location_index: Integer,
|
|
734
|
+
description: String,
|
|
735
|
+
service: Integer,
|
|
736
|
+
time_windows: T::Array[T::Array[Integer]]
|
|
737
|
+
).returns(T.attached_class)
|
|
738
|
+
end
|
|
739
|
+
def self.new(
|
|
740
|
+
# Provide an unique ID for the depot. The IDs are case sensitive.
|
|
741
|
+
id:,
|
|
742
|
+
# Specify the index of coordinates (in the location array) denoting the depot’s
|
|
743
|
+
# location. The valid range of values is \[0, length of location array). If the
|
|
744
|
+
# location index exceeds the count of input locations in the location array, the
|
|
745
|
+
# API will report an error.
|
|
746
|
+
#
|
|
747
|
+
# Please note the location_index is mandatory when using the depots object.
|
|
748
|
+
location_index:,
|
|
749
|
+
# Add a custom description for the depot.
|
|
750
|
+
description: nil,
|
|
751
|
+
# Specify the time duration, in seconds, needed to load or unload the vehicle each
|
|
752
|
+
# time it starts or arrives at a depot, respectively. Default value is 0.
|
|
753
|
+
service: nil,
|
|
754
|
+
# Specify the time-windows during which the depot is operational and allows
|
|
755
|
+
# vehicles to be loaded / unloaded. The time periods should be expressed as a UNIX
|
|
756
|
+
# timestamp in seconds.
|
|
757
|
+
#
|
|
758
|
+
# Please note that:
|
|
759
|
+
#
|
|
760
|
+
# - Multiple time-windows can be provided but those time windows should not
|
|
761
|
+
# overlap with each other.
|
|
762
|
+
# - Time windows should always be specified in the format of \[start_timestamp,
|
|
763
|
+
# end_timestamp\].
|
|
764
|
+
# - Depot's time-windows are ineffective used when max_activity_waiting_time is
|
|
765
|
+
# specified in the input.
|
|
766
|
+
# - Using relations along with depot time-window is not allowed and the service
|
|
767
|
+
# will return an error.
|
|
768
|
+
time_windows: nil
|
|
769
|
+
)
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
sig do
|
|
773
|
+
override.returns(
|
|
774
|
+
{
|
|
775
|
+
id: String,
|
|
776
|
+
location_index: Integer,
|
|
777
|
+
description: String,
|
|
778
|
+
service: Integer,
|
|
779
|
+
time_windows: T::Array[T::Array[Integer]]
|
|
780
|
+
}
|
|
781
|
+
)
|
|
782
|
+
end
|
|
783
|
+
def to_hash
|
|
784
|
+
end
|
|
785
|
+
end
|
|
786
|
+
|
|
787
|
+
class Options < Nextbillionai::Internal::Type::BaseModel
|
|
788
|
+
OrHash =
|
|
789
|
+
T.type_alias do
|
|
790
|
+
T.any(
|
|
791
|
+
Nextbillionai::Optimization::V2SubmitParams::Options,
|
|
792
|
+
Nextbillionai::Internal::AnyHash
|
|
793
|
+
)
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
# This attribute defines both the soft and hard constraints for an optimization
|
|
797
|
+
# job.
|
|
798
|
+
#
|
|
799
|
+
# Soft constraints are constraints that do not necessarily have to be satisfied,
|
|
800
|
+
# but the optimization algorithm will try to satisfy them as much as possible.
|
|
801
|
+
# Whereas the hard constraints are the constraints that will not be violated by
|
|
802
|
+
# the solver. Users can use multiple constraints together.
|
|
803
|
+
#
|
|
804
|
+
# Please note that soft constraints are ineffective when using relations attribute
|
|
805
|
+
# in a request. The hard constraint, max_activity_waiting_time, is effective only
|
|
806
|
+
# when relation type is in_same_route and ineffective for all other types.
|
|
807
|
+
sig do
|
|
808
|
+
returns(
|
|
809
|
+
T.nilable(
|
|
810
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Constraint
|
|
811
|
+
)
|
|
812
|
+
)
|
|
813
|
+
end
|
|
814
|
+
attr_reader :constraint
|
|
815
|
+
|
|
816
|
+
sig do
|
|
817
|
+
params(
|
|
818
|
+
constraint:
|
|
819
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Constraint::OrHash
|
|
820
|
+
).void
|
|
821
|
+
end
|
|
822
|
+
attr_writer :constraint
|
|
823
|
+
|
|
824
|
+
# Set grouping rules for the tasks and routes.
|
|
825
|
+
#
|
|
826
|
+
# - Use order_grouping to group nearby tasks
|
|
827
|
+
# - Use route_grouping to control route sequencing.
|
|
828
|
+
sig do
|
|
829
|
+
returns(
|
|
830
|
+
T.nilable(
|
|
831
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping
|
|
832
|
+
)
|
|
833
|
+
)
|
|
834
|
+
end
|
|
835
|
+
attr_reader :grouping
|
|
836
|
+
|
|
837
|
+
sig do
|
|
838
|
+
params(
|
|
839
|
+
grouping:
|
|
840
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrHash
|
|
841
|
+
).void
|
|
842
|
+
end
|
|
843
|
+
attr_writer :grouping
|
|
844
|
+
|
|
845
|
+
# This attribute is used to configure the objective of the optimization job.
|
|
846
|
+
sig do
|
|
847
|
+
returns(
|
|
848
|
+
T.nilable(
|
|
849
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective
|
|
850
|
+
)
|
|
851
|
+
)
|
|
852
|
+
end
|
|
853
|
+
attr_reader :objective
|
|
854
|
+
|
|
855
|
+
sig do
|
|
856
|
+
params(
|
|
857
|
+
objective:
|
|
858
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::OrHash
|
|
859
|
+
).void
|
|
860
|
+
end
|
|
861
|
+
attr_writer :objective
|
|
862
|
+
|
|
863
|
+
# This attribute is used to define the routing configurations for the optimization
|
|
864
|
+
# job.
|
|
865
|
+
sig do
|
|
866
|
+
returns(
|
|
867
|
+
T.nilable(
|
|
868
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing
|
|
869
|
+
)
|
|
870
|
+
)
|
|
871
|
+
end
|
|
872
|
+
attr_reader :routing
|
|
873
|
+
|
|
874
|
+
sig do
|
|
875
|
+
params(
|
|
876
|
+
routing:
|
|
877
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::OrHash
|
|
878
|
+
).void
|
|
879
|
+
end
|
|
880
|
+
attr_writer :routing
|
|
881
|
+
|
|
882
|
+
# It represents the set of options that can be used to configure optimization
|
|
883
|
+
# algorithms so that the solver provides a solution that meets the desired
|
|
884
|
+
# business objectives.
|
|
885
|
+
sig do
|
|
886
|
+
params(
|
|
887
|
+
constraint:
|
|
888
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Constraint::OrHash,
|
|
889
|
+
grouping:
|
|
890
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrHash,
|
|
891
|
+
objective:
|
|
892
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::OrHash,
|
|
893
|
+
routing:
|
|
894
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::OrHash
|
|
895
|
+
).returns(T.attached_class)
|
|
896
|
+
end
|
|
897
|
+
def self.new(
|
|
898
|
+
# This attribute defines both the soft and hard constraints for an optimization
|
|
899
|
+
# job.
|
|
900
|
+
#
|
|
901
|
+
# Soft constraints are constraints that do not necessarily have to be satisfied,
|
|
902
|
+
# but the optimization algorithm will try to satisfy them as much as possible.
|
|
903
|
+
# Whereas the hard constraints are the constraints that will not be violated by
|
|
904
|
+
# the solver. Users can use multiple constraints together.
|
|
905
|
+
#
|
|
906
|
+
# Please note that soft constraints are ineffective when using relations attribute
|
|
907
|
+
# in a request. The hard constraint, max_activity_waiting_time, is effective only
|
|
908
|
+
# when relation type is in_same_route and ineffective for all other types.
|
|
909
|
+
constraint: nil,
|
|
910
|
+
# Set grouping rules for the tasks and routes.
|
|
911
|
+
#
|
|
912
|
+
# - Use order_grouping to group nearby tasks
|
|
913
|
+
# - Use route_grouping to control route sequencing.
|
|
914
|
+
grouping: nil,
|
|
915
|
+
# This attribute is used to configure the objective of the optimization job.
|
|
916
|
+
objective: nil,
|
|
917
|
+
# This attribute is used to define the routing configurations for the optimization
|
|
918
|
+
# job.
|
|
919
|
+
routing: nil
|
|
920
|
+
)
|
|
921
|
+
end
|
|
922
|
+
|
|
923
|
+
sig do
|
|
924
|
+
override.returns(
|
|
925
|
+
{
|
|
926
|
+
constraint:
|
|
927
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Constraint,
|
|
928
|
+
grouping:
|
|
929
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping,
|
|
930
|
+
objective:
|
|
931
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective,
|
|
932
|
+
routing:
|
|
933
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing
|
|
934
|
+
}
|
|
935
|
+
)
|
|
936
|
+
end
|
|
937
|
+
def to_hash
|
|
938
|
+
end
|
|
939
|
+
|
|
940
|
+
class Constraint < Nextbillionai::Internal::Type::BaseModel
|
|
941
|
+
OrHash =
|
|
942
|
+
T.type_alias do
|
|
943
|
+
T.any(
|
|
944
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Constraint,
|
|
945
|
+
Nextbillionai::Internal::AnyHash
|
|
946
|
+
)
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
# This is a hard constraint which specifies the maximum waiting time, in seconds,
|
|
950
|
+
# for each step. It ensures that the vehicles do not have unreasonable wait times
|
|
951
|
+
# between jobs or shipments. This feature is useful for use cases where avoiding
|
|
952
|
+
# long wait times between jobs or shipments is a primary concern.
|
|
953
|
+
#
|
|
954
|
+
# Please note that the waiting time constraint applies to all tasks in the
|
|
955
|
+
# optimization request, ensuring that no single task exceeds the specified maximum
|
|
956
|
+
# waiting time. When being used together with relations attribute, this parameter
|
|
957
|
+
# is effective only for in_same_route relation type.
|
|
958
|
+
sig { returns(T.nilable(Integer)) }
|
|
959
|
+
attr_reader :max_activity_waiting_time
|
|
960
|
+
|
|
961
|
+
sig { params(max_activity_waiting_time: Integer).void }
|
|
962
|
+
attr_writer :max_activity_waiting_time
|
|
963
|
+
|
|
964
|
+
# This is a soft constraint for vehicle overtime. Overtime is defined as the time
|
|
965
|
+
# that a vehicle spends to complete a set of jobs after its time window has ended.
|
|
966
|
+
# max_vehicle_overtime attribute specifies the maximum amount of overtime a
|
|
967
|
+
# vehicle can have, in seconds. If a vehicle’s overtime exceeds this value, it
|
|
968
|
+
# will be considered a violation of this constraint.
|
|
969
|
+
#
|
|
970
|
+
# Please note that this constraint applies to all vehicles in the optimization
|
|
971
|
+
# request.
|
|
972
|
+
sig { returns(T.nilable(Integer)) }
|
|
973
|
+
attr_reader :max_vehicle_overtime
|
|
974
|
+
|
|
975
|
+
sig { params(max_vehicle_overtime: Integer).void }
|
|
976
|
+
attr_writer :max_vehicle_overtime
|
|
977
|
+
|
|
978
|
+
# This is a soft constraint for permissible delay, in seconds, to complete a job
|
|
979
|
+
# or shipment after its time window is over. If a job or shipment’s lateness
|
|
980
|
+
# exceeds this value, it will be considered a violation of this constraint.
|
|
981
|
+
#
|
|
982
|
+
# Please note that this constraint applies to all tasks in the optimization
|
|
983
|
+
# request. In case lateness duration needs to be applied for individual tasks,
|
|
984
|
+
# please use the max_visit_lateness parameter under jobs and shipments
|
|
985
|
+
sig { returns(T.nilable(Integer)) }
|
|
986
|
+
attr_reader :max_visit_lateness
|
|
987
|
+
|
|
988
|
+
sig { params(max_visit_lateness: Integer).void }
|
|
989
|
+
attr_writer :max_visit_lateness
|
|
990
|
+
|
|
991
|
+
# This attribute defines both the soft and hard constraints for an optimization
|
|
992
|
+
# job.
|
|
993
|
+
#
|
|
994
|
+
# Soft constraints are constraints that do not necessarily have to be satisfied,
|
|
995
|
+
# but the optimization algorithm will try to satisfy them as much as possible.
|
|
996
|
+
# Whereas the hard constraints are the constraints that will not be violated by
|
|
997
|
+
# the solver. Users can use multiple constraints together.
|
|
998
|
+
#
|
|
999
|
+
# Please note that soft constraints are ineffective when using relations attribute
|
|
1000
|
+
# in a request. The hard constraint, max_activity_waiting_time, is effective only
|
|
1001
|
+
# when relation type is in_same_route and ineffective for all other types.
|
|
1002
|
+
sig do
|
|
1003
|
+
params(
|
|
1004
|
+
max_activity_waiting_time: Integer,
|
|
1005
|
+
max_vehicle_overtime: Integer,
|
|
1006
|
+
max_visit_lateness: Integer
|
|
1007
|
+
).returns(T.attached_class)
|
|
1008
|
+
end
|
|
1009
|
+
def self.new(
|
|
1010
|
+
# This is a hard constraint which specifies the maximum waiting time, in seconds,
|
|
1011
|
+
# for each step. It ensures that the vehicles do not have unreasonable wait times
|
|
1012
|
+
# between jobs or shipments. This feature is useful for use cases where avoiding
|
|
1013
|
+
# long wait times between jobs or shipments is a primary concern.
|
|
1014
|
+
#
|
|
1015
|
+
# Please note that the waiting time constraint applies to all tasks in the
|
|
1016
|
+
# optimization request, ensuring that no single task exceeds the specified maximum
|
|
1017
|
+
# waiting time. When being used together with relations attribute, this parameter
|
|
1018
|
+
# is effective only for in_same_route relation type.
|
|
1019
|
+
max_activity_waiting_time: nil,
|
|
1020
|
+
# This is a soft constraint for vehicle overtime. Overtime is defined as the time
|
|
1021
|
+
# that a vehicle spends to complete a set of jobs after its time window has ended.
|
|
1022
|
+
# max_vehicle_overtime attribute specifies the maximum amount of overtime a
|
|
1023
|
+
# vehicle can have, in seconds. If a vehicle’s overtime exceeds this value, it
|
|
1024
|
+
# will be considered a violation of this constraint.
|
|
1025
|
+
#
|
|
1026
|
+
# Please note that this constraint applies to all vehicles in the optimization
|
|
1027
|
+
# request.
|
|
1028
|
+
max_vehicle_overtime: nil,
|
|
1029
|
+
# This is a soft constraint for permissible delay, in seconds, to complete a job
|
|
1030
|
+
# or shipment after its time window is over. If a job or shipment’s lateness
|
|
1031
|
+
# exceeds this value, it will be considered a violation of this constraint.
|
|
1032
|
+
#
|
|
1033
|
+
# Please note that this constraint applies to all tasks in the optimization
|
|
1034
|
+
# request. In case lateness duration needs to be applied for individual tasks,
|
|
1035
|
+
# please use the max_visit_lateness parameter under jobs and shipments
|
|
1036
|
+
max_visit_lateness: nil
|
|
1037
|
+
)
|
|
1038
|
+
end
|
|
1039
|
+
|
|
1040
|
+
sig do
|
|
1041
|
+
override.returns(
|
|
1042
|
+
{
|
|
1043
|
+
max_activity_waiting_time: Integer,
|
|
1044
|
+
max_vehicle_overtime: Integer,
|
|
1045
|
+
max_visit_lateness: Integer
|
|
1046
|
+
}
|
|
1047
|
+
)
|
|
1048
|
+
end
|
|
1049
|
+
def to_hash
|
|
1050
|
+
end
|
|
1051
|
+
end
|
|
1052
|
+
|
|
1053
|
+
class Grouping < Nextbillionai::Internal::Type::BaseModel
|
|
1054
|
+
OrHash =
|
|
1055
|
+
T.type_alias do
|
|
1056
|
+
T.any(
|
|
1057
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping,
|
|
1058
|
+
Nextbillionai::Internal::AnyHash
|
|
1059
|
+
)
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
# Specify the criteria for grouping nearby tasks. The grouped tasks will be
|
|
1063
|
+
# treated as one stop by the optimizer and no cost would be incurred when driver
|
|
1064
|
+
# travels to different tasks within a group. Users can use this feature to model
|
|
1065
|
+
# use cases like multiple deliveries in a building complex or a condo.
|
|
1066
|
+
#
|
|
1067
|
+
# Please note that when the multiple tasks are grouped together, only one setup
|
|
1068
|
+
# time is considered for all such tasks. The durations of this setup time is equal
|
|
1069
|
+
# to maximum setup time among all grouped tasks, if provided. On the other hand,
|
|
1070
|
+
# the service time is applied to each task individually, as per the input provided
|
|
1071
|
+
# when configuring those tasks.
|
|
1072
|
+
sig do
|
|
1073
|
+
returns(
|
|
1074
|
+
T.nilable(
|
|
1075
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrderGrouping
|
|
1076
|
+
)
|
|
1077
|
+
)
|
|
1078
|
+
end
|
|
1079
|
+
attr_reader :order_grouping
|
|
1080
|
+
|
|
1081
|
+
sig do
|
|
1082
|
+
params(
|
|
1083
|
+
order_grouping:
|
|
1084
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrderGrouping::OrHash
|
|
1085
|
+
).void
|
|
1086
|
+
end
|
|
1087
|
+
attr_writer :order_grouping
|
|
1088
|
+
|
|
1089
|
+
# When specified, routes are built taking into account the distance to the nearest
|
|
1090
|
+
# tasks. A higher proximity factor helps build routes with closer distances
|
|
1091
|
+
# between neighboring tasks, whereas a lower proximity factor helps build routes
|
|
1092
|
+
# with farther distances between neighboring tasks. As a result, the total number
|
|
1093
|
+
# of routes in the solution can vary based on the configured proximity factor -
|
|
1094
|
+
# more routes for higher factor and less routes with lower factor.
|
|
1095
|
+
#
|
|
1096
|
+
# In practice, such routes are more resistant to changes in task time windows:
|
|
1097
|
+
# when the time window is postponed, the driver can drive to the next task and
|
|
1098
|
+
# then return to the previous one.
|
|
1099
|
+
#
|
|
1100
|
+
# Please note that:
|
|
1101
|
+
#
|
|
1102
|
+
# - Valid values are \[0,10\]
|
|
1103
|
+
# - Default value is 0.0.
|
|
1104
|
+
# - It is recommended to use values lower values, in the range of \[0, 1\]. Higher
|
|
1105
|
+
# values may adversely impact the solution metrics due to higher number of
|
|
1106
|
+
# resulting routes: costs, mileage etc.
|
|
1107
|
+
sig { returns(T.nilable(Float)) }
|
|
1108
|
+
attr_reader :proximity_factor
|
|
1109
|
+
|
|
1110
|
+
sig { params(proximity_factor: Float).void }
|
|
1111
|
+
attr_writer :proximity_factor
|
|
1112
|
+
|
|
1113
|
+
# Specify the criteria for prioritising routes in a zone over routes that are part
|
|
1114
|
+
# of another zone. As a result, all the tasks falling in a zone will be fulfilled
|
|
1115
|
+
# before any tasks that are part of a different zone.
|
|
1116
|
+
sig do
|
|
1117
|
+
returns(
|
|
1118
|
+
T.nilable(
|
|
1119
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping
|
|
1120
|
+
)
|
|
1121
|
+
)
|
|
1122
|
+
end
|
|
1123
|
+
attr_reader :route_grouping
|
|
1124
|
+
|
|
1125
|
+
sig do
|
|
1126
|
+
params(
|
|
1127
|
+
route_grouping:
|
|
1128
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::OrHash
|
|
1129
|
+
).void
|
|
1130
|
+
end
|
|
1131
|
+
attr_writer :route_grouping
|
|
1132
|
+
|
|
1133
|
+
# Set grouping rules for the tasks and routes.
|
|
1134
|
+
#
|
|
1135
|
+
# - Use order_grouping to group nearby tasks
|
|
1136
|
+
# - Use route_grouping to control route sequencing.
|
|
1137
|
+
sig do
|
|
1138
|
+
params(
|
|
1139
|
+
order_grouping:
|
|
1140
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrderGrouping::OrHash,
|
|
1141
|
+
proximity_factor: Float,
|
|
1142
|
+
route_grouping:
|
|
1143
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::OrHash
|
|
1144
|
+
).returns(T.attached_class)
|
|
1145
|
+
end
|
|
1146
|
+
def self.new(
|
|
1147
|
+
# Specify the criteria for grouping nearby tasks. The grouped tasks will be
|
|
1148
|
+
# treated as one stop by the optimizer and no cost would be incurred when driver
|
|
1149
|
+
# travels to different tasks within a group. Users can use this feature to model
|
|
1150
|
+
# use cases like multiple deliveries in a building complex or a condo.
|
|
1151
|
+
#
|
|
1152
|
+
# Please note that when the multiple tasks are grouped together, only one setup
|
|
1153
|
+
# time is considered for all such tasks. The durations of this setup time is equal
|
|
1154
|
+
# to maximum setup time among all grouped tasks, if provided. On the other hand,
|
|
1155
|
+
# the service time is applied to each task individually, as per the input provided
|
|
1156
|
+
# when configuring those tasks.
|
|
1157
|
+
order_grouping: nil,
|
|
1158
|
+
# When specified, routes are built taking into account the distance to the nearest
|
|
1159
|
+
# tasks. A higher proximity factor helps build routes with closer distances
|
|
1160
|
+
# between neighboring tasks, whereas a lower proximity factor helps build routes
|
|
1161
|
+
# with farther distances between neighboring tasks. As a result, the total number
|
|
1162
|
+
# of routes in the solution can vary based on the configured proximity factor -
|
|
1163
|
+
# more routes for higher factor and less routes with lower factor.
|
|
1164
|
+
#
|
|
1165
|
+
# In practice, such routes are more resistant to changes in task time windows:
|
|
1166
|
+
# when the time window is postponed, the driver can drive to the next task and
|
|
1167
|
+
# then return to the previous one.
|
|
1168
|
+
#
|
|
1169
|
+
# Please note that:
|
|
1170
|
+
#
|
|
1171
|
+
# - Valid values are \[0,10\]
|
|
1172
|
+
# - Default value is 0.0.
|
|
1173
|
+
# - It is recommended to use values lower values, in the range of \[0, 1\]. Higher
|
|
1174
|
+
# values may adversely impact the solution metrics due to higher number of
|
|
1175
|
+
# resulting routes: costs, mileage etc.
|
|
1176
|
+
proximity_factor: nil,
|
|
1177
|
+
# Specify the criteria for prioritising routes in a zone over routes that are part
|
|
1178
|
+
# of another zone. As a result, all the tasks falling in a zone will be fulfilled
|
|
1179
|
+
# before any tasks that are part of a different zone.
|
|
1180
|
+
route_grouping: nil
|
|
1181
|
+
)
|
|
1182
|
+
end
|
|
1183
|
+
|
|
1184
|
+
sig do
|
|
1185
|
+
override.returns(
|
|
1186
|
+
{
|
|
1187
|
+
order_grouping:
|
|
1188
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrderGrouping,
|
|
1189
|
+
proximity_factor: Float,
|
|
1190
|
+
route_grouping:
|
|
1191
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
end
|
|
1195
|
+
def to_hash
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
class OrderGrouping < Nextbillionai::Internal::Type::BaseModel
|
|
1199
|
+
OrHash =
|
|
1200
|
+
T.type_alias do
|
|
1201
|
+
T.any(
|
|
1202
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::OrderGrouping,
|
|
1203
|
+
Nextbillionai::Internal::AnyHash
|
|
1204
|
+
)
|
|
1205
|
+
end
|
|
1206
|
+
|
|
1207
|
+
# Specify the straight line distance, in meters, which will be used to identify
|
|
1208
|
+
# the tasks that should be grouped together. The default value is null.
|
|
1209
|
+
sig { returns(T.nilable(Float)) }
|
|
1210
|
+
attr_reader :grouping_diameter
|
|
1211
|
+
|
|
1212
|
+
sig { params(grouping_diameter: Float).void }
|
|
1213
|
+
attr_writer :grouping_diameter
|
|
1214
|
+
|
|
1215
|
+
# Specify the criteria for grouping nearby tasks. The grouped tasks will be
|
|
1216
|
+
# treated as one stop by the optimizer and no cost would be incurred when driver
|
|
1217
|
+
# travels to different tasks within a group. Users can use this feature to model
|
|
1218
|
+
# use cases like multiple deliveries in a building complex or a condo.
|
|
1219
|
+
#
|
|
1220
|
+
# Please note that when the multiple tasks are grouped together, only one setup
|
|
1221
|
+
# time is considered for all such tasks. The durations of this setup time is equal
|
|
1222
|
+
# to maximum setup time among all grouped tasks, if provided. On the other hand,
|
|
1223
|
+
# the service time is applied to each task individually, as per the input provided
|
|
1224
|
+
# when configuring those tasks.
|
|
1225
|
+
sig { params(grouping_diameter: Float).returns(T.attached_class) }
|
|
1226
|
+
def self.new(
|
|
1227
|
+
# Specify the straight line distance, in meters, which will be used to identify
|
|
1228
|
+
# the tasks that should be grouped together. The default value is null.
|
|
1229
|
+
grouping_diameter: nil
|
|
1230
|
+
)
|
|
1231
|
+
end
|
|
1232
|
+
|
|
1233
|
+
sig { override.returns({ grouping_diameter: Float }) }
|
|
1234
|
+
def to_hash
|
|
1235
|
+
end
|
|
1236
|
+
end
|
|
1237
|
+
|
|
1238
|
+
class RouteGrouping < Nextbillionai::Internal::Type::BaseModel
|
|
1239
|
+
OrHash =
|
|
1240
|
+
T.type_alias do
|
|
1241
|
+
T.any(
|
|
1242
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping,
|
|
1243
|
+
Nextbillionai::Internal::AnyHash
|
|
1244
|
+
)
|
|
1245
|
+
end
|
|
1246
|
+
|
|
1247
|
+
# Specify a non-negative value which indicates the penalty of crossing zones on
|
|
1248
|
+
# the same route. Default penalty value is 0.
|
|
1249
|
+
#
|
|
1250
|
+
# A higher value, for example 30.0, will place a higher penalty on zone violations
|
|
1251
|
+
# and hence push the optimizer to prefer a solution without any zone violations,
|
|
1252
|
+
# where all tasks in a single region are fulfilled before any tasks in other
|
|
1253
|
+
# regions or outside the current region. Whereas a lower value, say 5.0, will
|
|
1254
|
+
# place a lower penalty allowing the optimizer to return solutions which may have
|
|
1255
|
+
# few violations, say a couple of routing zone violations in our example. A still
|
|
1256
|
+
# lower penalty factor, like 1.0, may have several zone violations.
|
|
1257
|
+
sig { returns(T.nilable(Float)) }
|
|
1258
|
+
attr_reader :penalty_factor
|
|
1259
|
+
|
|
1260
|
+
sig { params(penalty_factor: Float).void }
|
|
1261
|
+
attr_writer :penalty_factor
|
|
1262
|
+
|
|
1263
|
+
# Specify the diameter of the zone, routes within which will be prioritised before
|
|
1264
|
+
# routes falling in other zones. Please note that zone_diameter is the straight
|
|
1265
|
+
# line distance, in meters.
|
|
1266
|
+
sig { returns(T.nilable(Float)) }
|
|
1267
|
+
attr_reader :zone_diameter
|
|
1268
|
+
|
|
1269
|
+
sig { params(zone_diameter: Float).void }
|
|
1270
|
+
attr_writer :zone_diameter
|
|
1271
|
+
|
|
1272
|
+
# Specify the source for creating boundaries of the routing zones. The default
|
|
1273
|
+
# value is “system_generated”.
|
|
1274
|
+
#
|
|
1275
|
+
# - system_generated - Routing zone boundaries are created automatically by the
|
|
1276
|
+
# optimizer based on the zone_diameter provided.
|
|
1277
|
+
# - custom_definition - Custom routing zone boundaries should be provided by the
|
|
1278
|
+
# user in input using the zones attribute. An error would be returned if the
|
|
1279
|
+
# zones attribute is null or missing in the input request.
|
|
1280
|
+
sig do
|
|
1281
|
+
returns(
|
|
1282
|
+
T.nilable(
|
|
1283
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::OrSymbol
|
|
1284
|
+
)
|
|
1285
|
+
)
|
|
1286
|
+
end
|
|
1287
|
+
attr_reader :zone_source
|
|
1288
|
+
|
|
1289
|
+
sig do
|
|
1290
|
+
params(
|
|
1291
|
+
zone_source:
|
|
1292
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::OrSymbol
|
|
1293
|
+
).void
|
|
1294
|
+
end
|
|
1295
|
+
attr_writer :zone_source
|
|
1296
|
+
|
|
1297
|
+
# Specify the criteria for prioritising routes in a zone over routes that are part
|
|
1298
|
+
# of another zone. As a result, all the tasks falling in a zone will be fulfilled
|
|
1299
|
+
# before any tasks that are part of a different zone.
|
|
1300
|
+
sig do
|
|
1301
|
+
params(
|
|
1302
|
+
penalty_factor: Float,
|
|
1303
|
+
zone_diameter: Float,
|
|
1304
|
+
zone_source:
|
|
1305
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::OrSymbol
|
|
1306
|
+
).returns(T.attached_class)
|
|
1307
|
+
end
|
|
1308
|
+
def self.new(
|
|
1309
|
+
# Specify a non-negative value which indicates the penalty of crossing zones on
|
|
1310
|
+
# the same route. Default penalty value is 0.
|
|
1311
|
+
#
|
|
1312
|
+
# A higher value, for example 30.0, will place a higher penalty on zone violations
|
|
1313
|
+
# and hence push the optimizer to prefer a solution without any zone violations,
|
|
1314
|
+
# where all tasks in a single region are fulfilled before any tasks in other
|
|
1315
|
+
# regions or outside the current region. Whereas a lower value, say 5.0, will
|
|
1316
|
+
# place a lower penalty allowing the optimizer to return solutions which may have
|
|
1317
|
+
# few violations, say a couple of routing zone violations in our example. A still
|
|
1318
|
+
# lower penalty factor, like 1.0, may have several zone violations.
|
|
1319
|
+
penalty_factor: nil,
|
|
1320
|
+
# Specify the diameter of the zone, routes within which will be prioritised before
|
|
1321
|
+
# routes falling in other zones. Please note that zone_diameter is the straight
|
|
1322
|
+
# line distance, in meters.
|
|
1323
|
+
zone_diameter: nil,
|
|
1324
|
+
# Specify the source for creating boundaries of the routing zones. The default
|
|
1325
|
+
# value is “system_generated”.
|
|
1326
|
+
#
|
|
1327
|
+
# - system_generated - Routing zone boundaries are created automatically by the
|
|
1328
|
+
# optimizer based on the zone_diameter provided.
|
|
1329
|
+
# - custom_definition - Custom routing zone boundaries should be provided by the
|
|
1330
|
+
# user in input using the zones attribute. An error would be returned if the
|
|
1331
|
+
# zones attribute is null or missing in the input request.
|
|
1332
|
+
zone_source: nil
|
|
1333
|
+
)
|
|
1334
|
+
end
|
|
1335
|
+
|
|
1336
|
+
sig do
|
|
1337
|
+
override.returns(
|
|
1338
|
+
{
|
|
1339
|
+
penalty_factor: Float,
|
|
1340
|
+
zone_diameter: Float,
|
|
1341
|
+
zone_source:
|
|
1342
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::OrSymbol
|
|
1343
|
+
}
|
|
1344
|
+
)
|
|
1345
|
+
end
|
|
1346
|
+
def to_hash
|
|
1347
|
+
end
|
|
1348
|
+
|
|
1349
|
+
# Specify the source for creating boundaries of the routing zones. The default
|
|
1350
|
+
# value is “system_generated”.
|
|
1351
|
+
#
|
|
1352
|
+
# - system_generated - Routing zone boundaries are created automatically by the
|
|
1353
|
+
# optimizer based on the zone_diameter provided.
|
|
1354
|
+
# - custom_definition - Custom routing zone boundaries should be provided by the
|
|
1355
|
+
# user in input using the zones attribute. An error would be returned if the
|
|
1356
|
+
# zones attribute is null or missing in the input request.
|
|
1357
|
+
module ZoneSource
|
|
1358
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
1359
|
+
|
|
1360
|
+
TaggedSymbol =
|
|
1361
|
+
T.type_alias do
|
|
1362
|
+
T.all(
|
|
1363
|
+
Symbol,
|
|
1364
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource
|
|
1365
|
+
)
|
|
1366
|
+
end
|
|
1367
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1368
|
+
|
|
1369
|
+
SYSTEM_GENERATED =
|
|
1370
|
+
T.let(
|
|
1371
|
+
:system_generated,
|
|
1372
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::TaggedSymbol
|
|
1373
|
+
)
|
|
1374
|
+
CUSTOM_DEFINITION =
|
|
1375
|
+
T.let(
|
|
1376
|
+
:custom_definition,
|
|
1377
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::TaggedSymbol
|
|
1378
|
+
)
|
|
1379
|
+
|
|
1380
|
+
sig do
|
|
1381
|
+
override.returns(
|
|
1382
|
+
T::Array[
|
|
1383
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Grouping::RouteGrouping::ZoneSource::TaggedSymbol
|
|
1384
|
+
]
|
|
1385
|
+
)
|
|
1386
|
+
end
|
|
1387
|
+
def self.values
|
|
1388
|
+
end
|
|
1389
|
+
end
|
|
1390
|
+
end
|
|
1391
|
+
end
|
|
1392
|
+
|
|
1393
|
+
class Objective < Nextbillionai::Internal::Type::BaseModel
|
|
1394
|
+
OrHash =
|
|
1395
|
+
T.type_alias do
|
|
1396
|
+
T.any(
|
|
1397
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective,
|
|
1398
|
+
Nextbillionai::Internal::AnyHash
|
|
1399
|
+
)
|
|
1400
|
+
end
|
|
1401
|
+
|
|
1402
|
+
# Choose where the optimizer should schedule the driver’s wait time. When set to
|
|
1403
|
+
# true the driver waits at the location of the task until its time window allows
|
|
1404
|
+
# him to start the task. When set to false the driver waits at the location of the
|
|
1405
|
+
# previous task and starts driving only at such a time that makes him arrive at
|
|
1406
|
+
# the next task location in time to start the task as soon as he reaches.
|
|
1407
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1408
|
+
attr_reader :allow_early_arrival
|
|
1409
|
+
|
|
1410
|
+
sig { params(allow_early_arrival: T::Boolean).void }
|
|
1411
|
+
attr_writer :allow_early_arrival
|
|
1412
|
+
|
|
1413
|
+
# The custom parameter is used to define special objectives apart from the simpler
|
|
1414
|
+
# travel cost minimization objectives.
|
|
1415
|
+
sig do
|
|
1416
|
+
returns(
|
|
1417
|
+
T.nilable(
|
|
1418
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom
|
|
1419
|
+
)
|
|
1420
|
+
)
|
|
1421
|
+
end
|
|
1422
|
+
attr_reader :custom
|
|
1423
|
+
|
|
1424
|
+
sig do
|
|
1425
|
+
params(
|
|
1426
|
+
custom:
|
|
1427
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::OrHash
|
|
1428
|
+
).void
|
|
1429
|
+
end
|
|
1430
|
+
attr_writer :custom
|
|
1431
|
+
|
|
1432
|
+
# Specify whether to minimize the number of depots used in optimization routes.
|
|
1433
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1434
|
+
attr_reader :minimise_num_depots
|
|
1435
|
+
|
|
1436
|
+
sig { params(minimise_num_depots: T::Boolean).void }
|
|
1437
|
+
attr_writer :minimise_num_depots
|
|
1438
|
+
|
|
1439
|
+
# If the input doesn’t include features of soft constraints, customized
|
|
1440
|
+
# objectives, re-optimization, relations, max travel cost or automatic fixed cost,
|
|
1441
|
+
# then user can select “optimal” to achieve a higher-speed and higher-quality
|
|
1442
|
+
# optimization.
|
|
1443
|
+
#
|
|
1444
|
+
# If “optimal” mode is unable to process some features in the input, then it will
|
|
1445
|
+
# still goes to “flexible” mode.
|
|
1446
|
+
sig do
|
|
1447
|
+
returns(
|
|
1448
|
+
T.nilable(
|
|
1449
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::OrSymbol
|
|
1450
|
+
)
|
|
1451
|
+
)
|
|
1452
|
+
end
|
|
1453
|
+
attr_reader :solver_mode
|
|
1454
|
+
|
|
1455
|
+
sig do
|
|
1456
|
+
params(
|
|
1457
|
+
solver_mode:
|
|
1458
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::OrSymbol
|
|
1459
|
+
).void
|
|
1460
|
+
end
|
|
1461
|
+
attr_writer :solver_mode
|
|
1462
|
+
|
|
1463
|
+
# Specify the number of seconds within which the optimizer should ideally solve
|
|
1464
|
+
# the optimization request.
|
|
1465
|
+
#
|
|
1466
|
+
# Please note that:
|
|
1467
|
+
#
|
|
1468
|
+
# - In case the specified time limit is not enough to generate a solution for a
|
|
1469
|
+
# given problem set, the optimizer will continue processing until it arrives at
|
|
1470
|
+
# a solution.
|
|
1471
|
+
# - It is recommended to specify a duration of at least 5-7 minutes in case the
|
|
1472
|
+
# input problem contains a large set of tasks or vehicles.
|
|
1473
|
+
sig { returns(T.nilable(Integer)) }
|
|
1474
|
+
attr_reader :solving_time_limit
|
|
1475
|
+
|
|
1476
|
+
sig { params(solving_time_limit: Integer).void }
|
|
1477
|
+
attr_writer :solving_time_limit
|
|
1478
|
+
|
|
1479
|
+
# The travel_cost parameter specifies the type of cost used by the solver to
|
|
1480
|
+
# determine the routes.
|
|
1481
|
+
#
|
|
1482
|
+
# If the travel_cost parameter is set to distance, the solver will minimize the
|
|
1483
|
+
# total distance traveled by vehicles while determining a solution. This objective
|
|
1484
|
+
# would be useful in cases where the primary objective is to reduce fuel
|
|
1485
|
+
# consumption or travel expenses.
|
|
1486
|
+
#
|
|
1487
|
+
# If the travel_cost parameter is set to duration, the solver will minimize the
|
|
1488
|
+
# total time taken by the vehicles to complete all tasks while determining a
|
|
1489
|
+
# solution. This objective would be useful in cases where the primary objective is
|
|
1490
|
+
# to minimize completion time or maximize the number of orders fulfilled within a
|
|
1491
|
+
# given time window.
|
|
1492
|
+
#
|
|
1493
|
+
# If the travel_cost parameter is set to air_distance, the solver will try to
|
|
1494
|
+
# calculate the distance,in meters, between two points using the great-circle
|
|
1495
|
+
# distance formula (i.e., the shortest distance between two points on a sphere)
|
|
1496
|
+
# instead of the actual road distance. This would be useful in cases where the
|
|
1497
|
+
# delivery locations are far apart and the road distance between them is
|
|
1498
|
+
# significantly longer than the actual straight-line distance. For example, in
|
|
1499
|
+
# Drone Delivery services.
|
|
1500
|
+
#
|
|
1501
|
+
# If the travel_cost is set to customized the solver would use the custom cost
|
|
1502
|
+
# values provided by the user (in cost_matrix attribute) and prefer a solution
|
|
1503
|
+
# with lower overall cost. This enables the user to have greater control over the
|
|
1504
|
+
# routes preferred by the solver and hence the sequence in which the jobs are
|
|
1505
|
+
# completed.
|
|
1506
|
+
sig do
|
|
1507
|
+
returns(
|
|
1508
|
+
T.nilable(
|
|
1509
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::OrSymbol
|
|
1510
|
+
)
|
|
1511
|
+
)
|
|
1512
|
+
end
|
|
1513
|
+
attr_reader :travel_cost
|
|
1514
|
+
|
|
1515
|
+
sig do
|
|
1516
|
+
params(
|
|
1517
|
+
travel_cost:
|
|
1518
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::OrSymbol
|
|
1519
|
+
).void
|
|
1520
|
+
end
|
|
1521
|
+
attr_writer :travel_cost
|
|
1522
|
+
|
|
1523
|
+
# This attribute is used to configure the objective of the optimization job.
|
|
1524
|
+
sig do
|
|
1525
|
+
params(
|
|
1526
|
+
allow_early_arrival: T::Boolean,
|
|
1527
|
+
custom:
|
|
1528
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::OrHash,
|
|
1529
|
+
minimise_num_depots: T::Boolean,
|
|
1530
|
+
solver_mode:
|
|
1531
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::OrSymbol,
|
|
1532
|
+
solving_time_limit: Integer,
|
|
1533
|
+
travel_cost:
|
|
1534
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::OrSymbol
|
|
1535
|
+
).returns(T.attached_class)
|
|
1536
|
+
end
|
|
1537
|
+
def self.new(
|
|
1538
|
+
# Choose where the optimizer should schedule the driver’s wait time. When set to
|
|
1539
|
+
# true the driver waits at the location of the task until its time window allows
|
|
1540
|
+
# him to start the task. When set to false the driver waits at the location of the
|
|
1541
|
+
# previous task and starts driving only at such a time that makes him arrive at
|
|
1542
|
+
# the next task location in time to start the task as soon as he reaches.
|
|
1543
|
+
allow_early_arrival: nil,
|
|
1544
|
+
# The custom parameter is used to define special objectives apart from the simpler
|
|
1545
|
+
# travel cost minimization objectives.
|
|
1546
|
+
custom: nil,
|
|
1547
|
+
# Specify whether to minimize the number of depots used in optimization routes.
|
|
1548
|
+
minimise_num_depots: nil,
|
|
1549
|
+
# If the input doesn’t include features of soft constraints, customized
|
|
1550
|
+
# objectives, re-optimization, relations, max travel cost or automatic fixed cost,
|
|
1551
|
+
# then user can select “optimal” to achieve a higher-speed and higher-quality
|
|
1552
|
+
# optimization.
|
|
1553
|
+
#
|
|
1554
|
+
# If “optimal” mode is unable to process some features in the input, then it will
|
|
1555
|
+
# still goes to “flexible” mode.
|
|
1556
|
+
solver_mode: nil,
|
|
1557
|
+
# Specify the number of seconds within which the optimizer should ideally solve
|
|
1558
|
+
# the optimization request.
|
|
1559
|
+
#
|
|
1560
|
+
# Please note that:
|
|
1561
|
+
#
|
|
1562
|
+
# - In case the specified time limit is not enough to generate a solution for a
|
|
1563
|
+
# given problem set, the optimizer will continue processing until it arrives at
|
|
1564
|
+
# a solution.
|
|
1565
|
+
# - It is recommended to specify a duration of at least 5-7 minutes in case the
|
|
1566
|
+
# input problem contains a large set of tasks or vehicles.
|
|
1567
|
+
solving_time_limit: nil,
|
|
1568
|
+
# The travel_cost parameter specifies the type of cost used by the solver to
|
|
1569
|
+
# determine the routes.
|
|
1570
|
+
#
|
|
1571
|
+
# If the travel_cost parameter is set to distance, the solver will minimize the
|
|
1572
|
+
# total distance traveled by vehicles while determining a solution. This objective
|
|
1573
|
+
# would be useful in cases where the primary objective is to reduce fuel
|
|
1574
|
+
# consumption or travel expenses.
|
|
1575
|
+
#
|
|
1576
|
+
# If the travel_cost parameter is set to duration, the solver will minimize the
|
|
1577
|
+
# total time taken by the vehicles to complete all tasks while determining a
|
|
1578
|
+
# solution. This objective would be useful in cases where the primary objective is
|
|
1579
|
+
# to minimize completion time or maximize the number of orders fulfilled within a
|
|
1580
|
+
# given time window.
|
|
1581
|
+
#
|
|
1582
|
+
# If the travel_cost parameter is set to air_distance, the solver will try to
|
|
1583
|
+
# calculate the distance,in meters, between two points using the great-circle
|
|
1584
|
+
# distance formula (i.e., the shortest distance between two points on a sphere)
|
|
1585
|
+
# instead of the actual road distance. This would be useful in cases where the
|
|
1586
|
+
# delivery locations are far apart and the road distance between them is
|
|
1587
|
+
# significantly longer than the actual straight-line distance. For example, in
|
|
1588
|
+
# Drone Delivery services.
|
|
1589
|
+
#
|
|
1590
|
+
# If the travel_cost is set to customized the solver would use the custom cost
|
|
1591
|
+
# values provided by the user (in cost_matrix attribute) and prefer a solution
|
|
1592
|
+
# with lower overall cost. This enables the user to have greater control over the
|
|
1593
|
+
# routes preferred by the solver and hence the sequence in which the jobs are
|
|
1594
|
+
# completed.
|
|
1595
|
+
travel_cost: nil
|
|
1596
|
+
)
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
sig do
|
|
1600
|
+
override.returns(
|
|
1601
|
+
{
|
|
1602
|
+
allow_early_arrival: T::Boolean,
|
|
1603
|
+
custom:
|
|
1604
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom,
|
|
1605
|
+
minimise_num_depots: T::Boolean,
|
|
1606
|
+
solver_mode:
|
|
1607
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::OrSymbol,
|
|
1608
|
+
solving_time_limit: Integer,
|
|
1609
|
+
travel_cost:
|
|
1610
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::OrSymbol
|
|
1611
|
+
}
|
|
1612
|
+
)
|
|
1613
|
+
end
|
|
1614
|
+
def to_hash
|
|
1615
|
+
end
|
|
1616
|
+
|
|
1617
|
+
class Custom < Nextbillionai::Internal::Type::BaseModel
|
|
1618
|
+
OrHash =
|
|
1619
|
+
T.type_alias do
|
|
1620
|
+
T.any(
|
|
1621
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom,
|
|
1622
|
+
Nextbillionai::Internal::AnyHash
|
|
1623
|
+
)
|
|
1624
|
+
end
|
|
1625
|
+
|
|
1626
|
+
# The type parameter accepts two inputs:
|
|
1627
|
+
#
|
|
1628
|
+
# - min: This type of customized objective will minimize the metric provided in
|
|
1629
|
+
# the value parameter.
|
|
1630
|
+
# - min-max: This type of customized objective will approximate an even
|
|
1631
|
+
# distribution of the metric provided in the value parameter, among all the
|
|
1632
|
+
# routes in solution.
|
|
1633
|
+
#
|
|
1634
|
+
# Please note that type is mandatory only when using custom attribute.
|
|
1635
|
+
sig do
|
|
1636
|
+
returns(
|
|
1637
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::OrSymbol
|
|
1638
|
+
)
|
|
1639
|
+
end
|
|
1640
|
+
attr_accessor :type
|
|
1641
|
+
|
|
1642
|
+
# The value parameter accepts four inputs, two of them are valid for min type and
|
|
1643
|
+
# other two are valid for min-max type custom objective. Let’s look at the values
|
|
1644
|
+
# for min type objective:
|
|
1645
|
+
#
|
|
1646
|
+
# - vehicles: Solver will minimize the number of vehicles used in the solution.
|
|
1647
|
+
# - completion_time: Solver will minimize the total time taken to complete all
|
|
1648
|
+
# tasks.
|
|
1649
|
+
#
|
|
1650
|
+
# The next set of values are acceptable when type is set to min-max.
|
|
1651
|
+
#
|
|
1652
|
+
# - tasks: Solver will evenly distribute the tasks on each route.
|
|
1653
|
+
# - travel_cost: Solver will assign tasks such that the traveling cost of each
|
|
1654
|
+
# route is within a close range of other routes. The travel cost metric
|
|
1655
|
+
# considered here is the one set using objective.travel_cost .
|
|
1656
|
+
#
|
|
1657
|
+
# Please note that value is mandatory only when using custom attribute. The above
|
|
1658
|
+
# values provide flexibility to tune the optimization algorithm to fulfill
|
|
1659
|
+
# practical objectives beyond the relatively simpler time or distance minimization
|
|
1660
|
+
# approaches.
|
|
1661
|
+
sig do
|
|
1662
|
+
returns(
|
|
1663
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::OrSymbol
|
|
1664
|
+
)
|
|
1665
|
+
end
|
|
1666
|
+
attr_accessor :value
|
|
1667
|
+
|
|
1668
|
+
# The custom parameter is used to define special objectives apart from the simpler
|
|
1669
|
+
# travel cost minimization objectives.
|
|
1670
|
+
sig do
|
|
1671
|
+
params(
|
|
1672
|
+
type:
|
|
1673
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::OrSymbol,
|
|
1674
|
+
value:
|
|
1675
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::OrSymbol
|
|
1676
|
+
).returns(T.attached_class)
|
|
1677
|
+
end
|
|
1678
|
+
def self.new(
|
|
1679
|
+
# The type parameter accepts two inputs:
|
|
1680
|
+
#
|
|
1681
|
+
# - min: This type of customized objective will minimize the metric provided in
|
|
1682
|
+
# the value parameter.
|
|
1683
|
+
# - min-max: This type of customized objective will approximate an even
|
|
1684
|
+
# distribution of the metric provided in the value parameter, among all the
|
|
1685
|
+
# routes in solution.
|
|
1686
|
+
#
|
|
1687
|
+
# Please note that type is mandatory only when using custom attribute.
|
|
1688
|
+
type:,
|
|
1689
|
+
# The value parameter accepts four inputs, two of them are valid for min type and
|
|
1690
|
+
# other two are valid for min-max type custom objective. Let’s look at the values
|
|
1691
|
+
# for min type objective:
|
|
1692
|
+
#
|
|
1693
|
+
# - vehicles: Solver will minimize the number of vehicles used in the solution.
|
|
1694
|
+
# - completion_time: Solver will minimize the total time taken to complete all
|
|
1695
|
+
# tasks.
|
|
1696
|
+
#
|
|
1697
|
+
# The next set of values are acceptable when type is set to min-max.
|
|
1698
|
+
#
|
|
1699
|
+
# - tasks: Solver will evenly distribute the tasks on each route.
|
|
1700
|
+
# - travel_cost: Solver will assign tasks such that the traveling cost of each
|
|
1701
|
+
# route is within a close range of other routes. The travel cost metric
|
|
1702
|
+
# considered here is the one set using objective.travel_cost .
|
|
1703
|
+
#
|
|
1704
|
+
# Please note that value is mandatory only when using custom attribute. The above
|
|
1705
|
+
# values provide flexibility to tune the optimization algorithm to fulfill
|
|
1706
|
+
# practical objectives beyond the relatively simpler time or distance minimization
|
|
1707
|
+
# approaches.
|
|
1708
|
+
value:
|
|
1709
|
+
)
|
|
1710
|
+
end
|
|
1711
|
+
|
|
1712
|
+
sig do
|
|
1713
|
+
override.returns(
|
|
1714
|
+
{
|
|
1715
|
+
type:
|
|
1716
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::OrSymbol,
|
|
1717
|
+
value:
|
|
1718
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::OrSymbol
|
|
1719
|
+
}
|
|
1720
|
+
)
|
|
1721
|
+
end
|
|
1722
|
+
def to_hash
|
|
1723
|
+
end
|
|
1724
|
+
|
|
1725
|
+
# The type parameter accepts two inputs:
|
|
1726
|
+
#
|
|
1727
|
+
# - min: This type of customized objective will minimize the metric provided in
|
|
1728
|
+
# the value parameter.
|
|
1729
|
+
# - min-max: This type of customized objective will approximate an even
|
|
1730
|
+
# distribution of the metric provided in the value parameter, among all the
|
|
1731
|
+
# routes in solution.
|
|
1732
|
+
#
|
|
1733
|
+
# Please note that type is mandatory only when using custom attribute.
|
|
1734
|
+
module Type
|
|
1735
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
1736
|
+
|
|
1737
|
+
TaggedSymbol =
|
|
1738
|
+
T.type_alias do
|
|
1739
|
+
T.all(
|
|
1740
|
+
Symbol,
|
|
1741
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type
|
|
1742
|
+
)
|
|
1743
|
+
end
|
|
1744
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1745
|
+
|
|
1746
|
+
MIN =
|
|
1747
|
+
T.let(
|
|
1748
|
+
:min,
|
|
1749
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::TaggedSymbol
|
|
1750
|
+
)
|
|
1751
|
+
MIN_MAX =
|
|
1752
|
+
T.let(
|
|
1753
|
+
:"min-max",
|
|
1754
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::TaggedSymbol
|
|
1755
|
+
)
|
|
1756
|
+
|
|
1757
|
+
sig do
|
|
1758
|
+
override.returns(
|
|
1759
|
+
T::Array[
|
|
1760
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Type::TaggedSymbol
|
|
1761
|
+
]
|
|
1762
|
+
)
|
|
1763
|
+
end
|
|
1764
|
+
def self.values
|
|
1765
|
+
end
|
|
1766
|
+
end
|
|
1767
|
+
|
|
1768
|
+
# The value parameter accepts four inputs, two of them are valid for min type and
|
|
1769
|
+
# other two are valid for min-max type custom objective. Let’s look at the values
|
|
1770
|
+
# for min type objective:
|
|
1771
|
+
#
|
|
1772
|
+
# - vehicles: Solver will minimize the number of vehicles used in the solution.
|
|
1773
|
+
# - completion_time: Solver will minimize the total time taken to complete all
|
|
1774
|
+
# tasks.
|
|
1775
|
+
#
|
|
1776
|
+
# The next set of values are acceptable when type is set to min-max.
|
|
1777
|
+
#
|
|
1778
|
+
# - tasks: Solver will evenly distribute the tasks on each route.
|
|
1779
|
+
# - travel_cost: Solver will assign tasks such that the traveling cost of each
|
|
1780
|
+
# route is within a close range of other routes. The travel cost metric
|
|
1781
|
+
# considered here is the one set using objective.travel_cost .
|
|
1782
|
+
#
|
|
1783
|
+
# Please note that value is mandatory only when using custom attribute. The above
|
|
1784
|
+
# values provide flexibility to tune the optimization algorithm to fulfill
|
|
1785
|
+
# practical objectives beyond the relatively simpler time or distance minimization
|
|
1786
|
+
# approaches.
|
|
1787
|
+
module Value
|
|
1788
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
1789
|
+
|
|
1790
|
+
TaggedSymbol =
|
|
1791
|
+
T.type_alias do
|
|
1792
|
+
T.all(
|
|
1793
|
+
Symbol,
|
|
1794
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value
|
|
1795
|
+
)
|
|
1796
|
+
end
|
|
1797
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1798
|
+
|
|
1799
|
+
VEHICLES =
|
|
1800
|
+
T.let(
|
|
1801
|
+
:vehicles,
|
|
1802
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::TaggedSymbol
|
|
1803
|
+
)
|
|
1804
|
+
COMPLETION_TIME =
|
|
1805
|
+
T.let(
|
|
1806
|
+
:completion_time,
|
|
1807
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::TaggedSymbol
|
|
1808
|
+
)
|
|
1809
|
+
TRAVEL_COST =
|
|
1810
|
+
T.let(
|
|
1811
|
+
:travel_cost,
|
|
1812
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::TaggedSymbol
|
|
1813
|
+
)
|
|
1814
|
+
TASKS =
|
|
1815
|
+
T.let(
|
|
1816
|
+
:tasks,
|
|
1817
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::TaggedSymbol
|
|
1818
|
+
)
|
|
1819
|
+
|
|
1820
|
+
sig do
|
|
1821
|
+
override.returns(
|
|
1822
|
+
T::Array[
|
|
1823
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::Custom::Value::TaggedSymbol
|
|
1824
|
+
]
|
|
1825
|
+
)
|
|
1826
|
+
end
|
|
1827
|
+
def self.values
|
|
1828
|
+
end
|
|
1829
|
+
end
|
|
1830
|
+
end
|
|
1831
|
+
|
|
1832
|
+
# If the input doesn’t include features of soft constraints, customized
|
|
1833
|
+
# objectives, re-optimization, relations, max travel cost or automatic fixed cost,
|
|
1834
|
+
# then user can select “optimal” to achieve a higher-speed and higher-quality
|
|
1835
|
+
# optimization.
|
|
1836
|
+
#
|
|
1837
|
+
# If “optimal” mode is unable to process some features in the input, then it will
|
|
1838
|
+
# still goes to “flexible” mode.
|
|
1839
|
+
module SolverMode
|
|
1840
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
1841
|
+
|
|
1842
|
+
TaggedSymbol =
|
|
1843
|
+
T.type_alias do
|
|
1844
|
+
T.all(
|
|
1845
|
+
Symbol,
|
|
1846
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode
|
|
1847
|
+
)
|
|
1848
|
+
end
|
|
1849
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1850
|
+
|
|
1851
|
+
FLEXIBLE =
|
|
1852
|
+
T.let(
|
|
1853
|
+
:flexible,
|
|
1854
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::TaggedSymbol
|
|
1855
|
+
)
|
|
1856
|
+
FAST =
|
|
1857
|
+
T.let(
|
|
1858
|
+
:fast,
|
|
1859
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::TaggedSymbol
|
|
1860
|
+
)
|
|
1861
|
+
INTERNAL =
|
|
1862
|
+
T.let(
|
|
1863
|
+
:internal,
|
|
1864
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::TaggedSymbol
|
|
1865
|
+
)
|
|
1866
|
+
|
|
1867
|
+
sig do
|
|
1868
|
+
override.returns(
|
|
1869
|
+
T::Array[
|
|
1870
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::SolverMode::TaggedSymbol
|
|
1871
|
+
]
|
|
1872
|
+
)
|
|
1873
|
+
end
|
|
1874
|
+
def self.values
|
|
1875
|
+
end
|
|
1876
|
+
end
|
|
1877
|
+
|
|
1878
|
+
# The travel_cost parameter specifies the type of cost used by the solver to
|
|
1879
|
+
# determine the routes.
|
|
1880
|
+
#
|
|
1881
|
+
# If the travel_cost parameter is set to distance, the solver will minimize the
|
|
1882
|
+
# total distance traveled by vehicles while determining a solution. This objective
|
|
1883
|
+
# would be useful in cases where the primary objective is to reduce fuel
|
|
1884
|
+
# consumption or travel expenses.
|
|
1885
|
+
#
|
|
1886
|
+
# If the travel_cost parameter is set to duration, the solver will minimize the
|
|
1887
|
+
# total time taken by the vehicles to complete all tasks while determining a
|
|
1888
|
+
# solution. This objective would be useful in cases where the primary objective is
|
|
1889
|
+
# to minimize completion time or maximize the number of orders fulfilled within a
|
|
1890
|
+
# given time window.
|
|
1891
|
+
#
|
|
1892
|
+
# If the travel_cost parameter is set to air_distance, the solver will try to
|
|
1893
|
+
# calculate the distance,in meters, between two points using the great-circle
|
|
1894
|
+
# distance formula (i.e., the shortest distance between two points on a sphere)
|
|
1895
|
+
# instead of the actual road distance. This would be useful in cases where the
|
|
1896
|
+
# delivery locations are far apart and the road distance between them is
|
|
1897
|
+
# significantly longer than the actual straight-line distance. For example, in
|
|
1898
|
+
# Drone Delivery services.
|
|
1899
|
+
#
|
|
1900
|
+
# If the travel_cost is set to customized the solver would use the custom cost
|
|
1901
|
+
# values provided by the user (in cost_matrix attribute) and prefer a solution
|
|
1902
|
+
# with lower overall cost. This enables the user to have greater control over the
|
|
1903
|
+
# routes preferred by the solver and hence the sequence in which the jobs are
|
|
1904
|
+
# completed.
|
|
1905
|
+
module TravelCost
|
|
1906
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
1907
|
+
|
|
1908
|
+
TaggedSymbol =
|
|
1909
|
+
T.type_alias do
|
|
1910
|
+
T.all(
|
|
1911
|
+
Symbol,
|
|
1912
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost
|
|
1913
|
+
)
|
|
1914
|
+
end
|
|
1915
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1916
|
+
|
|
1917
|
+
DURATION =
|
|
1918
|
+
T.let(
|
|
1919
|
+
:duration,
|
|
1920
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::TaggedSymbol
|
|
1921
|
+
)
|
|
1922
|
+
DISTANCE =
|
|
1923
|
+
T.let(
|
|
1924
|
+
:distance,
|
|
1925
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::TaggedSymbol
|
|
1926
|
+
)
|
|
1927
|
+
AIR_DISTANCE =
|
|
1928
|
+
T.let(
|
|
1929
|
+
:air_distance,
|
|
1930
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::TaggedSymbol
|
|
1931
|
+
)
|
|
1932
|
+
CUSTOMIZED =
|
|
1933
|
+
T.let(
|
|
1934
|
+
:customized,
|
|
1935
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::TaggedSymbol
|
|
1936
|
+
)
|
|
1937
|
+
|
|
1938
|
+
sig do
|
|
1939
|
+
override.returns(
|
|
1940
|
+
T::Array[
|
|
1941
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Objective::TravelCost::TaggedSymbol
|
|
1942
|
+
]
|
|
1943
|
+
)
|
|
1944
|
+
end
|
|
1945
|
+
def self.values
|
|
1946
|
+
end
|
|
1947
|
+
end
|
|
1948
|
+
end
|
|
1949
|
+
|
|
1950
|
+
class Routing < Nextbillionai::Internal::Type::BaseModel
|
|
1951
|
+
OrHash =
|
|
1952
|
+
T.type_alias do
|
|
1953
|
+
T.any(
|
|
1954
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing,
|
|
1955
|
+
Nextbillionai::Internal::AnyHash
|
|
1956
|
+
)
|
|
1957
|
+
end
|
|
1958
|
+
|
|
1959
|
+
sig do
|
|
1960
|
+
returns(
|
|
1961
|
+
T.nilable(
|
|
1962
|
+
T::Array[
|
|
1963
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::OrSymbol
|
|
1964
|
+
]
|
|
1965
|
+
)
|
|
1966
|
+
)
|
|
1967
|
+
end
|
|
1968
|
+
attr_reader :allow
|
|
1969
|
+
|
|
1970
|
+
sig do
|
|
1971
|
+
params(
|
|
1972
|
+
allow:
|
|
1973
|
+
T::Array[
|
|
1974
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::OrSymbol
|
|
1975
|
+
]
|
|
1976
|
+
).void
|
|
1977
|
+
end
|
|
1978
|
+
attr_writer :allow
|
|
1979
|
+
|
|
1980
|
+
# Specify the type of objects/maneuvers that the route should avoid.
|
|
1981
|
+
#
|
|
1982
|
+
# Please note that:
|
|
1983
|
+
#
|
|
1984
|
+
# - The values are case-sensitive.
|
|
1985
|
+
# - When using avoid:bbox feature, users need to specify the boundaries of the
|
|
1986
|
+
# bounding box to be avoided. Multiple bounding boxes can be provided
|
|
1987
|
+
# simultaneously. Please note that bounding box is a hard filter and if it
|
|
1988
|
+
# blocks all possible routes between given locations, a 4xx error is returned.
|
|
1989
|
+
# Mention the bounding box boundaries in the following format: bbox:
|
|
1990
|
+
# min_latitude,min_longitude,max_latitude,max_longitude.
|
|
1991
|
+
# - When using avoid=sharp_turn, the range of allowed turn angles is \[120,240\]
|
|
1992
|
+
# in the clockwise direction from the current road. Any roads with turn angles
|
|
1993
|
+
# outside the range will be avoided.
|
|
1994
|
+
# - If none is provided along with other values, an error is returned as a valid
|
|
1995
|
+
# route is not feasible.
|
|
1996
|
+
sig do
|
|
1997
|
+
returns(
|
|
1998
|
+
T.nilable(
|
|
1999
|
+
T::Array[
|
|
2000
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::OrSymbol
|
|
2001
|
+
]
|
|
2002
|
+
)
|
|
2003
|
+
)
|
|
2004
|
+
end
|
|
2005
|
+
attr_reader :avoid
|
|
2006
|
+
|
|
2007
|
+
sig do
|
|
2008
|
+
params(
|
|
2009
|
+
avoid:
|
|
2010
|
+
T::Array[
|
|
2011
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::OrSymbol
|
|
2012
|
+
]
|
|
2013
|
+
).void
|
|
2014
|
+
end
|
|
2015
|
+
attr_writer :avoid
|
|
2016
|
+
|
|
2017
|
+
# Use this parameter to apply a single speed value for all ETA and drive time
|
|
2018
|
+
# calculations. In case, the travel_cost is set to duration then setting this
|
|
2019
|
+
# parameter also impacts the cost of the solution.
|
|
2020
|
+
sig do
|
|
2021
|
+
returns(
|
|
2022
|
+
T.nilable(
|
|
2023
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::OrSymbol
|
|
2024
|
+
)
|
|
2025
|
+
)
|
|
2026
|
+
end
|
|
2027
|
+
attr_reader :context
|
|
2028
|
+
|
|
2029
|
+
sig do
|
|
2030
|
+
params(
|
|
2031
|
+
context:
|
|
2032
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::OrSymbol
|
|
2033
|
+
).void
|
|
2034
|
+
end
|
|
2035
|
+
attr_writer :context
|
|
2036
|
+
|
|
2037
|
+
# Specify if crossing an international border is allowed for operations near
|
|
2038
|
+
# border areas. When set to false, the API will prohibit any routes crossing
|
|
2039
|
+
# international borders. When set to true, the service will return routes which
|
|
2040
|
+
# cross the borders between countries, if required for the given set locations
|
|
2041
|
+
#
|
|
2042
|
+
# This feature is available in North America region only. Please get in touch with
|
|
2043
|
+
# [support@nextbillion.ai](mailto:support@nextbillion.ai) to enquire/enable other
|
|
2044
|
+
# areas.
|
|
2045
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
2046
|
+
attr_reader :cross_border
|
|
2047
|
+
|
|
2048
|
+
sig { params(cross_border: T::Boolean).void }
|
|
2049
|
+
attr_writer :cross_border
|
|
2050
|
+
|
|
2051
|
+
# Specify if the optimizer should cache the matrix result set (containing ETAs and
|
|
2052
|
+
# distances) for the given set of locations in the request. Once the results are
|
|
2053
|
+
# cached, the optimizer can use it during the next 60 mins if exactly the same set
|
|
2054
|
+
# of locations are provided again. Please note that if a cached result is
|
|
2055
|
+
# retrieved, the timer is reset and that result will be available for another 60
|
|
2056
|
+
# mins.
|
|
2057
|
+
#
|
|
2058
|
+
# If the users want to regenerate the result set, they can set this parameter to
|
|
2059
|
+
# true and optimizer will not use the cached results.
|
|
2060
|
+
#
|
|
2061
|
+
# This feature is helpful in expediting the optimization process and generate
|
|
2062
|
+
# results quickly. It also helps users to quickly simulate route plans for
|
|
2063
|
+
# different combinations of constraints for a given set of locations.
|
|
2064
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
2065
|
+
attr_reader :disable_cache
|
|
2066
|
+
|
|
2067
|
+
sig { params(disable_cache: T::Boolean).void }
|
|
2068
|
+
attr_writer :disable_cache
|
|
2069
|
+
|
|
2070
|
+
# Specify the type of hazardous material being carried and the service will avoid
|
|
2071
|
+
# roads which are not suitable for the type of goods specified. Provide multiple
|
|
2072
|
+
# values separated by a comma , .
|
|
2073
|
+
#
|
|
2074
|
+
# Please note that this parameter is effective only when mode=truck.
|
|
2075
|
+
sig do
|
|
2076
|
+
returns(
|
|
2077
|
+
T.nilable(
|
|
2078
|
+
T::Array[
|
|
2079
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::OrSymbol
|
|
2080
|
+
]
|
|
2081
|
+
)
|
|
2082
|
+
)
|
|
2083
|
+
end
|
|
2084
|
+
attr_reader :hazmat_type
|
|
2085
|
+
|
|
2086
|
+
sig do
|
|
2087
|
+
params(
|
|
2088
|
+
hazmat_type:
|
|
2089
|
+
T::Array[
|
|
2090
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::OrSymbol
|
|
2091
|
+
]
|
|
2092
|
+
).void
|
|
2093
|
+
end
|
|
2094
|
+
attr_writer :hazmat_type
|
|
2095
|
+
|
|
2096
|
+
# Define the traveling mode to be used for determining the optimized routes.
|
|
2097
|
+
sig do
|
|
2098
|
+
returns(
|
|
2099
|
+
T.nilable(
|
|
2100
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::OrSymbol
|
|
2101
|
+
)
|
|
2102
|
+
)
|
|
2103
|
+
end
|
|
2104
|
+
attr_reader :mode
|
|
2105
|
+
|
|
2106
|
+
sig do
|
|
2107
|
+
params(
|
|
2108
|
+
mode:
|
|
2109
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::OrSymbol
|
|
2110
|
+
).void
|
|
2111
|
+
end
|
|
2112
|
+
attr_writer :mode
|
|
2113
|
+
|
|
2114
|
+
# Defines all the vehicle profiles. profiles is implemented as a dictionary of
|
|
2115
|
+
# objects where each profile name is the unique key and the associated value is an
|
|
2116
|
+
# object describing the routing properties of that profile. All routing properties
|
|
2117
|
+
# available in options.routing can be added as values for a given profile.
|
|
2118
|
+
#
|
|
2119
|
+
# Please note:
|
|
2120
|
+
#
|
|
2121
|
+
# - The routing properties configured using options.routing (and not part of any
|
|
2122
|
+
# \profiles\) are considered as default route settings i.e. they are applied to
|
|
2123
|
+
# vehicles which are not associated with any profile.
|
|
2124
|
+
# - The default route settings are independent from those defined for any profiles
|
|
2125
|
+
# . Consequently, for vehicles which are tagged to a given profile, only the
|
|
2126
|
+
# routing properties configured for the given profile will apply.
|
|
2127
|
+
# - If the "mode" is not specified for any profile, by default it is considered to
|
|
2128
|
+
# be car .
|
|
2129
|
+
# - "default" is a reserved keyword and can not be used as the name for any custom
|
|
2130
|
+
# profile.
|
|
2131
|
+
# - profiles can't be nested in other profiles.
|
|
2132
|
+
# - The number of profiles, including default route settings, are limited to
|
|
2133
|
+
#
|
|
2134
|
+
# - 15, if 0 < number of location <= 100
|
|
2135
|
+
# - 6, if 100 < number of location <= 600,
|
|
2136
|
+
# - 2, if 600 < number of location <= 1200,
|
|
2137
|
+
# - 1, if number of location > 1200
|
|
2138
|
+
#
|
|
2139
|
+
# Routing profiles attribute is useful for configuring fleets containing multiple
|
|
2140
|
+
# vehicles types. Check
|
|
2141
|
+
# [Routing Profiles](https://docs.nextbillion.ai/docs/optimization/api/route-optimization-flexible/tutorials/routing-profiles)
|
|
2142
|
+
# tutorial to learn more.
|
|
2143
|
+
sig { returns(T.nilable(T.anything)) }
|
|
2144
|
+
attr_reader :profiles
|
|
2145
|
+
|
|
2146
|
+
sig { params(profiles: T.anything).void }
|
|
2147
|
+
attr_writer :profiles
|
|
2148
|
+
|
|
2149
|
+
# Specify the general time when the job needs to be carried out. The time should
|
|
2150
|
+
# be expressed as an UNIX timestamp in seconds format. The solver will take into
|
|
2151
|
+
# account the general traffic conditions at the given time to determine the routes
|
|
2152
|
+
# and their ETAs.
|
|
2153
|
+
sig { returns(T.nilable(Integer)) }
|
|
2154
|
+
attr_reader :traffic_timestamp
|
|
2155
|
+
|
|
2156
|
+
sig { params(traffic_timestamp: Integer).void }
|
|
2157
|
+
attr_writer :traffic_timestamp
|
|
2158
|
+
|
|
2159
|
+
# Specify the total load per axle (including the weight of trailers and shipped
|
|
2160
|
+
# goods) of the truck, in tonnes. When used, the optimizer will use only those
|
|
2161
|
+
# routes which are legally allowed to carry the load specified per axle.
|
|
2162
|
+
#
|
|
2163
|
+
# Please note this parameter is effective only when mode=truck.
|
|
2164
|
+
sig { returns(T.nilable(Float)) }
|
|
2165
|
+
attr_reader :truck_axle_load
|
|
2166
|
+
|
|
2167
|
+
sig { params(truck_axle_load: Float).void }
|
|
2168
|
+
attr_writer :truck_axle_load
|
|
2169
|
+
|
|
2170
|
+
# Specify the truck dimensions, in centimeters, in the format of
|
|
2171
|
+
# “height,width,length”. Please note that this parameter is effective only when
|
|
2172
|
+
# mode=truck.
|
|
2173
|
+
sig { returns(T.nilable(String)) }
|
|
2174
|
+
attr_reader :truck_size
|
|
2175
|
+
|
|
2176
|
+
sig { params(truck_size: String).void }
|
|
2177
|
+
attr_writer :truck_size
|
|
2178
|
+
|
|
2179
|
+
# Specify the truck weight including the trailers and shipped goods, in kilograms.
|
|
2180
|
+
# Please note that this parameter is effective only when mode=truck.
|
|
2181
|
+
sig { returns(T.nilable(Integer)) }
|
|
2182
|
+
attr_reader :truck_weight
|
|
2183
|
+
|
|
2184
|
+
sig { params(truck_weight: Integer).void }
|
|
2185
|
+
attr_writer :truck_weight
|
|
2186
|
+
|
|
2187
|
+
# This attribute is used to define the routing configurations for the optimization
|
|
2188
|
+
# job.
|
|
2189
|
+
sig do
|
|
2190
|
+
params(
|
|
2191
|
+
allow:
|
|
2192
|
+
T::Array[
|
|
2193
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::OrSymbol
|
|
2194
|
+
],
|
|
2195
|
+
avoid:
|
|
2196
|
+
T::Array[
|
|
2197
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::OrSymbol
|
|
2198
|
+
],
|
|
2199
|
+
context:
|
|
2200
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::OrSymbol,
|
|
2201
|
+
cross_border: T::Boolean,
|
|
2202
|
+
disable_cache: T::Boolean,
|
|
2203
|
+
hazmat_type:
|
|
2204
|
+
T::Array[
|
|
2205
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::OrSymbol
|
|
2206
|
+
],
|
|
2207
|
+
mode:
|
|
2208
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::OrSymbol,
|
|
2209
|
+
profiles: T.anything,
|
|
2210
|
+
traffic_timestamp: Integer,
|
|
2211
|
+
truck_axle_load: Float,
|
|
2212
|
+
truck_size: String,
|
|
2213
|
+
truck_weight: Integer
|
|
2214
|
+
).returns(T.attached_class)
|
|
2215
|
+
end
|
|
2216
|
+
def self.new(
|
|
2217
|
+
allow: nil,
|
|
2218
|
+
# Specify the type of objects/maneuvers that the route should avoid.
|
|
2219
|
+
#
|
|
2220
|
+
# Please note that:
|
|
2221
|
+
#
|
|
2222
|
+
# - The values are case-sensitive.
|
|
2223
|
+
# - When using avoid:bbox feature, users need to specify the boundaries of the
|
|
2224
|
+
# bounding box to be avoided. Multiple bounding boxes can be provided
|
|
2225
|
+
# simultaneously. Please note that bounding box is a hard filter and if it
|
|
2226
|
+
# blocks all possible routes between given locations, a 4xx error is returned.
|
|
2227
|
+
# Mention the bounding box boundaries in the following format: bbox:
|
|
2228
|
+
# min_latitude,min_longitude,max_latitude,max_longitude.
|
|
2229
|
+
# - When using avoid=sharp_turn, the range of allowed turn angles is \[120,240\]
|
|
2230
|
+
# in the clockwise direction from the current road. Any roads with turn angles
|
|
2231
|
+
# outside the range will be avoided.
|
|
2232
|
+
# - If none is provided along with other values, an error is returned as a valid
|
|
2233
|
+
# route is not feasible.
|
|
2234
|
+
avoid: nil,
|
|
2235
|
+
# Use this parameter to apply a single speed value for all ETA and drive time
|
|
2236
|
+
# calculations. In case, the travel_cost is set to duration then setting this
|
|
2237
|
+
# parameter also impacts the cost of the solution.
|
|
2238
|
+
context: nil,
|
|
2239
|
+
# Specify if crossing an international border is allowed for operations near
|
|
2240
|
+
# border areas. When set to false, the API will prohibit any routes crossing
|
|
2241
|
+
# international borders. When set to true, the service will return routes which
|
|
2242
|
+
# cross the borders between countries, if required for the given set locations
|
|
2243
|
+
#
|
|
2244
|
+
# This feature is available in North America region only. Please get in touch with
|
|
2245
|
+
# [support@nextbillion.ai](mailto:support@nextbillion.ai) to enquire/enable other
|
|
2246
|
+
# areas.
|
|
2247
|
+
cross_border: nil,
|
|
2248
|
+
# Specify if the optimizer should cache the matrix result set (containing ETAs and
|
|
2249
|
+
# distances) for the given set of locations in the request. Once the results are
|
|
2250
|
+
# cached, the optimizer can use it during the next 60 mins if exactly the same set
|
|
2251
|
+
# of locations are provided again. Please note that if a cached result is
|
|
2252
|
+
# retrieved, the timer is reset and that result will be available for another 60
|
|
2253
|
+
# mins.
|
|
2254
|
+
#
|
|
2255
|
+
# If the users want to regenerate the result set, they can set this parameter to
|
|
2256
|
+
# true and optimizer will not use the cached results.
|
|
2257
|
+
#
|
|
2258
|
+
# This feature is helpful in expediting the optimization process and generate
|
|
2259
|
+
# results quickly. It also helps users to quickly simulate route plans for
|
|
2260
|
+
# different combinations of constraints for a given set of locations.
|
|
2261
|
+
disable_cache: nil,
|
|
2262
|
+
# Specify the type of hazardous material being carried and the service will avoid
|
|
2263
|
+
# roads which are not suitable for the type of goods specified. Provide multiple
|
|
2264
|
+
# values separated by a comma , .
|
|
2265
|
+
#
|
|
2266
|
+
# Please note that this parameter is effective only when mode=truck.
|
|
2267
|
+
hazmat_type: nil,
|
|
2268
|
+
# Define the traveling mode to be used for determining the optimized routes.
|
|
2269
|
+
mode: nil,
|
|
2270
|
+
# Defines all the vehicle profiles. profiles is implemented as a dictionary of
|
|
2271
|
+
# objects where each profile name is the unique key and the associated value is an
|
|
2272
|
+
# object describing the routing properties of that profile. All routing properties
|
|
2273
|
+
# available in options.routing can be added as values for a given profile.
|
|
2274
|
+
#
|
|
2275
|
+
# Please note:
|
|
2276
|
+
#
|
|
2277
|
+
# - The routing properties configured using options.routing (and not part of any
|
|
2278
|
+
# \profiles\) are considered as default route settings i.e. they are applied to
|
|
2279
|
+
# vehicles which are not associated with any profile.
|
|
2280
|
+
# - The default route settings are independent from those defined for any profiles
|
|
2281
|
+
# . Consequently, for vehicles which are tagged to a given profile, only the
|
|
2282
|
+
# routing properties configured for the given profile will apply.
|
|
2283
|
+
# - If the "mode" is not specified for any profile, by default it is considered to
|
|
2284
|
+
# be car .
|
|
2285
|
+
# - "default" is a reserved keyword and can not be used as the name for any custom
|
|
2286
|
+
# profile.
|
|
2287
|
+
# - profiles can't be nested in other profiles.
|
|
2288
|
+
# - The number of profiles, including default route settings, are limited to
|
|
2289
|
+
#
|
|
2290
|
+
# - 15, if 0 < number of location <= 100
|
|
2291
|
+
# - 6, if 100 < number of location <= 600,
|
|
2292
|
+
# - 2, if 600 < number of location <= 1200,
|
|
2293
|
+
# - 1, if number of location > 1200
|
|
2294
|
+
#
|
|
2295
|
+
# Routing profiles attribute is useful for configuring fleets containing multiple
|
|
2296
|
+
# vehicles types. Check
|
|
2297
|
+
# [Routing Profiles](https://docs.nextbillion.ai/docs/optimization/api/route-optimization-flexible/tutorials/routing-profiles)
|
|
2298
|
+
# tutorial to learn more.
|
|
2299
|
+
profiles: nil,
|
|
2300
|
+
# Specify the general time when the job needs to be carried out. The time should
|
|
2301
|
+
# be expressed as an UNIX timestamp in seconds format. The solver will take into
|
|
2302
|
+
# account the general traffic conditions at the given time to determine the routes
|
|
2303
|
+
# and their ETAs.
|
|
2304
|
+
traffic_timestamp: nil,
|
|
2305
|
+
# Specify the total load per axle (including the weight of trailers and shipped
|
|
2306
|
+
# goods) of the truck, in tonnes. When used, the optimizer will use only those
|
|
2307
|
+
# routes which are legally allowed to carry the load specified per axle.
|
|
2308
|
+
#
|
|
2309
|
+
# Please note this parameter is effective only when mode=truck.
|
|
2310
|
+
truck_axle_load: nil,
|
|
2311
|
+
# Specify the truck dimensions, in centimeters, in the format of
|
|
2312
|
+
# “height,width,length”. Please note that this parameter is effective only when
|
|
2313
|
+
# mode=truck.
|
|
2314
|
+
truck_size: nil,
|
|
2315
|
+
# Specify the truck weight including the trailers and shipped goods, in kilograms.
|
|
2316
|
+
# Please note that this parameter is effective only when mode=truck.
|
|
2317
|
+
truck_weight: nil
|
|
2318
|
+
)
|
|
2319
|
+
end
|
|
2320
|
+
|
|
2321
|
+
sig do
|
|
2322
|
+
override.returns(
|
|
2323
|
+
{
|
|
2324
|
+
allow:
|
|
2325
|
+
T::Array[
|
|
2326
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::OrSymbol
|
|
2327
|
+
],
|
|
2328
|
+
avoid:
|
|
2329
|
+
T::Array[
|
|
2330
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::OrSymbol
|
|
2331
|
+
],
|
|
2332
|
+
context:
|
|
2333
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::OrSymbol,
|
|
2334
|
+
cross_border: T::Boolean,
|
|
2335
|
+
disable_cache: T::Boolean,
|
|
2336
|
+
hazmat_type:
|
|
2337
|
+
T::Array[
|
|
2338
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::OrSymbol
|
|
2339
|
+
],
|
|
2340
|
+
mode:
|
|
2341
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::OrSymbol,
|
|
2342
|
+
profiles: T.anything,
|
|
2343
|
+
traffic_timestamp: Integer,
|
|
2344
|
+
truck_axle_load: Float,
|
|
2345
|
+
truck_size: String,
|
|
2346
|
+
truck_weight: Integer
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2349
|
+
end
|
|
2350
|
+
def to_hash
|
|
2351
|
+
end
|
|
2352
|
+
|
|
2353
|
+
module Allow
|
|
2354
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2355
|
+
|
|
2356
|
+
TaggedSymbol =
|
|
2357
|
+
T.type_alias do
|
|
2358
|
+
T.all(
|
|
2359
|
+
Symbol,
|
|
2360
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow
|
|
2361
|
+
)
|
|
2362
|
+
end
|
|
2363
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2364
|
+
|
|
2365
|
+
TAXI =
|
|
2366
|
+
T.let(
|
|
2367
|
+
:taxi,
|
|
2368
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::TaggedSymbol
|
|
2369
|
+
)
|
|
2370
|
+
HOV =
|
|
2371
|
+
T.let(
|
|
2372
|
+
:hov,
|
|
2373
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::TaggedSymbol
|
|
2374
|
+
)
|
|
2375
|
+
|
|
2376
|
+
sig do
|
|
2377
|
+
override.returns(
|
|
2378
|
+
T::Array[
|
|
2379
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Allow::TaggedSymbol
|
|
2380
|
+
]
|
|
2381
|
+
)
|
|
2382
|
+
end
|
|
2383
|
+
def self.values
|
|
2384
|
+
end
|
|
2385
|
+
end
|
|
2386
|
+
|
|
2387
|
+
module Avoid
|
|
2388
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2389
|
+
|
|
2390
|
+
TaggedSymbol =
|
|
2391
|
+
T.type_alias do
|
|
2392
|
+
T.all(
|
|
2393
|
+
Symbol,
|
|
2394
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid
|
|
2395
|
+
)
|
|
2396
|
+
end
|
|
2397
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2398
|
+
|
|
2399
|
+
TOLL =
|
|
2400
|
+
T.let(
|
|
2401
|
+
:toll,
|
|
2402
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2403
|
+
)
|
|
2404
|
+
HIGHWAY =
|
|
2405
|
+
T.let(
|
|
2406
|
+
:highway,
|
|
2407
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2408
|
+
)
|
|
2409
|
+
BBOX =
|
|
2410
|
+
T.let(
|
|
2411
|
+
:bbox,
|
|
2412
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2413
|
+
)
|
|
2414
|
+
LEFT_TURN =
|
|
2415
|
+
T.let(
|
|
2416
|
+
:left_turn,
|
|
2417
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2418
|
+
)
|
|
2419
|
+
RIGHT_TURN =
|
|
2420
|
+
T.let(
|
|
2421
|
+
:right_turn,
|
|
2422
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2423
|
+
)
|
|
2424
|
+
SHARP_TURN =
|
|
2425
|
+
T.let(
|
|
2426
|
+
:sharp_turn,
|
|
2427
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2428
|
+
)
|
|
2429
|
+
UTURN =
|
|
2430
|
+
T.let(
|
|
2431
|
+
:uturn,
|
|
2432
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2433
|
+
)
|
|
2434
|
+
SERVICE_ROAD =
|
|
2435
|
+
T.let(
|
|
2436
|
+
:service_road,
|
|
2437
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2438
|
+
)
|
|
2439
|
+
FERRY =
|
|
2440
|
+
T.let(
|
|
2441
|
+
:ferry,
|
|
2442
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2443
|
+
)
|
|
2444
|
+
NONE =
|
|
2445
|
+
T.let(
|
|
2446
|
+
:"none ",
|
|
2447
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2448
|
+
)
|
|
2449
|
+
|
|
2450
|
+
sig do
|
|
2451
|
+
override.returns(
|
|
2452
|
+
T::Array[
|
|
2453
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Avoid::TaggedSymbol
|
|
2454
|
+
]
|
|
2455
|
+
)
|
|
2456
|
+
end
|
|
2457
|
+
def self.values
|
|
2458
|
+
end
|
|
2459
|
+
end
|
|
2460
|
+
|
|
2461
|
+
# Use this parameter to apply a single speed value for all ETA and drive time
|
|
2462
|
+
# calculations. In case, the travel_cost is set to duration then setting this
|
|
2463
|
+
# parameter also impacts the cost of the solution.
|
|
2464
|
+
module Context
|
|
2465
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2466
|
+
|
|
2467
|
+
TaggedSymbol =
|
|
2468
|
+
T.type_alias do
|
|
2469
|
+
T.all(
|
|
2470
|
+
Symbol,
|
|
2471
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context
|
|
2472
|
+
)
|
|
2473
|
+
end
|
|
2474
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2475
|
+
|
|
2476
|
+
AVGSPEED =
|
|
2477
|
+
T.let(
|
|
2478
|
+
:avgspeed,
|
|
2479
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::TaggedSymbol
|
|
2480
|
+
)
|
|
2481
|
+
|
|
2482
|
+
sig do
|
|
2483
|
+
override.returns(
|
|
2484
|
+
T::Array[
|
|
2485
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Context::TaggedSymbol
|
|
2486
|
+
]
|
|
2487
|
+
)
|
|
2488
|
+
end
|
|
2489
|
+
def self.values
|
|
2490
|
+
end
|
|
2491
|
+
end
|
|
2492
|
+
|
|
2493
|
+
module HazmatType
|
|
2494
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2495
|
+
|
|
2496
|
+
TaggedSymbol =
|
|
2497
|
+
T.type_alias do
|
|
2498
|
+
T.all(
|
|
2499
|
+
Symbol,
|
|
2500
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType
|
|
2501
|
+
)
|
|
2502
|
+
end
|
|
2503
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2504
|
+
|
|
2505
|
+
GENERAL =
|
|
2506
|
+
T.let(
|
|
2507
|
+
:general,
|
|
2508
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::TaggedSymbol
|
|
2509
|
+
)
|
|
2510
|
+
CIRCUMSTANTIAL =
|
|
2511
|
+
T.let(
|
|
2512
|
+
:circumstantial,
|
|
2513
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::TaggedSymbol
|
|
2514
|
+
)
|
|
2515
|
+
EXPLOSIVE =
|
|
2516
|
+
T.let(
|
|
2517
|
+
:explosive,
|
|
2518
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::TaggedSymbol
|
|
2519
|
+
)
|
|
2520
|
+
HARMFUL_TO_WATER =
|
|
2521
|
+
T.let(
|
|
2522
|
+
:harmful_to_water,
|
|
2523
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::TaggedSymbol
|
|
2524
|
+
)
|
|
2525
|
+
|
|
2526
|
+
sig do
|
|
2527
|
+
override.returns(
|
|
2528
|
+
T::Array[
|
|
2529
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::HazmatType::TaggedSymbol
|
|
2530
|
+
]
|
|
2531
|
+
)
|
|
2532
|
+
end
|
|
2533
|
+
def self.values
|
|
2534
|
+
end
|
|
2535
|
+
end
|
|
2536
|
+
|
|
2537
|
+
# Define the traveling mode to be used for determining the optimized routes.
|
|
2538
|
+
module Mode
|
|
2539
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2540
|
+
|
|
2541
|
+
TaggedSymbol =
|
|
2542
|
+
T.type_alias do
|
|
2543
|
+
T.all(
|
|
2544
|
+
Symbol,
|
|
2545
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode
|
|
2546
|
+
)
|
|
2547
|
+
end
|
|
2548
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2549
|
+
|
|
2550
|
+
CAR =
|
|
2551
|
+
T.let(
|
|
2552
|
+
:car,
|
|
2553
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::TaggedSymbol
|
|
2554
|
+
)
|
|
2555
|
+
TRUCK =
|
|
2556
|
+
T.let(
|
|
2557
|
+
:truck,
|
|
2558
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::TaggedSymbol
|
|
2559
|
+
)
|
|
2560
|
+
|
|
2561
|
+
sig do
|
|
2562
|
+
override.returns(
|
|
2563
|
+
T::Array[
|
|
2564
|
+
Nextbillionai::Optimization::V2SubmitParams::Options::Routing::Mode::TaggedSymbol
|
|
2565
|
+
]
|
|
2566
|
+
)
|
|
2567
|
+
end
|
|
2568
|
+
def self.values
|
|
2569
|
+
end
|
|
2570
|
+
end
|
|
2571
|
+
end
|
|
2572
|
+
end
|
|
2573
|
+
|
|
2574
|
+
class Relation < Nextbillionai::Internal::Type::BaseModel
|
|
2575
|
+
OrHash =
|
|
2576
|
+
T.type_alias do
|
|
2577
|
+
T.any(
|
|
2578
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation,
|
|
2579
|
+
Nextbillionai::Internal::AnyHash
|
|
2580
|
+
)
|
|
2581
|
+
end
|
|
2582
|
+
|
|
2583
|
+
# The steps property specifies the tasks or steps that are part of the relation
|
|
2584
|
+
# and must be carried out in a manner defined in the type parameter. Please note
|
|
2585
|
+
# you can add any number of steps here, except when relation type is precedence
|
|
2586
|
+
# where only 2 tasks can be added.
|
|
2587
|
+
sig do
|
|
2588
|
+
returns(
|
|
2589
|
+
T::Array[
|
|
2590
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step
|
|
2591
|
+
]
|
|
2592
|
+
)
|
|
2593
|
+
end
|
|
2594
|
+
attr_accessor :steps
|
|
2595
|
+
|
|
2596
|
+
# Specifies the type of relation constraint. The following types are supported:
|
|
2597
|
+
#
|
|
2598
|
+
# - in_same_route: Ensures that all steps are covered in the same route in
|
|
2599
|
+
# solution.
|
|
2600
|
+
# - in_sequence: Ensures that all steps are in the same route and their sequence
|
|
2601
|
+
# matches the order specified in the steps field. Insertion of new steps between
|
|
2602
|
+
# the steps specified, is allowed.
|
|
2603
|
+
# - in_direct_sequence: Similar to in_sequence, but insertion of new steps is not
|
|
2604
|
+
# allowed in the final route.
|
|
2605
|
+
# - precedence: Restricts the travel time between the first step and second step.
|
|
2606
|
+
# If the precedence requirement cannot be satisfied, then the task specified at
|
|
2607
|
+
# the second step will not be assigned. Only 2 steps can be specified in a
|
|
2608
|
+
# single precedence type relations. Please use multiple precedence relations to
|
|
2609
|
+
# apply restrictions on more than 2 tasks.
|
|
2610
|
+
#
|
|
2611
|
+
# If the vehicle field is specified in the relations input, all steps will be
|
|
2612
|
+
# served by that particular vehicle. Otherwise, the route can be allocated to any
|
|
2613
|
+
# feasible vehicle.
|
|
2614
|
+
#
|
|
2615
|
+
# Please note that the type field is mandatory when using the relations object.
|
|
2616
|
+
sig do
|
|
2617
|
+
returns(
|
|
2618
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::OrSymbol
|
|
2619
|
+
)
|
|
2620
|
+
end
|
|
2621
|
+
attr_accessor :type
|
|
2622
|
+
|
|
2623
|
+
# **Deprecated! Please use the** vehicle **parameter to specify the vehicle ID.**
|
|
2624
|
+
#
|
|
2625
|
+
# Specifies the ID of the vehicle that would fulfil the steps. ID should be
|
|
2626
|
+
# consistent with input IDs provided in the vehicles object.
|
|
2627
|
+
sig { returns(T.nilable(Integer)) }
|
|
2628
|
+
attr_reader :id
|
|
2629
|
+
|
|
2630
|
+
sig { params(id: Integer).void }
|
|
2631
|
+
attr_writer :id
|
|
2632
|
+
|
|
2633
|
+
# This attribute is effective only when precedence type relation is used.
|
|
2634
|
+
# max_duration restricts the travel time of the vehicle to go from location of
|
|
2635
|
+
# first task to the location of second task specified in steps object. The unit
|
|
2636
|
+
# for this parameter is seconds. It accepts values greater than 0 only.
|
|
2637
|
+
#
|
|
2638
|
+
# Please note that max_duration is a hard constraint. Hence, if aggressive
|
|
2639
|
+
# durations are provided such that the second task cannot be reached within the
|
|
2640
|
+
# specified max_duration, it might be done before the first task (usually in case
|
|
2641
|
+
# of jobs) or remain un-assigned (usually in case of shipments).
|
|
2642
|
+
sig { returns(T.nilable(Integer)) }
|
|
2643
|
+
attr_reader :max_duration
|
|
2644
|
+
|
|
2645
|
+
sig { params(max_duration: Integer).void }
|
|
2646
|
+
attr_writer :max_duration
|
|
2647
|
+
|
|
2648
|
+
# This attribute is effective only when precedence type relation is used. Use
|
|
2649
|
+
# min_duration to enforce a minimum time-gap between the two tasks specified in
|
|
2650
|
+
# steps object. When specified, the second task will get completed after a gap of
|
|
2651
|
+
# min_duration with respect to the first task. The unit for this parameter is
|
|
2652
|
+
# seconds.
|
|
2653
|
+
#
|
|
2654
|
+
# Please note that min_duration is implemented as a soft constraint and it can be
|
|
2655
|
+
# violated in presence of other relation types. The optimizer will tend to provide
|
|
2656
|
+
# solutions where min_duration is not violated, but it is not guaranteed.
|
|
2657
|
+
sig { returns(T.nilable(Integer)) }
|
|
2658
|
+
attr_reader :min_duration
|
|
2659
|
+
|
|
2660
|
+
sig { params(min_duration: Integer).void }
|
|
2661
|
+
attr_writer :min_duration
|
|
2662
|
+
|
|
2663
|
+
# Specifies the ID of the vehicle that would fulfill the steps. Providing the same
|
|
2664
|
+
# vehicle ID to multiple ‘relations’ is prohibited. The vehicle ID provided here
|
|
2665
|
+
# should be consistent with ID provided in the vehicles attribute.
|
|
2666
|
+
sig { returns(T.nilable(String)) }
|
|
2667
|
+
attr_reader :vehicle
|
|
2668
|
+
|
|
2669
|
+
sig { params(vehicle: String).void }
|
|
2670
|
+
attr_writer :vehicle
|
|
2671
|
+
|
|
2672
|
+
sig do
|
|
2673
|
+
params(
|
|
2674
|
+
steps:
|
|
2675
|
+
T::Array[
|
|
2676
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::OrHash
|
|
2677
|
+
],
|
|
2678
|
+
type:
|
|
2679
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::OrSymbol,
|
|
2680
|
+
id: Integer,
|
|
2681
|
+
max_duration: Integer,
|
|
2682
|
+
min_duration: Integer,
|
|
2683
|
+
vehicle: String
|
|
2684
|
+
).returns(T.attached_class)
|
|
2685
|
+
end
|
|
2686
|
+
def self.new(
|
|
2687
|
+
# The steps property specifies the tasks or steps that are part of the relation
|
|
2688
|
+
# and must be carried out in a manner defined in the type parameter. Please note
|
|
2689
|
+
# you can add any number of steps here, except when relation type is precedence
|
|
2690
|
+
# where only 2 tasks can be added.
|
|
2691
|
+
steps:,
|
|
2692
|
+
# Specifies the type of relation constraint. The following types are supported:
|
|
2693
|
+
#
|
|
2694
|
+
# - in_same_route: Ensures that all steps are covered in the same route in
|
|
2695
|
+
# solution.
|
|
2696
|
+
# - in_sequence: Ensures that all steps are in the same route and their sequence
|
|
2697
|
+
# matches the order specified in the steps field. Insertion of new steps between
|
|
2698
|
+
# the steps specified, is allowed.
|
|
2699
|
+
# - in_direct_sequence: Similar to in_sequence, but insertion of new steps is not
|
|
2700
|
+
# allowed in the final route.
|
|
2701
|
+
# - precedence: Restricts the travel time between the first step and second step.
|
|
2702
|
+
# If the precedence requirement cannot be satisfied, then the task specified at
|
|
2703
|
+
# the second step will not be assigned. Only 2 steps can be specified in a
|
|
2704
|
+
# single precedence type relations. Please use multiple precedence relations to
|
|
2705
|
+
# apply restrictions on more than 2 tasks.
|
|
2706
|
+
#
|
|
2707
|
+
# If the vehicle field is specified in the relations input, all steps will be
|
|
2708
|
+
# served by that particular vehicle. Otherwise, the route can be allocated to any
|
|
2709
|
+
# feasible vehicle.
|
|
2710
|
+
#
|
|
2711
|
+
# Please note that the type field is mandatory when using the relations object.
|
|
2712
|
+
type:,
|
|
2713
|
+
# **Deprecated! Please use the** vehicle **parameter to specify the vehicle ID.**
|
|
2714
|
+
#
|
|
2715
|
+
# Specifies the ID of the vehicle that would fulfil the steps. ID should be
|
|
2716
|
+
# consistent with input IDs provided in the vehicles object.
|
|
2717
|
+
id: nil,
|
|
2718
|
+
# This attribute is effective only when precedence type relation is used.
|
|
2719
|
+
# max_duration restricts the travel time of the vehicle to go from location of
|
|
2720
|
+
# first task to the location of second task specified in steps object. The unit
|
|
2721
|
+
# for this parameter is seconds. It accepts values greater than 0 only.
|
|
2722
|
+
#
|
|
2723
|
+
# Please note that max_duration is a hard constraint. Hence, if aggressive
|
|
2724
|
+
# durations are provided such that the second task cannot be reached within the
|
|
2725
|
+
# specified max_duration, it might be done before the first task (usually in case
|
|
2726
|
+
# of jobs) or remain un-assigned (usually in case of shipments).
|
|
2727
|
+
max_duration: nil,
|
|
2728
|
+
# This attribute is effective only when precedence type relation is used. Use
|
|
2729
|
+
# min_duration to enforce a minimum time-gap between the two tasks specified in
|
|
2730
|
+
# steps object. When specified, the second task will get completed after a gap of
|
|
2731
|
+
# min_duration with respect to the first task. The unit for this parameter is
|
|
2732
|
+
# seconds.
|
|
2733
|
+
#
|
|
2734
|
+
# Please note that min_duration is implemented as a soft constraint and it can be
|
|
2735
|
+
# violated in presence of other relation types. The optimizer will tend to provide
|
|
2736
|
+
# solutions where min_duration is not violated, but it is not guaranteed.
|
|
2737
|
+
min_duration: nil,
|
|
2738
|
+
# Specifies the ID of the vehicle that would fulfill the steps. Providing the same
|
|
2739
|
+
# vehicle ID to multiple ‘relations’ is prohibited. The vehicle ID provided here
|
|
2740
|
+
# should be consistent with ID provided in the vehicles attribute.
|
|
2741
|
+
vehicle: nil
|
|
2742
|
+
)
|
|
2743
|
+
end
|
|
2744
|
+
|
|
2745
|
+
sig do
|
|
2746
|
+
override.returns(
|
|
2747
|
+
{
|
|
2748
|
+
steps:
|
|
2749
|
+
T::Array[
|
|
2750
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step
|
|
2751
|
+
],
|
|
2752
|
+
type:
|
|
2753
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::OrSymbol,
|
|
2754
|
+
id: Integer,
|
|
2755
|
+
max_duration: Integer,
|
|
2756
|
+
min_duration: Integer,
|
|
2757
|
+
vehicle: String
|
|
2758
|
+
}
|
|
2759
|
+
)
|
|
2760
|
+
end
|
|
2761
|
+
def to_hash
|
|
2762
|
+
end
|
|
2763
|
+
|
|
2764
|
+
class Step < Nextbillionai::Internal::Type::BaseModel
|
|
2765
|
+
OrHash =
|
|
2766
|
+
T.type_alias do
|
|
2767
|
+
T.any(
|
|
2768
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step,
|
|
2769
|
+
Nextbillionai::Internal::AnyHash
|
|
2770
|
+
)
|
|
2771
|
+
end
|
|
2772
|
+
|
|
2773
|
+
# Specifies the type of the step. The start and end step types have to be the
|
|
2774
|
+
# first and last steps, respectively, in a relation.
|
|
2775
|
+
#
|
|
2776
|
+
# Please note that the type is mandatory when using the relations object.
|
|
2777
|
+
sig do
|
|
2778
|
+
returns(
|
|
2779
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::OrSymbol
|
|
2780
|
+
)
|
|
2781
|
+
end
|
|
2782
|
+
attr_accessor :type
|
|
2783
|
+
|
|
2784
|
+
# This represents the ID of the task and should be consistent with the input IDs
|
|
2785
|
+
# provided in the jobs or shipments objects for a given step. The id is required
|
|
2786
|
+
# for all steps other than start and end.
|
|
2787
|
+
sig { returns(T.nilable(String)) }
|
|
2788
|
+
attr_reader :id
|
|
2789
|
+
|
|
2790
|
+
sig { params(id: String).void }
|
|
2791
|
+
attr_writer :id
|
|
2792
|
+
|
|
2793
|
+
sig do
|
|
2794
|
+
params(
|
|
2795
|
+
type:
|
|
2796
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::OrSymbol,
|
|
2797
|
+
id: String
|
|
2798
|
+
).returns(T.attached_class)
|
|
2799
|
+
end
|
|
2800
|
+
def self.new(
|
|
2801
|
+
# Specifies the type of the step. The start and end step types have to be the
|
|
2802
|
+
# first and last steps, respectively, in a relation.
|
|
2803
|
+
#
|
|
2804
|
+
# Please note that the type is mandatory when using the relations object.
|
|
2805
|
+
type:,
|
|
2806
|
+
# This represents the ID of the task and should be consistent with the input IDs
|
|
2807
|
+
# provided in the jobs or shipments objects for a given step. The id is required
|
|
2808
|
+
# for all steps other than start and end.
|
|
2809
|
+
id: nil
|
|
2810
|
+
)
|
|
2811
|
+
end
|
|
2812
|
+
|
|
2813
|
+
sig do
|
|
2814
|
+
override.returns(
|
|
2815
|
+
{
|
|
2816
|
+
type:
|
|
2817
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::OrSymbol,
|
|
2818
|
+
id: String
|
|
2819
|
+
}
|
|
2820
|
+
)
|
|
2821
|
+
end
|
|
2822
|
+
def to_hash
|
|
2823
|
+
end
|
|
2824
|
+
|
|
2825
|
+
# Specifies the type of the step. The start and end step types have to be the
|
|
2826
|
+
# first and last steps, respectively, in a relation.
|
|
2827
|
+
#
|
|
2828
|
+
# Please note that the type is mandatory when using the relations object.
|
|
2829
|
+
module Type
|
|
2830
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2831
|
+
|
|
2832
|
+
TaggedSymbol =
|
|
2833
|
+
T.type_alias do
|
|
2834
|
+
T.all(
|
|
2835
|
+
Symbol,
|
|
2836
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type
|
|
2837
|
+
)
|
|
2838
|
+
end
|
|
2839
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2840
|
+
|
|
2841
|
+
START =
|
|
2842
|
+
T.let(
|
|
2843
|
+
:start,
|
|
2844
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2845
|
+
)
|
|
2846
|
+
END_ =
|
|
2847
|
+
T.let(
|
|
2848
|
+
:end,
|
|
2849
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2850
|
+
)
|
|
2851
|
+
JOB =
|
|
2852
|
+
T.let(
|
|
2853
|
+
:job,
|
|
2854
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2855
|
+
)
|
|
2856
|
+
PICKUP =
|
|
2857
|
+
T.let(
|
|
2858
|
+
:pickup,
|
|
2859
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2860
|
+
)
|
|
2861
|
+
DELIVERY =
|
|
2862
|
+
T.let(
|
|
2863
|
+
:delivery,
|
|
2864
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2865
|
+
)
|
|
2866
|
+
|
|
2867
|
+
sig do
|
|
2868
|
+
override.returns(
|
|
2869
|
+
T::Array[
|
|
2870
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Step::Type::TaggedSymbol
|
|
2871
|
+
]
|
|
2872
|
+
)
|
|
2873
|
+
end
|
|
2874
|
+
def self.values
|
|
2875
|
+
end
|
|
2876
|
+
end
|
|
2877
|
+
end
|
|
2878
|
+
|
|
2879
|
+
# Specifies the type of relation constraint. The following types are supported:
|
|
2880
|
+
#
|
|
2881
|
+
# - in_same_route: Ensures that all steps are covered in the same route in
|
|
2882
|
+
# solution.
|
|
2883
|
+
# - in_sequence: Ensures that all steps are in the same route and their sequence
|
|
2884
|
+
# matches the order specified in the steps field. Insertion of new steps between
|
|
2885
|
+
# the steps specified, is allowed.
|
|
2886
|
+
# - in_direct_sequence: Similar to in_sequence, but insertion of new steps is not
|
|
2887
|
+
# allowed in the final route.
|
|
2888
|
+
# - precedence: Restricts the travel time between the first step and second step.
|
|
2889
|
+
# If the precedence requirement cannot be satisfied, then the task specified at
|
|
2890
|
+
# the second step will not be assigned. Only 2 steps can be specified in a
|
|
2891
|
+
# single precedence type relations. Please use multiple precedence relations to
|
|
2892
|
+
# apply restrictions on more than 2 tasks.
|
|
2893
|
+
#
|
|
2894
|
+
# If the vehicle field is specified in the relations input, all steps will be
|
|
2895
|
+
# served by that particular vehicle. Otherwise, the route can be allocated to any
|
|
2896
|
+
# feasible vehicle.
|
|
2897
|
+
#
|
|
2898
|
+
# Please note that the type field is mandatory when using the relations object.
|
|
2899
|
+
module Type
|
|
2900
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
2901
|
+
|
|
2902
|
+
TaggedSymbol =
|
|
2903
|
+
T.type_alias do
|
|
2904
|
+
T.all(
|
|
2905
|
+
Symbol,
|
|
2906
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type
|
|
2907
|
+
)
|
|
2908
|
+
end
|
|
2909
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2910
|
+
|
|
2911
|
+
IN_SAME_ROUTE =
|
|
2912
|
+
T.let(
|
|
2913
|
+
:in_same_route,
|
|
2914
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::TaggedSymbol
|
|
2915
|
+
)
|
|
2916
|
+
IN_SEQUENCE =
|
|
2917
|
+
T.let(
|
|
2918
|
+
:in_sequence,
|
|
2919
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::TaggedSymbol
|
|
2920
|
+
)
|
|
2921
|
+
IN_DIRECT_SEQUENCE =
|
|
2922
|
+
T.let(
|
|
2923
|
+
:in_direct_sequence,
|
|
2924
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::TaggedSymbol
|
|
2925
|
+
)
|
|
2926
|
+
PRECEDENCE =
|
|
2927
|
+
T.let(
|
|
2928
|
+
:precedence,
|
|
2929
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::TaggedSymbol
|
|
2930
|
+
)
|
|
2931
|
+
|
|
2932
|
+
sig do
|
|
2933
|
+
override.returns(
|
|
2934
|
+
T::Array[
|
|
2935
|
+
Nextbillionai::Optimization::V2SubmitParams::Relation::Type::TaggedSymbol
|
|
2936
|
+
]
|
|
2937
|
+
)
|
|
2938
|
+
end
|
|
2939
|
+
def self.values
|
|
2940
|
+
end
|
|
2941
|
+
end
|
|
2942
|
+
end
|
|
2943
|
+
|
|
2944
|
+
class Solution < Nextbillionai::Internal::Type::BaseModel
|
|
2945
|
+
OrHash =
|
|
2946
|
+
T.type_alias do
|
|
2947
|
+
T.any(
|
|
2948
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution,
|
|
2949
|
+
Nextbillionai::Internal::AnyHash
|
|
2950
|
+
)
|
|
2951
|
+
end
|
|
2952
|
+
|
|
2953
|
+
# Specify the cost of the route.
|
|
2954
|
+
sig { returns(Integer) }
|
|
2955
|
+
attr_accessor :cost
|
|
2956
|
+
|
|
2957
|
+
# Describe the steps in this route.
|
|
2958
|
+
sig do
|
|
2959
|
+
returns(
|
|
2960
|
+
T::Array[
|
|
2961
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step
|
|
2962
|
+
]
|
|
2963
|
+
)
|
|
2964
|
+
end
|
|
2965
|
+
attr_accessor :steps
|
|
2966
|
+
|
|
2967
|
+
# Specify the ID of the vehicle that was assigned to the route. This field is
|
|
2968
|
+
# mandatory when using the solution attribute and providing an empty string would
|
|
2969
|
+
# result in error. The IDs are case-sensitive.
|
|
2970
|
+
#
|
|
2971
|
+
# **Note:** Since the vehicles can be configured using either a string or an
|
|
2972
|
+
# integer ID, please ensure that the same value type is provided for this field as
|
|
2973
|
+
# was used in the original request.
|
|
2974
|
+
sig { returns(String) }
|
|
2975
|
+
attr_accessor :vehicle
|
|
2976
|
+
|
|
2977
|
+
# Specify the total quantities, for each dimension (or unit), of deliveries
|
|
2978
|
+
# performed in the route.
|
|
2979
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
|
2980
|
+
attr_reader :delivery
|
|
2981
|
+
|
|
2982
|
+
sig { params(delivery: T::Array[Integer]).void }
|
|
2983
|
+
attr_writer :delivery
|
|
2984
|
+
|
|
2985
|
+
# Specify the description of the assigned vehicle.
|
|
2986
|
+
sig { returns(T.nilable(String)) }
|
|
2987
|
+
attr_reader :description
|
|
2988
|
+
|
|
2989
|
+
sig { params(description: String).void }
|
|
2990
|
+
attr_writer :description
|
|
2991
|
+
|
|
2992
|
+
# Specify the total distance of the route, in meters.
|
|
2993
|
+
sig { returns(T.nilable(Integer)) }
|
|
2994
|
+
attr_reader :distance
|
|
2995
|
+
|
|
2996
|
+
sig { params(distance: Integer).void }
|
|
2997
|
+
attr_writer :distance
|
|
2998
|
+
|
|
2999
|
+
# Specify the total drive duration of the route, in seconds.
|
|
3000
|
+
sig { returns(T.nilable(Integer)) }
|
|
3001
|
+
attr_reader :duration
|
|
3002
|
+
|
|
3003
|
+
sig { params(duration: Integer).void }
|
|
3004
|
+
attr_writer :duration
|
|
3005
|
+
|
|
3006
|
+
# Specify the geometry of this route encoded in polyline format.
|
|
3007
|
+
sig { returns(T.nilable(String)) }
|
|
3008
|
+
attr_reader :geometry
|
|
3009
|
+
|
|
3010
|
+
sig { params(geometry: String).void }
|
|
3011
|
+
attr_writer :geometry
|
|
3012
|
+
|
|
3013
|
+
# Specify the total quantities, for each dimension (or unit), of pickups performed
|
|
3014
|
+
# in the route.
|
|
3015
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
|
3016
|
+
attr_reader :pickup
|
|
3017
|
+
|
|
3018
|
+
sig { params(pickup: T::Array[Integer]).void }
|
|
3019
|
+
attr_writer :pickup
|
|
3020
|
+
|
|
3021
|
+
# Specify the sum of priorities of all tasks on the route.
|
|
3022
|
+
sig { returns(T.nilable(Integer)) }
|
|
3023
|
+
attr_reader :priority
|
|
3024
|
+
|
|
3025
|
+
sig { params(priority: Integer).void }
|
|
3026
|
+
attr_writer :priority
|
|
3027
|
+
|
|
3028
|
+
# Specify the total service time for the route, in seconds.
|
|
3029
|
+
sig { returns(T.nilable(Integer)) }
|
|
3030
|
+
attr_reader :service
|
|
3031
|
+
|
|
3032
|
+
sig { params(service: Integer).void }
|
|
3033
|
+
attr_writer :service
|
|
3034
|
+
|
|
3035
|
+
# Specify the total set-up duration, in seconds, needed for the tasks on the
|
|
3036
|
+
# route.
|
|
3037
|
+
sig { returns(T.nilable(Integer)) }
|
|
3038
|
+
attr_reader :setup
|
|
3039
|
+
|
|
3040
|
+
sig { params(setup: Integer).void }
|
|
3041
|
+
attr_writer :setup
|
|
3042
|
+
|
|
3043
|
+
# Specify the total waiting time of the vehicle on the route, in seconds.
|
|
3044
|
+
sig { returns(T.nilable(Integer)) }
|
|
3045
|
+
attr_reader :waiting_time
|
|
3046
|
+
|
|
3047
|
+
sig { params(waiting_time: Integer).void }
|
|
3048
|
+
attr_writer :waiting_time
|
|
3049
|
+
|
|
3050
|
+
sig do
|
|
3051
|
+
params(
|
|
3052
|
+
cost: Integer,
|
|
3053
|
+
steps:
|
|
3054
|
+
T::Array[
|
|
3055
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::OrHash
|
|
3056
|
+
],
|
|
3057
|
+
vehicle: String,
|
|
3058
|
+
delivery: T::Array[Integer],
|
|
3059
|
+
description: String,
|
|
3060
|
+
distance: Integer,
|
|
3061
|
+
duration: Integer,
|
|
3062
|
+
geometry: String,
|
|
3063
|
+
pickup: T::Array[Integer],
|
|
3064
|
+
priority: Integer,
|
|
3065
|
+
service: Integer,
|
|
3066
|
+
setup: Integer,
|
|
3067
|
+
waiting_time: Integer
|
|
3068
|
+
).returns(T.attached_class)
|
|
3069
|
+
end
|
|
3070
|
+
def self.new(
|
|
3071
|
+
# Specify the cost of the route.
|
|
3072
|
+
cost:,
|
|
3073
|
+
# Describe the steps in this route.
|
|
3074
|
+
steps:,
|
|
3075
|
+
# Specify the ID of the vehicle that was assigned to the route. This field is
|
|
3076
|
+
# mandatory when using the solution attribute and providing an empty string would
|
|
3077
|
+
# result in error. The IDs are case-sensitive.
|
|
3078
|
+
#
|
|
3079
|
+
# **Note:** Since the vehicles can be configured using either a string or an
|
|
3080
|
+
# integer ID, please ensure that the same value type is provided for this field as
|
|
3081
|
+
# was used in the original request.
|
|
3082
|
+
vehicle:,
|
|
3083
|
+
# Specify the total quantities, for each dimension (or unit), of deliveries
|
|
3084
|
+
# performed in the route.
|
|
3085
|
+
delivery: nil,
|
|
3086
|
+
# Specify the description of the assigned vehicle.
|
|
3087
|
+
description: nil,
|
|
3088
|
+
# Specify the total distance of the route, in meters.
|
|
3089
|
+
distance: nil,
|
|
3090
|
+
# Specify the total drive duration of the route, in seconds.
|
|
3091
|
+
duration: nil,
|
|
3092
|
+
# Specify the geometry of this route encoded in polyline format.
|
|
3093
|
+
geometry: nil,
|
|
3094
|
+
# Specify the total quantities, for each dimension (or unit), of pickups performed
|
|
3095
|
+
# in the route.
|
|
3096
|
+
pickup: nil,
|
|
3097
|
+
# Specify the sum of priorities of all tasks on the route.
|
|
3098
|
+
priority: nil,
|
|
3099
|
+
# Specify the total service time for the route, in seconds.
|
|
3100
|
+
service: nil,
|
|
3101
|
+
# Specify the total set-up duration, in seconds, needed for the tasks on the
|
|
3102
|
+
# route.
|
|
3103
|
+
setup: nil,
|
|
3104
|
+
# Specify the total waiting time of the vehicle on the route, in seconds.
|
|
3105
|
+
waiting_time: nil
|
|
3106
|
+
)
|
|
3107
|
+
end
|
|
3108
|
+
|
|
3109
|
+
sig do
|
|
3110
|
+
override.returns(
|
|
3111
|
+
{
|
|
3112
|
+
cost: Integer,
|
|
3113
|
+
steps:
|
|
3114
|
+
T::Array[
|
|
3115
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step
|
|
3116
|
+
],
|
|
3117
|
+
vehicle: String,
|
|
3118
|
+
delivery: T::Array[Integer],
|
|
3119
|
+
description: String,
|
|
3120
|
+
distance: Integer,
|
|
3121
|
+
duration: Integer,
|
|
3122
|
+
geometry: String,
|
|
3123
|
+
pickup: T::Array[Integer],
|
|
3124
|
+
priority: Integer,
|
|
3125
|
+
service: Integer,
|
|
3126
|
+
setup: Integer,
|
|
3127
|
+
waiting_time: Integer
|
|
3128
|
+
}
|
|
3129
|
+
)
|
|
3130
|
+
end
|
|
3131
|
+
def to_hash
|
|
3132
|
+
end
|
|
3133
|
+
|
|
3134
|
+
class Step < Nextbillionai::Internal::Type::BaseModel
|
|
3135
|
+
OrHash =
|
|
3136
|
+
T.type_alias do
|
|
3137
|
+
T.any(
|
|
3138
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step,
|
|
3139
|
+
Nextbillionai::Internal::AnyHash
|
|
3140
|
+
)
|
|
3141
|
+
end
|
|
3142
|
+
|
|
3143
|
+
# The ID of the step. This field is mandatory for all steps except for start and
|
|
3144
|
+
# end type.
|
|
3145
|
+
#
|
|
3146
|
+
# Please note that the ID provided here must also be present in either the jobs or
|
|
3147
|
+
# the shipments objects.
|
|
3148
|
+
#
|
|
3149
|
+
# **Note:** We have modified the data type of this field. The latest change is
|
|
3150
|
+
# backward compatible and both integer and string type IDs are valid for this
|
|
3151
|
+
# field, as long as they match the IDs of the jobs or shipments already
|
|
3152
|
+
# configured.
|
|
3153
|
+
sig { returns(String) }
|
|
3154
|
+
attr_accessor :id
|
|
3155
|
+
|
|
3156
|
+
# Specify the time at which the vehicle arrives at the step location. If
|
|
3157
|
+
# time_windows is provided, then arrival will be an UNIX timestamp expressed in
|
|
3158
|
+
# seconds. Otherwise, it will be the total duration, in seconds, elapsed since the
|
|
3159
|
+
# start of the route.
|
|
3160
|
+
#
|
|
3161
|
+
# Please note that arrival is mandatory when using the solution object.
|
|
3162
|
+
sig { returns(Integer) }
|
|
3163
|
+
attr_accessor :arrival
|
|
3164
|
+
|
|
3165
|
+
# Specify the type of the step.
|
|
3166
|
+
sig do
|
|
3167
|
+
returns(
|
|
3168
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::OrSymbol
|
|
3169
|
+
)
|
|
3170
|
+
end
|
|
3171
|
+
attr_accessor :type
|
|
3172
|
+
|
|
3173
|
+
# Specify the description of this step.
|
|
3174
|
+
sig { returns(T.nilable(String)) }
|
|
3175
|
+
attr_reader :description
|
|
3176
|
+
|
|
3177
|
+
sig { params(description: String).void }
|
|
3178
|
+
attr_writer :description
|
|
3179
|
+
|
|
3180
|
+
# Specify the distance covered, in meters, from the start of the route up until
|
|
3181
|
+
# the current step.
|
|
3182
|
+
#
|
|
3183
|
+
# Please note that the value of this parameter accumulates with each step. In case
|
|
3184
|
+
# , the travel_cost: air_distance, then the distance here should be the straight
|
|
3185
|
+
# line distance.
|
|
3186
|
+
sig { returns(T.nilable(Integer)) }
|
|
3187
|
+
attr_reader :distance
|
|
3188
|
+
|
|
3189
|
+
sig { params(distance: Integer).void }
|
|
3190
|
+
attr_writer :distance
|
|
3191
|
+
|
|
3192
|
+
# Specify the drive time, in seconds, from the start of the route up until the
|
|
3193
|
+
# start of the step. Please note that the value of this parameter accumulates with
|
|
3194
|
+
# each step.
|
|
3195
|
+
sig { returns(T.nilable(Integer)) }
|
|
3196
|
+
attr_reader :duration
|
|
3197
|
+
|
|
3198
|
+
sig { params(duration: Integer).void }
|
|
3199
|
+
attr_writer :duration
|
|
3200
|
+
|
|
3201
|
+
# Specify the load on the vehicle after completing this step. In case of multiple
|
|
3202
|
+
# dimensions, please specify the load for each type.
|
|
3203
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
|
3204
|
+
attr_reader :load_
|
|
3205
|
+
|
|
3206
|
+
sig { params(load_: T::Array[Integer]).void }
|
|
3207
|
+
attr_writer :load_
|
|
3208
|
+
|
|
3209
|
+
# Specify the location coordinates of the step in the \[latitude, longitude\]
|
|
3210
|
+
# format. Alternatively, location_index property can also be used to specify the
|
|
3211
|
+
# location of the step.
|
|
3212
|
+
#
|
|
3213
|
+
# Please note that either location or location_index is mandatory.
|
|
3214
|
+
sig { returns(T.nilable(T::Array[Float])) }
|
|
3215
|
+
attr_reader :location
|
|
3216
|
+
|
|
3217
|
+
sig { params(location: T::Array[Float]).void }
|
|
3218
|
+
attr_writer :location
|
|
3219
|
+
|
|
3220
|
+
# Specify the index (in the location array) of the location coordinates where the
|
|
3221
|
+
# step is performed. The valid range of values is \[0, length of location array).
|
|
3222
|
+
# Alternatively, location property can also be used to specify the location.
|
|
3223
|
+
#
|
|
3224
|
+
# Please note that either location or location_index is mandatory.
|
|
3225
|
+
sig { returns(T.nilable(Integer)) }
|
|
3226
|
+
attr_reader :location_index
|
|
3227
|
+
|
|
3228
|
+
sig { params(location_index: Integer).void }
|
|
3229
|
+
attr_writer :location_index
|
|
3230
|
+
|
|
3231
|
+
# Specify the service time, in seconds, at this step.
|
|
3232
|
+
sig { returns(T.nilable(Integer)) }
|
|
3233
|
+
attr_reader :service
|
|
3234
|
+
|
|
3235
|
+
sig { params(service: Integer).void }
|
|
3236
|
+
attr_writer :service
|
|
3237
|
+
|
|
3238
|
+
# Specify the set-up duration, in seconds, needed at the step.
|
|
3239
|
+
sig { returns(T.nilable(Integer)) }
|
|
3240
|
+
attr_reader :setup
|
|
3241
|
+
|
|
3242
|
+
sig { params(setup: Integer).void }
|
|
3243
|
+
attr_writer :setup
|
|
3244
|
+
|
|
3245
|
+
# Specify the wait time of the vehicle at this step, in seconds.
|
|
3246
|
+
sig { returns(T.nilable(Integer)) }
|
|
3247
|
+
attr_reader :waiting_time
|
|
3248
|
+
|
|
3249
|
+
sig { params(waiting_time: Integer).void }
|
|
3250
|
+
attr_writer :waiting_time
|
|
3251
|
+
|
|
3252
|
+
# Describe details about a step of a route
|
|
3253
|
+
sig do
|
|
3254
|
+
params(
|
|
3255
|
+
id: String,
|
|
3256
|
+
arrival: Integer,
|
|
3257
|
+
type:
|
|
3258
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::OrSymbol,
|
|
3259
|
+
description: String,
|
|
3260
|
+
distance: Integer,
|
|
3261
|
+
duration: Integer,
|
|
3262
|
+
load_: T::Array[Integer],
|
|
3263
|
+
location: T::Array[Float],
|
|
3264
|
+
location_index: Integer,
|
|
3265
|
+
service: Integer,
|
|
3266
|
+
setup: Integer,
|
|
3267
|
+
waiting_time: Integer
|
|
3268
|
+
).returns(T.attached_class)
|
|
3269
|
+
end
|
|
3270
|
+
def self.new(
|
|
3271
|
+
# The ID of the step. This field is mandatory for all steps except for start and
|
|
3272
|
+
# end type.
|
|
3273
|
+
#
|
|
3274
|
+
# Please note that the ID provided here must also be present in either the jobs or
|
|
3275
|
+
# the shipments objects.
|
|
3276
|
+
#
|
|
3277
|
+
# **Note:** We have modified the data type of this field. The latest change is
|
|
3278
|
+
# backward compatible and both integer and string type IDs are valid for this
|
|
3279
|
+
# field, as long as they match the IDs of the jobs or shipments already
|
|
3280
|
+
# configured.
|
|
3281
|
+
id:,
|
|
3282
|
+
# Specify the time at which the vehicle arrives at the step location. If
|
|
3283
|
+
# time_windows is provided, then arrival will be an UNIX timestamp expressed in
|
|
3284
|
+
# seconds. Otherwise, it will be the total duration, in seconds, elapsed since the
|
|
3285
|
+
# start of the route.
|
|
3286
|
+
#
|
|
3287
|
+
# Please note that arrival is mandatory when using the solution object.
|
|
3288
|
+
arrival:,
|
|
3289
|
+
# Specify the type of the step.
|
|
3290
|
+
type:,
|
|
3291
|
+
# Specify the description of this step.
|
|
3292
|
+
description: nil,
|
|
3293
|
+
# Specify the distance covered, in meters, from the start of the route up until
|
|
3294
|
+
# the current step.
|
|
3295
|
+
#
|
|
3296
|
+
# Please note that the value of this parameter accumulates with each step. In case
|
|
3297
|
+
# , the travel_cost: air_distance, then the distance here should be the straight
|
|
3298
|
+
# line distance.
|
|
3299
|
+
distance: nil,
|
|
3300
|
+
# Specify the drive time, in seconds, from the start of the route up until the
|
|
3301
|
+
# start of the step. Please note that the value of this parameter accumulates with
|
|
3302
|
+
# each step.
|
|
3303
|
+
duration: nil,
|
|
3304
|
+
# Specify the load on the vehicle after completing this step. In case of multiple
|
|
3305
|
+
# dimensions, please specify the load for each type.
|
|
3306
|
+
load_: nil,
|
|
3307
|
+
# Specify the location coordinates of the step in the \[latitude, longitude\]
|
|
3308
|
+
# format. Alternatively, location_index property can also be used to specify the
|
|
3309
|
+
# location of the step.
|
|
3310
|
+
#
|
|
3311
|
+
# Please note that either location or location_index is mandatory.
|
|
3312
|
+
location: nil,
|
|
3313
|
+
# Specify the index (in the location array) of the location coordinates where the
|
|
3314
|
+
# step is performed. The valid range of values is \[0, length of location array).
|
|
3315
|
+
# Alternatively, location property can also be used to specify the location.
|
|
3316
|
+
#
|
|
3317
|
+
# Please note that either location or location_index is mandatory.
|
|
3318
|
+
location_index: nil,
|
|
3319
|
+
# Specify the service time, in seconds, at this step.
|
|
3320
|
+
service: nil,
|
|
3321
|
+
# Specify the set-up duration, in seconds, needed at the step.
|
|
3322
|
+
setup: nil,
|
|
3323
|
+
# Specify the wait time of the vehicle at this step, in seconds.
|
|
3324
|
+
waiting_time: nil
|
|
3325
|
+
)
|
|
3326
|
+
end
|
|
3327
|
+
|
|
3328
|
+
sig do
|
|
3329
|
+
override.returns(
|
|
3330
|
+
{
|
|
3331
|
+
id: String,
|
|
3332
|
+
arrival: Integer,
|
|
3333
|
+
type:
|
|
3334
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::OrSymbol,
|
|
3335
|
+
description: String,
|
|
3336
|
+
distance: Integer,
|
|
3337
|
+
duration: Integer,
|
|
3338
|
+
load_: T::Array[Integer],
|
|
3339
|
+
location: T::Array[Float],
|
|
3340
|
+
location_index: Integer,
|
|
3341
|
+
service: Integer,
|
|
3342
|
+
setup: Integer,
|
|
3343
|
+
waiting_time: Integer
|
|
3344
|
+
}
|
|
3345
|
+
)
|
|
3346
|
+
end
|
|
3347
|
+
def to_hash
|
|
3348
|
+
end
|
|
3349
|
+
|
|
3350
|
+
# Specify the type of the step.
|
|
3351
|
+
module Type
|
|
3352
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
3353
|
+
|
|
3354
|
+
TaggedSymbol =
|
|
3355
|
+
T.type_alias do
|
|
3356
|
+
T.all(
|
|
3357
|
+
Symbol,
|
|
3358
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type
|
|
3359
|
+
)
|
|
3360
|
+
end
|
|
3361
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
3362
|
+
|
|
3363
|
+
START =
|
|
3364
|
+
T.let(
|
|
3365
|
+
:start,
|
|
3366
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3367
|
+
)
|
|
3368
|
+
END_ =
|
|
3369
|
+
T.let(
|
|
3370
|
+
:end,
|
|
3371
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3372
|
+
)
|
|
3373
|
+
JOB =
|
|
3374
|
+
T.let(
|
|
3375
|
+
:job,
|
|
3376
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3377
|
+
)
|
|
3378
|
+
PICKUP =
|
|
3379
|
+
T.let(
|
|
3380
|
+
:pickup,
|
|
3381
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3382
|
+
)
|
|
3383
|
+
DELIVERY =
|
|
3384
|
+
T.let(
|
|
3385
|
+
:delivery,
|
|
3386
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3387
|
+
)
|
|
3388
|
+
BREAK =
|
|
3389
|
+
T.let(
|
|
3390
|
+
:break,
|
|
3391
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3392
|
+
)
|
|
3393
|
+
|
|
3394
|
+
sig do
|
|
3395
|
+
override.returns(
|
|
3396
|
+
T::Array[
|
|
3397
|
+
Nextbillionai::Optimization::V2SubmitParams::Solution::Step::Type::TaggedSymbol
|
|
3398
|
+
]
|
|
3399
|
+
)
|
|
3400
|
+
end
|
|
3401
|
+
def self.values
|
|
3402
|
+
end
|
|
3403
|
+
end
|
|
3404
|
+
end
|
|
3405
|
+
end
|
|
3406
|
+
|
|
3407
|
+
class Unassigned < Nextbillionai::Internal::Type::BaseModel
|
|
3408
|
+
OrHash =
|
|
3409
|
+
T.type_alias do
|
|
3410
|
+
T.any(
|
|
3411
|
+
Nextbillionai::Optimization::V2SubmitParams::Unassigned,
|
|
3412
|
+
Nextbillionai::Internal::AnyHash
|
|
3413
|
+
)
|
|
3414
|
+
end
|
|
3415
|
+
|
|
3416
|
+
# Specify the unassigned job IDs from the previous optimization result. Please
|
|
3417
|
+
# note the IDs should also be present in the jobs part of the input.
|
|
3418
|
+
#
|
|
3419
|
+
# **Note:** We have modified the data type of this field. However, the latest
|
|
3420
|
+
# change is backward compatible and both integer and string type job IDs are valid
|
|
3421
|
+
# for this field, as long as they match the IDs of the jobs already configured.
|
|
3422
|
+
# Providing mixed value types in the array, will lead to an error.
|
|
3423
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
3424
|
+
attr_reader :jobs
|
|
3425
|
+
|
|
3426
|
+
sig { params(jobs: T::Array[String]).void }
|
|
3427
|
+
attr_writer :jobs
|
|
3428
|
+
|
|
3429
|
+
# Specify the unassigned shipment pickup & delivery IDs from the previous
|
|
3430
|
+
# optimization result. Both the pickup & delivery steps of a shipment should be
|
|
3431
|
+
# part of the same array.
|
|
3432
|
+
#
|
|
3433
|
+
# **Note:** We have modified the data type of this field. However, the latest
|
|
3434
|
+
# change is backward compatible and both integer and string type shipment IDs are
|
|
3435
|
+
# valid for this field, as long as they match the IDs of the shipments already
|
|
3436
|
+
# configured. Providing mixed value types in the array, will lead to an error.
|
|
3437
|
+
sig { returns(T.nilable(T::Array[T::Array[String]])) }
|
|
3438
|
+
attr_reader :shipments
|
|
3439
|
+
|
|
3440
|
+
sig { params(shipments: T::Array[T::Array[String]]).void }
|
|
3441
|
+
attr_writer :shipments
|
|
3442
|
+
|
|
3443
|
+
# unassigned attribute is related to the re-optimization feature. This attribute
|
|
3444
|
+
# should contain the tasks that were not assigned during an earlier optimization
|
|
3445
|
+
# process. Please note that the unassigned part in request should be consistent
|
|
3446
|
+
# with the unassigned part in the previous optimization result.
|
|
3447
|
+
#
|
|
3448
|
+
# Users can reduce the number of unassigned tasks in the re-optimized solution, by
|
|
3449
|
+
# following strategies such as:
|
|
3450
|
+
#
|
|
3451
|
+
# - Extending the time windows for vehicles or tasks to give more flexibility
|
|
3452
|
+
# - Adding more vehicles to the optimization problem
|
|
3453
|
+
# - Adjusting the priority of different tasks to balance the workload more evenly
|
|
3454
|
+
# - Modifying other constraints or parameters to make the problem more solvable
|
|
3455
|
+
#
|
|
3456
|
+
# Ultimately, the goal is to minimize the number of unassigned tasks while still
|
|
3457
|
+
# meeting all the necessary constraints and objectives.
|
|
3458
|
+
sig do
|
|
3459
|
+
params(
|
|
3460
|
+
jobs: T::Array[String],
|
|
3461
|
+
shipments: T::Array[T::Array[String]]
|
|
3462
|
+
).returns(T.attached_class)
|
|
3463
|
+
end
|
|
3464
|
+
def self.new(
|
|
3465
|
+
# Specify the unassigned job IDs from the previous optimization result. Please
|
|
3466
|
+
# note the IDs should also be present in the jobs part of the input.
|
|
3467
|
+
#
|
|
3468
|
+
# **Note:** We have modified the data type of this field. However, the latest
|
|
3469
|
+
# change is backward compatible and both integer and string type job IDs are valid
|
|
3470
|
+
# for this field, as long as they match the IDs of the jobs already configured.
|
|
3471
|
+
# Providing mixed value types in the array, will lead to an error.
|
|
3472
|
+
jobs: nil,
|
|
3473
|
+
# Specify the unassigned shipment pickup & delivery IDs from the previous
|
|
3474
|
+
# optimization result. Both the pickup & delivery steps of a shipment should be
|
|
3475
|
+
# part of the same array.
|
|
3476
|
+
#
|
|
3477
|
+
# **Note:** We have modified the data type of this field. However, the latest
|
|
3478
|
+
# change is backward compatible and both integer and string type shipment IDs are
|
|
3479
|
+
# valid for this field, as long as they match the IDs of the shipments already
|
|
3480
|
+
# configured. Providing mixed value types in the array, will lead to an error.
|
|
3481
|
+
shipments: nil
|
|
3482
|
+
)
|
|
3483
|
+
end
|
|
3484
|
+
|
|
3485
|
+
sig do
|
|
3486
|
+
override.returns(
|
|
3487
|
+
{ jobs: T::Array[String], shipments: T::Array[T::Array[String]] }
|
|
3488
|
+
)
|
|
3489
|
+
end
|
|
3490
|
+
def to_hash
|
|
3491
|
+
end
|
|
3492
|
+
end
|
|
3493
|
+
|
|
3494
|
+
class Zone < Nextbillionai::Internal::Type::BaseModel
|
|
3495
|
+
OrHash =
|
|
3496
|
+
T.type_alias do
|
|
3497
|
+
T.any(
|
|
3498
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone,
|
|
3499
|
+
Nextbillionai::Internal::AnyHash
|
|
3500
|
+
)
|
|
3501
|
+
end
|
|
3502
|
+
|
|
3503
|
+
# Provide an ID for the zone. This field is mandatory when adding zones.
|
|
3504
|
+
sig { returns(Integer) }
|
|
3505
|
+
attr_accessor :id
|
|
3506
|
+
|
|
3507
|
+
# Provide the ID of a pre-created geofence using the
|
|
3508
|
+
# [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence).
|
|
3509
|
+
#
|
|
3510
|
+
# Please note that one of geometry or geofence_id should be provided.
|
|
3511
|
+
sig { returns(T.nilable(String)) }
|
|
3512
|
+
attr_reader :geofence_id
|
|
3513
|
+
|
|
3514
|
+
sig { params(geofence_id: String).void }
|
|
3515
|
+
attr_writer :geofence_id
|
|
3516
|
+
|
|
3517
|
+
# It is a [geoJSON object](https://datatracker.ietf.org/doc/html/rfc7946#page-9)
|
|
3518
|
+
# with details of the geographic boundaries of the zone. Only “Polygon” and
|
|
3519
|
+
# “MultiPolygon” geoJSON types are supported.
|
|
3520
|
+
#
|
|
3521
|
+
# Please note that one of geometry or geofence_id should be provided.
|
|
3522
|
+
sig do
|
|
3523
|
+
returns(
|
|
3524
|
+
T.nilable(
|
|
3525
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry
|
|
3526
|
+
)
|
|
3527
|
+
)
|
|
3528
|
+
end
|
|
3529
|
+
attr_reader :geometry
|
|
3530
|
+
|
|
3531
|
+
sig do
|
|
3532
|
+
params(
|
|
3533
|
+
geometry:
|
|
3534
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::OrHash
|
|
3535
|
+
).void
|
|
3536
|
+
end
|
|
3537
|
+
attr_writer :geometry
|
|
3538
|
+
|
|
3539
|
+
sig do
|
|
3540
|
+
params(
|
|
3541
|
+
id: Integer,
|
|
3542
|
+
geofence_id: String,
|
|
3543
|
+
geometry:
|
|
3544
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::OrHash
|
|
3545
|
+
).returns(T.attached_class)
|
|
3546
|
+
end
|
|
3547
|
+
def self.new(
|
|
3548
|
+
# Provide an ID for the zone. This field is mandatory when adding zones.
|
|
3549
|
+
id:,
|
|
3550
|
+
# Provide the ID of a pre-created geofence using the
|
|
3551
|
+
# [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence).
|
|
3552
|
+
#
|
|
3553
|
+
# Please note that one of geometry or geofence_id should be provided.
|
|
3554
|
+
geofence_id: nil,
|
|
3555
|
+
# It is a [geoJSON object](https://datatracker.ietf.org/doc/html/rfc7946#page-9)
|
|
3556
|
+
# with details of the geographic boundaries of the zone. Only “Polygon” and
|
|
3557
|
+
# “MultiPolygon” geoJSON types are supported.
|
|
3558
|
+
#
|
|
3559
|
+
# Please note that one of geometry or geofence_id should be provided.
|
|
3560
|
+
geometry: nil
|
|
3561
|
+
)
|
|
3562
|
+
end
|
|
3563
|
+
|
|
3564
|
+
sig do
|
|
3565
|
+
override.returns(
|
|
3566
|
+
{
|
|
3567
|
+
id: Integer,
|
|
3568
|
+
geofence_id: String,
|
|
3569
|
+
geometry:
|
|
3570
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry
|
|
3571
|
+
}
|
|
3572
|
+
)
|
|
3573
|
+
end
|
|
3574
|
+
def to_hash
|
|
3575
|
+
end
|
|
3576
|
+
|
|
3577
|
+
class Geometry < Nextbillionai::Internal::Type::BaseModel
|
|
3578
|
+
OrHash =
|
|
3579
|
+
T.type_alias do
|
|
3580
|
+
T.any(
|
|
3581
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry,
|
|
3582
|
+
Nextbillionai::Internal::AnyHash
|
|
3583
|
+
)
|
|
3584
|
+
end
|
|
3585
|
+
|
|
3586
|
+
# An array of coordinates in the \[longitude, latitude\] format, representing the
|
|
3587
|
+
# zone boundary.
|
|
3588
|
+
sig { returns(T.nilable(T::Array[T::Array[Float]])) }
|
|
3589
|
+
attr_reader :coordinates
|
|
3590
|
+
|
|
3591
|
+
sig { params(coordinates: T::Array[T::Array[Float]]).void }
|
|
3592
|
+
attr_writer :coordinates
|
|
3593
|
+
|
|
3594
|
+
# Provide a description to identify the zone
|
|
3595
|
+
sig { returns(T.nilable(String)) }
|
|
3596
|
+
attr_reader :description
|
|
3597
|
+
|
|
3598
|
+
sig { params(description: String).void }
|
|
3599
|
+
attr_writer :description
|
|
3600
|
+
|
|
3601
|
+
# Type of the geoJSON geometry. Should always be Polygon or MultiPolygon.
|
|
3602
|
+
sig do
|
|
3603
|
+
returns(
|
|
3604
|
+
T.nilable(
|
|
3605
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::OrSymbol
|
|
3606
|
+
)
|
|
3607
|
+
)
|
|
3608
|
+
end
|
|
3609
|
+
attr_reader :type
|
|
3610
|
+
|
|
3611
|
+
sig do
|
|
3612
|
+
params(
|
|
3613
|
+
type:
|
|
3614
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::OrSymbol
|
|
3615
|
+
).void
|
|
3616
|
+
end
|
|
3617
|
+
attr_writer :type
|
|
3618
|
+
|
|
3619
|
+
# It is a [geoJSON object](https://datatracker.ietf.org/doc/html/rfc7946#page-9)
|
|
3620
|
+
# with details of the geographic boundaries of the zone. Only “Polygon” and
|
|
3621
|
+
# “MultiPolygon” geoJSON types are supported.
|
|
3622
|
+
#
|
|
3623
|
+
# Please note that one of geometry or geofence_id should be provided.
|
|
3624
|
+
sig do
|
|
3625
|
+
params(
|
|
3626
|
+
coordinates: T::Array[T::Array[Float]],
|
|
3627
|
+
description: String,
|
|
3628
|
+
type:
|
|
3629
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::OrSymbol
|
|
3630
|
+
).returns(T.attached_class)
|
|
3631
|
+
end
|
|
3632
|
+
def self.new(
|
|
3633
|
+
# An array of coordinates in the \[longitude, latitude\] format, representing the
|
|
3634
|
+
# zone boundary.
|
|
3635
|
+
coordinates: nil,
|
|
3636
|
+
# Provide a description to identify the zone
|
|
3637
|
+
description: nil,
|
|
3638
|
+
# Type of the geoJSON geometry. Should always be Polygon or MultiPolygon.
|
|
3639
|
+
type: nil
|
|
3640
|
+
)
|
|
3641
|
+
end
|
|
3642
|
+
|
|
3643
|
+
sig do
|
|
3644
|
+
override.returns(
|
|
3645
|
+
{
|
|
3646
|
+
coordinates: T::Array[T::Array[Float]],
|
|
3647
|
+
description: String,
|
|
3648
|
+
type:
|
|
3649
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::OrSymbol
|
|
3650
|
+
}
|
|
3651
|
+
)
|
|
3652
|
+
end
|
|
3653
|
+
def to_hash
|
|
3654
|
+
end
|
|
3655
|
+
|
|
3656
|
+
# Type of the geoJSON geometry. Should always be Polygon or MultiPolygon.
|
|
3657
|
+
module Type
|
|
3658
|
+
extend Nextbillionai::Internal::Type::Enum
|
|
3659
|
+
|
|
3660
|
+
TaggedSymbol =
|
|
3661
|
+
T.type_alias do
|
|
3662
|
+
T.all(
|
|
3663
|
+
Symbol,
|
|
3664
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type
|
|
3665
|
+
)
|
|
3666
|
+
end
|
|
3667
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
3668
|
+
|
|
3669
|
+
POLYGON =
|
|
3670
|
+
T.let(
|
|
3671
|
+
:Polygon,
|
|
3672
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::TaggedSymbol
|
|
3673
|
+
)
|
|
3674
|
+
MULTI_POLYGON =
|
|
3675
|
+
T.let(
|
|
3676
|
+
:MultiPolygon,
|
|
3677
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::TaggedSymbol
|
|
3678
|
+
)
|
|
3679
|
+
|
|
3680
|
+
sig do
|
|
3681
|
+
override.returns(
|
|
3682
|
+
T::Array[
|
|
3683
|
+
Nextbillionai::Optimization::V2SubmitParams::Zone::Geometry::Type::TaggedSymbol
|
|
3684
|
+
]
|
|
3685
|
+
)
|
|
3686
|
+
end
|
|
3687
|
+
def self.values
|
|
3688
|
+
end
|
|
3689
|
+
end
|
|
3690
|
+
end
|
|
3691
|
+
end
|
|
3692
|
+
end
|
|
3693
|
+
end
|
|
3694
|
+
end
|
|
3695
|
+
end
|