4

I am trying to get a Vehicle Routing Problem to work as a geoprocessing service on one of our servers.

I used the default_date with unix time stamp in miliseconds and set the times of orders and depot in the format of "10:00 AM UTC". Now I get a time constraint violation for the orders ("ViolatedConstraints": 32)

If I take out the line "MaxViolationTime1":0 from the orders in my REST url, a route is calculated with correct travel times and distances and I can see the results. Especially the following lines (attributes of output route) caught my eye:

...
"TotalCost": 42.5174562651664,
"RegularTimeCost": 42.5174562651664,
...
"TotalTime": 42.5174562651664,
"TotalOrderServiceTime": 20,
...
"TotalTravelTime": 22.517456265166402,
...
"StartTime": 1369180800000,
"EndTime": 1369183351047,
...
"TotalViolationTime": 30.35018770210445,
...

I can change the default date and the earliest/latest start time, but the route starts still on the current date, at 2 AM. Could it be that some date and time options are "hard coded" somewhere in the module that was used to create the geoprocessing service? I checked the module again and can't find any options to change default date and time settings.

asked May 22, 2013 at 9:38

1 Answer 1

1
default_date

The parameter value should be specified as a numeric value representing the milliseconds since midnight January 1, 1970.

Default is in minutes:

Use this parameter to specify the time units for all time-based attribute values specified with different parameters. The parameter is specified using one of the following values: Seconds, Minutes, Hours, Days.

Many parameters in the vehicle routing problem request have attributes for storing time values, such as ServiceTime for the orders parameter and CostPerUnitTime for the routes parameter. To minimize data entry requirements, these attribute values don't include units. Instead, all time-based attribute values must be entered in the same units, and the time_units parameter is used to specify the units of those values.

Example request:

https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRoutingProblem/GPServer/SolveVehicleRoutingProblem/submitJob?token=yourToken&orders={"features":[{"geometry":{"x":-122.51,"y":37.7724},"attributes":{"DeliveryQuantities":1706,"Name":"Store_1","ServiceTime":25,"TimeWindowStart1":1355245200000,"TimeWindowEnd1":1355274000000,"MaxViolationTime1":0}},{"geometry":{"x":-122.4889,"y":37.7538},"attributes":{"DeliveryQuantities":1533,"Name":"Store_2","ServiceTime":23,"TimeWindowStart1":1355245200000,"TimeWindowEnd1":1355274000000,"MaxViolationTime1":0}},{"geometry":{"x":-122.4649,"y":37.7747},"attributes":{"DeliveryQuantities":1580,"Name":"Store_3","ServiceTime":24,"TimeWindowStart1":1355245200000,"TimeWindowEnd1":1355274000000,"MaxViolationTime1":0}},{"geometry":{"x":-122.4739,"y":37.7432},"attributes":{"DeliveryQuantities":1289,"Name":"Store_4","ServiceTime":20,"TimeWindowStart1":1355245200000,"TimeWindowEnd1":1355274000000,"MaxViolationTime1":0}},{"geometry":{"x":-122.4493,"y":37.7315},"attributes":{"DeliveryQuantities":1302,"Name":"Store_5","ServiceTime":21,"TimeWindowStart1":1355245200000,"TimeWindowEnd1":1355274000000,"MaxViolationTime1":0}},{"geometry":{"x":-122.4917,"y":37.6493},"attributes":

Full documentation: (ArcGIS 10.2 preview)

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000n4000000

answered May 22, 2013 at 17:31
1
  • The time units are actually already correct. If I add "time_units=Minutes", nothing in the outuput changes. The "StartTime" date still differs from the default_date. Commented May 23, 2013 at 7:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.