Elme Pieterse
Elme Pieterse

Reputation: 19

How to get multiple depots in the Optaplanner cvrptw example?

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.

Upvotes: 0

Views: 351

Answers (1)

Jeroen van Zeeland
Jeroen van Zeeland

Reputation: 21

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).

Upvotes: 2

Related Questions