<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic VRP automation? in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/vrp-automation/m-p/480151#M4692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Hello GeoNet,&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;I am working on a large Vehicle Routing Problem (VRP) for a number of depots and orders all across Michigan. Thus far I have been manually doing the VRP, adding Routes manually via 'Add Item' and changing its specifics. The sheer number of Routes and Route Renewals makes the task of doing this across all of Michigan essentially impossible.&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;I have some minor experience with ModelBuilder, but I am having difficulty automating the process.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Ideally, the computer would automatically&amp;nbsp;add a number of Routes and Renewals based on values in the attribute table of the Depot (some have only 1 truck for deliveries, some have multiple, etc).&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Is it possible to do what I need with ModelBuilder, or is another tool better?&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;How should I go about doing this?&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px 0px;"&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2017 19:22:32 GMT</pubDate>
    <dc:creator>DavidSouth2</dc:creator>
    <dc:date>2017-03-16T19:22:32Z</dc:date>
    <item>
      <title>VRP automation?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/vrp-automation/m-p/480151#M4692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Hello GeoNet,&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;I am working on a large Vehicle Routing Problem (VRP) for a number of depots and orders all across Michigan. Thus far I have been manually doing the VRP, adding Routes manually via 'Add Item' and changing its specifics. The sheer number of Routes and Route Renewals makes the task of doing this across all of Michigan essentially impossible.&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;I have some minor experience with ModelBuilder, but I am having difficulty automating the process.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Ideally, the computer would automatically&amp;nbsp;add a number of Routes and Renewals based on values in the attribute table of the Depot (some have only 1 truck for deliveries, some have multiple, etc).&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;Is it possible to do what I need with ModelBuilder, or is another tool better?&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px;"&gt;How should I go about doing this?&lt;/P&gt;&lt;P style="color: #222222; font-size: 14px; margin: 0.357143em 0px 0px;"&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:22:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/vrp-automation/m-p/480151#M4692</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2017-03-16T19:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: VRP automation?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/vrp-automation/m-p/480152#M4693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are wanting to create a VRP layer by looking into the attribute table for the depot your best bet is probably to do it through python. &amp;nbsp;There is some example code on both the solve VRP and make VRP help pages. &amp;nbsp;Here is the link for them:&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/network-analyst-toolbox/solve-vehicle-routing-problem.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/network-analyst-toolbox/solve-vehicle-routing-problem.htm"&gt;Solve Vehicle Routing Problem—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/network-analyst-toolbox/make-vehicle-routing-problem-layer.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/network-analyst-toolbox/make-vehicle-routing-problem-layer.htm"&gt;Make Vehicle Routing Problem Layer—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since it sounds like you have a layer partly set up with the depots you could use some code like this to look at the depots and determine the number of routes that are to&amp;nbsp;be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# open the layer File&amp;nbsp;&lt;BR /&gt; layerFile = arcpy.mapping.Layer(layer)&lt;/P&gt;&lt;P&gt;subLayerNames = dict((lyr.datasetName, lyr) for lyr in arcpy.mapping.ListLayers(layerFile)[1:])&lt;BR /&gt; depotsLayerName = subLayerNames["Depots"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&amp;nbsp;determine how many routes should be created&lt;BR /&gt;depotCursor = arcpy.SearchCursor(depotsLayerName)&lt;BR /&gt; for row in depotCursor:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; numberOfRoutes = row.getValue("?????") # add the name of whatever attribute indicates the number of routes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;depotName = row.getValue("Name")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From there you could create a temporary text file that gets a line for each route you want to create and then add the routes using the route field mappings and add locations scripts like shown in the above links.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 21:33:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/vrp-automation/m-p/480152#M4693</guid>
      <dc:creator>HeatherMoe</dc:creator>
      <dc:date>2017-03-23T21:33:56Z</dc:date>
    </item>
  </channel>
</rss>

