Running the Vehicle Routing Model
One of the advantages of creating a vehicle routing model via the Network Analyst extension is the ability to run the model multiple times while making small adjustments in between. In this activity, you will run several models, adjusting the parameters each time. For the first run of the model, all of our parameters were set in the previous steps. To run the model currently loaded in the Network Analyst Window, click on the Solve button in the Network Analyst Toolbar.
Note: Depending on the speed of your computer, the model may take a while to run. Expect to wait up five or ten minutes. Take a moment to stand, walk around, or stretch. Do not try to work in the ArcGIS software while the model is running.
When the Network Analyst completes the first run, it writes the results into the temporary memory layers in the Table of Contents. ArcMap assigns a number to each order, and the route appears on the map.
You may also see a warning message appear. Click OK and take a moment to inspect the results of the first run of the vehicle routing model.
You should see that, as the warning indicated, some orders were not met. The orders that could not be routed appear as red circles, both on the map as well as in the Network Analyst Window. To find out why these orders were not fulfilled, you will have to find the answers to several questions.
- Which orders were not filled?
- What constraints were violated?
- How much time did the garbage truck spend on the route from start to finish?
Based on our model parameters, we know the garbage dump is only open between 5 am and 7 pm. We also know that a single truck driver is only allowed a maximum shift of twelve hours. Also, some businesses prefer to have the organic waste pick-ups during shorter time windows than others. All of these factors represent constraints in our model.
Open the attribute table from the Orders layer in the Table of Contents. Use Select by Attributes to select the records with a Status of Not reached. Look for the ViolatedConstraints field. Many of the attributes have a NULL value, but the attribute for ViolatedContraints might say MaxTotalTime exceeded. This may not seem completely intuitive to some. For more information, you can also look at the results written to the Routes Layer in the Table of Contents.
Clear the select features from the Orders attribute table. Then open the attribute table for the Routes layer. Because there is only one route, you will see only one record in the attribute table. Locate the TotalTime field and find out how long, in minutes, did the garbage truck spend on the route. How close was it to the 720-minute maximum? If it was very close, then it is likely that the garbage truck spent nearly twelve hours on the road before running out of time.
Open a blank Excel workbook and create a table recording the following results from your first model. You will find these results in the Routes attribute table.
- A description of the truck
- The total cost of the route, in dollars.
- The total time spent on the route, in minutes.
- The number of time violations
Note: Time Violations are garbage pickups that were fulfilled, but outside of the preferred time window specified by the participating businesses. They show up on the map as red squares.
From the Orders Attribute table, add:
- The number of orders not reached.
Title the table, VRM Model 1. An example table is shown below.
|VRM Model 1||Results|
|Description||One side-loading truck|
|Total cost in dollars||?|
|Total time in minutes||?|
|Number of time violations||?|
|Orders not reached||?|
Save your excel file in your final folder for later use.