74 | | <Leave open for a list of existing implementation of this solution in Sahana Eden:> |
75 | | <*a brief description of the implementation (date/time, name, design options chosen)> |
76 | | <*a link to the code> |
77 | | <*list of deployments of the implementation> |
78 | | <*links to case studies> |
79 | | <*short analysis of achievements/problems> |
| 74 | This implementation is entirely based on OptaPlanner. |
| 75 | The main method of this module is present at - |
| 76 | Sahana/examples/sources/src/main/java/org/optaplanner/examples/vehiclerouting/app/VehicleRoutingApp.java |
| 77 | This main method takes an argument. This argument is a path for an unsolved Capacitated Vehicle Routing Problem, which is in the form of a XML file. |
| 78 | An example of an unsolved XML file, can be seen here - examples/data/vehiclerouting |
| 79 | This unsolved XML file has following main attributes: |
| 80 | - Location List (Longitude and Latitude) |
| 81 | - Depot List (With a reference to a Location in the Location List) |
| 82 | - Vehicle List (Stating the Capacity and the location of the Vehicle) |
| 83 | - Customer List (Stating the Demand of each of the locations) |
| 84 | |
| 85 | When such a XML file, is passed to the module, it returns back, a Solved XML file, which is stored in the same directory as the unsolved file, which was passed earlier, with the prefix – “solved-” |
| 86 | This XML file, has to be parsed by the modules in Sahana, and should be utilised upon. |
| 87 | The final Solved file, diagrammatically, looks similar to this. This Solved file, tells which Vehicle should go to which Location(s), in which order. Such an example, can be seen here: https://github.com/wolfshadow18/Vehicle-Routing-Problem/blob/master/Sahana-Final/Sahana/examples/data/vehiclerouting/solved-cvrp-72customers.xml |
| 88 | |
| 89 | [[Image(https://github.com/wolfshadow18/Vehicle-Routing-Problem/blob/master/Solved%20Example.png)]] |
| 90 | |
| 91 | |
| 92 | To Test the module, please perform the following steps. |
| 93 | - Download a copy of the module, which is currently being hosted at, https://github.com/wolfshadow18/Vehicle-Routing-Problem/ |
| 94 | - Download IntelliJ Idea/ Netbeans. It is recommended to use the former. |
| 95 | - Open pom.xml, which is located at examples/sources/ from the IDE |
| 96 | - While setting up for the first time, it may take some time, as it needs to download its Maven dependencies. |
| 97 | - After which, set up a Run configuration, for this project. Please look at the image below. The program arguments, should ideally contain the path of the unsolved file, that you wish to pass to the module. |
| 98 | |
| 99 | [[Image(https://github.com/wolfshadow18/Vehicle-Routing-Problem/blob/master/Run%20Configuration.png)]] |
| 100 | |
| 101 | |
| 102 | - Go to Sahana/examples/sources/src/main/java/org/optaplanner/examples/vehiclerouting/app/VehicleRoutingApp.java, and run the project. |
| 103 | - Troubleshooting: In case, an error such as- “The working directory should be set to the directory that contains the data directory (which is not the data directory itself) “ pops up, please check whether your working directory is the same as mentioned above. |
| 104 | - You would notice that, in the console, the program has started running, typically, for testing purposes; the running time of the module has been limited to 1 minute. However, this can be increased, by changing, /examples/sources/src/main/resources/org/optaplanner/examples/vehiclerouting/solver/vehicleRoutingSolverConfig.xml |
| 105 | - In this file, find the attribute minutesTimeSpent, and change it to a positive integer. This can be done whenever necessary as all the attributes of this file, have methods in which they can be accessed. |
| 106 | |
| 107 | Few points to be noted: |
| 108 | a) As solving time of the problem is increased, more efficient results can be obtained. |
| 109 | b) The file is returned back to the user using the function, getOutputFile(), which is also present in VehicleRoutingApp.java |