here_location_services.config.tour_planning_config module
This module defines all the configs which will be required as inputs to Tour planning API.
- class here_location_services.config.tour_planning_config.TourPlanningAvoidFeatures(**kwargs)[source]
Bases:
here_location_services.config.base_config.Bunch
A class to define values for features to avoid features during tour planning calculation.
- here_location_services.config.tour_planning_config.TOUR_PLANNING_AVOID_FEATURES = {'dirtRoad': 'dirtRoad', 'ferry': 'ferry', 'motorway': 'motorway', 'tollRoad': 'tollRoad', 'tunnel': 'tunnel'}
Use this config for avoid of Tour planning API. Example: for
tollRoad
avoids useTOUR_PLANNING_AVOID_FEATURES.tollRoad
.
- class here_location_services.config.tour_planning_config.VehicleMode(**kwargs)[source]
Bases:
here_location_services.config.base_config.Bunch
A class to define values vehicle mode in vehicle profile.
- here_location_services.config.tour_planning_config.VEHICLE_MODE = {'bicycle': 'bicycle', 'car': 'car', 'pedestrian': 'pedestrian', 'scooter': 'scooter', 'truck': 'truck'}
Use this config for vehicle_mode of Tour planning API. Example: for
scooter
avoids useVEHICLE_MODE.scooter
.
- class here_location_services.config.tour_planning_config.VehicleType(id, profile_name, amount, capacity, shift_start, shift_end=None, shift_breaks=None, costs_fixed=0, costs_distance=0, costs_time=0, skills=None, limits=None)[source]
Bases:
object
A class to define
VehicleType
Type of vehicle in a fleet
- Parameters
id (str) –
profile_name (str) –
amount (int) –
capacity (List[int]) –
shift_start (Dict) –
shift_end (Optional[Dict]) –
shift_breaks (Optional[List]) –
costs_fixed (float) –
costs_distance (float) –
costs_time (float) –
skills (Optional[List[str]]) –
limits (Optional[Dict]) –
- __init__(id, profile_name, amount, capacity, shift_start, shift_end=None, shift_breaks=None, costs_fixed=0, costs_distance=0, costs_time=0, skills=None, limits=None)[source]
- Parameters
id (str) – Specifies id of the vehicle type. Avoid assigning real-life identifiers, such as vehicle license plate as the id of a vehicle
profile_name (str) – characters ^[a-zA-Z0-9_-]+$ Specifies the name of the profile. Avoid assigning real-life identifiers, such as a vehicle license plate Id or personal name as the profileName of the routing profile.
amount (int) – Amount of vehicles available.
capacity (List[int]) – Unit of measure, e.g. volume, mass, size, etc.
shift_start (Dict) – Represents a depot: a place where a vehicle starts
costs_fixed (float) – A fixed cost to start using vehicle of this type. It is optional with a default value of zero
shift_end (Optional[Dict]) – Represents a depot: a place where a vehicle ends
shift_breaks (Optional[List]) – Represents a depot: a place where a vehicle takes breaks
costs_distance (float) – A cost per meter. It is optional with a default value of zero.
costs_time (float) – A cost per second. It is optional with a default value of zero. In case time and distance costs are zero then a small time cost 0.00000000001 will be used instead
skills (Optional[List[str]]) – A list of skills for a vehicle or a job.
limits (Optional[Dict]) – Contains constraints applied to a vehicle type.
- class here_location_services.config.tour_planning_config.VehicleProfile(name, vehicle_mode, departure_time=None, avoid=None, truck_options=None, allow_highway_for_scooter=None)[source]
Bases:
object
A class to define
VehicleProfile
Profile of vehicle in a fleet
- Parameters
name (str) – Specifies the name of the profile. Avoid assigning real-life identifiers, such as a vehicle license plate Id or personal name as the profileName of the routing profile.
vehicle_mode (str) – Contains constraints applied to a vehicle type.
departure_time (Optional[datetime.datetime]) – Represents time of departure.
avoid (Optional[List[here_location_services.config.tour_planning_config.TourPlanningAvoidFeatures]]) – Avoid routes that violate these properties.
truck_options (Optional[here_location_services.config.base_config.Truck]) – Specifies truck profile options.
allow_highway_for_scooter (Optional[bool]) – Specifies whether routing calculation should take highways into account. When this parameter isn’t provided, then by default highways would be avoided. If the avoid feature motorway is provided, then highways would be avoided, even if this is set to true.
- Raises
ValueError – If
truck_options
are provided without setting vehicle_mode toVEHICLE_MODE.truck
ValueError – If
allow_highway_for_scooter
is provided without setting vehicle_mode toVEHICLE_MODE.scooter
- __init__(name, vehicle_mode, departure_time=None, avoid=None, truck_options=None, allow_highway_for_scooter=None)[source]
- Parameters
name (str) –
vehicle_mode (str) –
departure_time (Optional[datetime.datetime]) –
avoid (Optional[List[here_location_services.config.tour_planning_config.TourPlanningAvoidFeatures]]) –
truck_options (Optional[here_location_services.config.base_config.Truck]) –
allow_highway_for_scooter (Optional[bool]) –
- class here_location_services.config.tour_planning_config.Fleet(vehicle_types, vehicle_profiles)[source]
Bases:
object
A class to define
Fleet
A fleet represented by various vehicle types for serving jobs.
- Parameters
vehicle_types (List[here_location_services.config.tour_planning_config.VehicleType]) – A list of vehicle types. The upper limit for the number of vehicle types is 35 for the synchronous problems endpoint and 150 for the asynchronous problems endpoint.
vehicle_profiles (List) – Specifies the profile of the vehicle.
- __init__(vehicle_types, vehicle_profiles)[source]
- Parameters
vehicle_types (List[here_location_services.config.tour_planning_config.VehicleType]) –
vehicle_profiles (List) –
- class here_location_services.config.tour_planning_config.JobPlaces(duration, demand, location, tag=None, times=None)[source]
Bases:
object
A class to define
JobPlaces
- Parameters
duration (int) – Represents duration in seconds.
demand (List[int]) – Unit of measure, e.g. volume, mass, size, etc.
location (Tuple) – Represents geospatial location defined by latitude and longitude.
tag (Optional[str]) – A free text associated with the job place. Avoid referencing any confidential or personal information as part of the JobTag.
times (Optional[List[List[str]]]) – Represents multiple time windows.
- class here_location_services.config.tour_planning_config.Job(id, skills=None, priority=None, pickups=None, deliveries=None)[source]
Bases:
object
A class to define
Job
A fleet represented by various vehicle types for serving jobs.
- Parameters
id (str) – Specifies id of the job. Avoid referencing any sensitive or personal information, such as names, addresses, information about a delivery or service, as part of the jobId.
skills (Optional[List]) – A list of skills for a vehicle or a job.
priority (Optional[int]) – Specifies the priority of the job with 1 for high priority jobs and 2 for normal jobs.
pickups (Optional[List[here_location_services.config.tour_planning_config.JobPlaces]]) – Places where sub jobs to be performed. All pickups are done before any other delivery.
deliveries (Optional[List[here_location_services.config.tour_planning_config.JobPlaces]]) – Places where sub jobs to be performed. All pickups are done before any other delivery.
- Raises
ValueError – If no subjob is specified either as pickup or delivery.
- __init__(id, skills=None, priority=None, pickups=None, deliveries=None)[source]
- Parameters
id (str) –
skills (Optional[List]) –
priority (Optional[int]) –
pickups (Optional[List[here_location_services.config.tour_planning_config.JobPlaces]]) –
deliveries (Optional[List[here_location_services.config.tour_planning_config.JobPlaces]]) –
- class here_location_services.config.tour_planning_config.Relation(type, jobs, vehicle_id)[source]
Bases:
object
A class to define
Relation
Represents a list of preferred relations between jobs, vehicles.
- Parameters
type (str) – “sequence” “tour” “flexible” Defines a relation between jobs and a specific vehicle
jobs (List) – Ids of jobs or reserved activities. There are three reserved activity ids: - departure: specifies departure activity. Should be first in the list. - break: specifies vehicle break activity - arrival: specifies arrival activity. Should be last in the list.
vehicle_id (str) – A unique identifier of an entity. Avoid referencing any confidential or personal information as part of the Id.
- class here_location_services.config.tour_planning_config.Plan(jobs, relations=None)[source]
Bases:
object
A class to define
Plan
Represents the list of jobs to be served.
- Parameters
jobs (List[here_location_services.config.tour_planning_config.Job]) –
relations (Optional[List[here_location_services.config.tour_planning_config.Relation]]) –
- __init__(jobs, relations=None)[source]
- Parameters
jobs (List[here_location_services.config.tour_planning_config.Job]) –
relations (Optional[List[here_location_services.config.tour_planning_config.Relation]]) –