How to get multiple depots in the Optaplanner cvrptw example?

354 views Asked by At

Currently there is just a single depot. I want to use my own data as input and I need to generate 2 depot locations with their own vehicles located to them.

1

There are 1 answers

0
Jeroen van Zeeland On

The solution for creating is second depot is pretty easy. Depending on which file you want to change it becomes a little more tedious.

  1. VRP Solution

Go to the corresponding .vrp file and scroll down to:

DEPOT_SECTION
1   
-1

Change into:

DEPOT_SECTION
1
2
-1

Here the 1 refers to the first position in the NODE_COORD_SECTION, and the 2 to the second.

  1. XML Solution

Go to the corresponding XML file and go to:

<depotList>
<VrpDepot id="197">
  <id>1</id>
  <location class="VrpAirLocation" reference="3"/>
</VrpDepot>

'copy to get more depots  

</depotList>

You can then change which trucks are sourced from which warehouse (or depot).