Package: vrt-lss-universal
# Description  Software interface for universal trip planning.  ## Features  * Ability to pick up cargo from any location * Possibility of unloading in any location * Pair orders of several types: &#x60;PICKUP&#x60; (loading), &#x60;DROP&#x60; (unloading) * Single requests of several types: &#x60;DROP_FROM_BOX&#x60; (unloading cargo that is already in the body), &#x60;PICKUP_TO_BOX&#x60; (cargo pickup into the body without subsequent unloading), &#x60;WORK&#x60; (working at the location without moving the cargo) * A complex order can consist of any number of orders of any type * Transport and executors are divided into different entities, when planning, the optimal assignment of the executor to the transport occurs * The transport has several compartments - each of which can accommodate cargo and has its own characteristics * Accounting for the compatibility of cargo with transport in terms of cargo dimensions (length, width, height, additional capacity parameters) * Taking into account the compatibility of the cargo-compartment of transport (the ability to take into account the features of the compartment: refrigerator, thermal bag, fasteners, etc.) * Substitute applications, i.e. the ability to execute one of the substitute applications, the choice of which is based on its geographic location and time window  ## Restrictions support  **Performer** restrictions:  * Start/finish location * Accounting for the performer&#39;s way to the transport location * Performer&#39;s availability schedule is a list of time windows when the performer can move and work on locations * The maximum duration of the performer&#39;s work during the specified time period  **Transport** restrictions:  * Start/finish location * Transport availability schedule is a list of time windows when the transport is available * The maximum route distance * Several compartments in the transport, each with its own parameters * Capacity upper limit (weight, volume, number of orders, number of demands)  **Order** restrictions:  * Strict time windows * Ability to specify different valid time windows for a location and time windows to fulfil the desired demand * Accounting for the requests fulfillment order within the route * A list of desired time windows with different associated costs  ## Compatibilities  Entities are compatible if the capabilities list of one entity corresponds to the list of restrictions of another entity (example: fleet parameters corresponds to cargo parameters to be delivered).  Supported compatibilities:  | Name                    | Restrictions                     | Features                     | |-------------------------|----------------------------------|------------------------------| | Order - Performer       | order.performer_restrictions     | performer.performer_features | | Order - Not a performer | order.performer_blacklist        | performer.performer_features | | Cargo - Compartment     | order.cargo.box_restrictions     | transport.box.box_features   | | Location - Transport    | location.transport_restrictions  | transport.transport_features | | Transport - Performer   | transport.performer_restrictions | performer.performer_features | | Performer - Transport   | performer.transport_restrictions | transport.transport_features | | Order - Order           | order.order_restrictions         | order.order_features         |  Business rule examples:  | Name                    | Business rule example                                                                               | |-------------------------|-----------------------------------------------------------------------------------------------------| | Order - Performer       | The driver must have a special license to fulfil the order                                          | | Order - Not a performer | The driver is in the blacklist                                                                      | | Cargo - Box             | For transportation of frozen products, a compartment with a special temperature profile is required | | Location - Transport    | Restrictions on the transport height                                                                | | Transport - Performer   | The truck driver must have the class C driving license                                              | | Performer - Transport   | The driver is allowed to work on a specific transport                                               | | Order - Order           | It is not allowed to transport fish and fruits in the same compartment                              |  ## Cargo placement  List of possibilities of a object rotations (90 degree step):  * &#x60;ALL&#x60; - can rotate by any axis * &#x60;YAW&#x60; - can yaw * &#x60;PITCH&#x60; - can pitch * &#x60;ROLL&#x60; - can roll    ![rotation](../images/universal_cargo_yaw_pitch_roll.svg)  ## Trip model  The trip is described by the list of states of the executor, while the executor can be in several states at the same time (for example, to be inside the working time window of a location and fulfill an order at the same location).  Possible values ​​of the flags responsible for the geographical location:  * &#x60;AROUND_LOCATION&#x60; - the performer is located near the location - in the process of parking or leaving it. * &#x60;INSIDE_LOCATION&#x60; - the performer is at the location.  Possible values ​​of the flags responsible for being in time windows:  * &#x60;INSIDE_WORKING_WINDOW&#x60; - the executor is inside the working time window. * &#x60;INSIDE_LOCATION_WINDOW&#x60; - the executor is inside the location&#39;s working time. * &#x60;INSIDE_EVENT_HARD_WINDOW&#x60; - the executor is inside a hard time window. * &#x60;INSIDE_EVENT_SOFT_WINDOW&#x60; - the executor is inside the soft time window.  Possible values ​​of flags responsible for actions:  * &#x60;ON_DEMAND&#x60; - the executor is working on the request. * &#x60;WAITING&#x60; - the performer is in standby mode. * &#x60;RELOCATING&#x60; - the executor is moving to the next stop. * &#x60;BREAK&#x60; - the performer is on a break.  ### An example of a route with multiple states at each point in time  | time  | set of active flags                                                                                                                                                          | location / order / application / event | comment                                                                                        | |:------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------|:-----------------------------------------------------------------------------------------------| | 10:00 | INSIDE_LOCATION &lt;br/&gt; AROUND_LOCATION                                                                                                                                        | 2 / - / - / -                          | starting location                                                                              | | 10:10 | RELOCATING                                                                                                                                                                   | - / - / - / -                          | we go to the first order                                                                       | | 10:20 | AROUND_LOCATION                                                                                                                                                              | 2 / - / - / -                          | arrived at the first order                                                                     | | 10:40 | AROUND_LOCATION &lt;br/&gt; INSIDE_LOCATION &lt;br/&gt; WAITING                                                                                                                          | 2 / - / - / -                          | parked                                                                                         | | 11:00 | AROUND_LOCATION &lt;br/&gt; INSIDE_LOCATION &lt;br/&gt; INSIDE_LOCATION_WINDOW &lt;br/&gt; WAITING &lt;br/&gt; INSIDE_EVENT_HARD_WINDOW                                                              | 2 / - / - / -                          | waited for the start of the location window and at the same time the availability of the order | | 11:25 | AROUND_LOCATION &lt;br/&gt; INSIDE_LOCATION &lt;br/&gt; INSIDE_LOCATION_WINDOW &lt;br/&gt; ON_DEMAND &lt;br/&gt; INSIDE_WORKING_WINDOW &lt;br/&gt; INSIDE_EVENT_HARD_WINDOW                                | 2 / 1 / 2 / 3                          | waited for the change of artist                                                                | | 11:30 | AROUND_LOCATION &lt;br/&gt; INSIDE_LOCATION &lt;br/&gt; INSIDE_LOCATION_WINDOW &lt;br/&gt; ON_DEMAND &lt;br/&gt; INSIDE_WORKING_WINDOW &lt;br/&gt; INSIDE_EVENT_HARD_WINDOW &lt;br/&gt; INSIDE_EVENT_SOFT_WINDOW | 2 / 1 / 2 / 3                          | while working - a soft window happened                                                         | | 11:40 | AROUND_LOCATION &lt;br/&gt; INSIDE_LOCATION &lt;br/&gt; INSIDE_LOCATION_WINDOW &lt;br/&gt; INSIDE_WORKING_WINDOW                                                                               | 2 / - / - / -                          | finished working                                                                               | | 11:45 | AROUND_LOCATION &lt;br/&gt; INSIDE_WORKING_WINDOW                                                                                                                                  | 2 / - / - / -                          | drove out of the parking lot                                                                   | | 11:45 | RELOCATING &lt;br/&gt; INSIDE_WORKING_WINDOW                                                                                                                                       | - / - / - / -                          | we go to the next order                                                                        |  ## Planning configuration  For each planning, it is possible to specify a planning configuration that defines the objective function, the desired quality of the routes, and the calculation speed.  The name of the scheduling configuration is passed in the &#x60;trips_settings.configuration&#x60; field.  Main configurations:  | Title                           | Task                                                                                                                                                   | |---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | **optimize_distance**           | Arrange as many orders as possible, then optimize the total mileage (the number of vehicles is selected based on the mileage), used by default         | | **optimize_transports**         | Place as many orders as possible, while using as little transport as possible, ceteris paribus, optimize the work time of performers                   | | **optimize_locality_grouping**  | Place as many orders as possible, while striving to optimize the visual grouping of routes, but not their number                                       | | **optimize_cars_then_distance** | Arrange as many orders as possible, then optimize the number of vehicles, then the mileage                                                             | | **optimize_time**               | Place as many orders as possible, then optimize the total work time of performers                                                                      | | **optimize_cars_then_time**     | Arrange as many orders as possible, then optimize the number of transport, then the total time of the performers                                       | | **optimize_money**              | Optimize the value of \&quot;profit - costs\&quot;, consists of rewards for applications and costs for performers and transports (optimized value is non-negative) |  Additional configurations:  | Title                                                     | Task                                                                                                                                                                                            | |-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **visual_grouping**                                       | Arrange as many orders as possible while using as little transport as possible and routes should be visually grouped                                                                            | | **optimize_visual_grouping**                              | Arrange as many orders as possible, then evenly distribute orders taking into account transport accessibility zones (similar to visual_grouping, but visual grouping is calculated differently) | | **optimize_cars_then_locality_grouping**                  | Arrange as many orders as possible, then optimize the number of vehicles, then visually group the routes                                                                                        | | **optimize_cars_then_single_location_grouping_sequenced** | Place as many orders as possible, then optimize the number of machines, then reliability                                                                                                        |  In addition to the existing planning options, it is possible to create an objective function directly for the client&#39;s business processes ([request configuration](mailto:servicedesk@veeroute.com)).  For development, it is recommended to use **optimize_cars_then_distance**, since this configuration does not require detailed selection of rates and order values.  ## Data validation  Input data validation consists of several steps, which are described below.  Validation of planning results (including the search for possible reasons why orders were not planned) is located in the &#x60;analytics&#x60; method.  ### 1. Schema check  If the request does not follow the schema, then scheduling is not fully started and such an error is returned along with a 400 code in &#x60;schema_errors&#x60;.  We recommend validating the request against the schema (or yaml file) before sending it to the server.  ### 2. Check for logical errors that prevent planning from continuing  Schema-correct data passes the second stage of checking for the possibility of starting planning.  An example of errors at this stage are keys leading to empty entities, or if all orders are incompatible with all performers, i.e. something that makes the planning task pointless.  These errors are returned along with a 400 code in &#x60;logical_errors&#x60;.  ### 3. Check for logical errors that prevent planning from continuing  At the third stage, each entity is checked separately.  All entities that have not passed validation are cut out from the original task and are not sent for planning.  Depending on the setting of &#x60;treat_warnings_as_errors&#x60;, the results of this type of validation are returned to &#x60;warnings&#x60; either with a 400 code or with the scheduling result.  ### 4. Checks in the planning process  Part of the checks can only be carried out in the planning process.  For example - that according to the specified tariffs and according to the current traffic forecast, it is physically impossible to reach a certain point.  The results of these checks are returned in &#x60;warnings&#x60; or together with the scheduling result.  ## Entity relationship diagram  ![erd](../uml/universal.svg)  # Xlsx  &lt;!-- AUTO-GENERATED-CONTENT:START (FILE:src&#x3D;xlsx.md) --&gt; &lt;!-- The below content is automatically added from xlsx.md --&gt; Description of VRt.Universal XLSX format for import / data export.  This format is a complete display of data JSON models and is used for:  * initial data * process settings * calculation results * statistics on the calculation result  Below is a description of each sheet separately.  ## Locations  The name of the sheet &#x60;locations&#x60;.  List of locations that are used in orders and shifts.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/location\&quot; /&gt;  ## Performers  The name of the sheet is &#x60;performers&#x60;.  List of available performers.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/performer\&quot; /&gt;  ## Transports  The name of the sheet &#x60;transports&#x60;.  List of available transport.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/transport\&quot; /&gt;  ## Boxes  The name of the sheet is &#x60;transports.boxes&#x60;.  List of transport boxes that can accommodate the load. The table is mandatory if there are orders with applications of types of &#x60;PICKUP&#x60; and &#x60;DROP&#x60;. In the description of the compartments, those fields that describe cargo are required.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/box\&quot; /&gt;  ## Orders  The name of the sheet is &#x60;orders&#x60;.  List of orders.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/order\&quot; /&gt;  ## Cargos  The name of the sheet is &#x60;orders.cargos&#x60;.  List of goods. It may contain one load for &#x60;DROP&#x60;, a list for &#x60;PICKUP&#x60;, empty for &#x60;WORK&#x60;. The table is not obligatory if all applications have the type &#x60;WORK&#x60;.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/cargo\&quot; /&gt;  ## Hardlinks  The name of the sheet is &#x60;hardlinks&#x60;.  List of hardlinks.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/hardlink\&quot; /&gt;  ## Trips  The name of the sheet &#x60;trips&#x60;.  List of trips.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/trip\&quot; /&gt;  ## Facts  The name of the sheet is &#x60;facts&#x60;.  List of facts.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/facts\&quot; /&gt;  ## Plan settings  The name of the sheet &#x60;plan_settings&#x60;.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/plan_settings\&quot; /&gt;  ## Actualize settings  The name of the sheet is &#x60;actualize_settings&#x60;.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/actualize_settings\&quot; /&gt;  ## Replan settings  The name of the sheet is &#x60;replan_settings&#x60;.  The described object: &lt;SchemaDefinition schemaRef&#x3D;\&quot;#/components/schemas/replan_settings\&quot; /&gt; &lt;!-- AUTO-GENERATED-CONTENT:END --&gt;