mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Add VehicleRoutingTransportCostsMatrix to allow considering pre-compiled
time and/or distance matrices. The CostMatrixExample illustrates its use.
This commit is contained in:
parent
03e95c74a9
commit
7011ad8c8e
2 changed files with 65 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package examples;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
import util.Solutions;
|
||||
|
|
@ -32,7 +33,16 @@ public class CostMatrixExample {
|
|||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
/*
|
||||
* some preparation - create output folder
|
||||
*/
|
||||
File dir = new File("output");
|
||||
// if the directory does not exist, create it
|
||||
if (!dir.exists()){
|
||||
System.out.println("creating directory ./output");
|
||||
boolean result = dir.mkdir();
|
||||
if(result) System.out.println("./output created");
|
||||
}
|
||||
VehicleType type = VehicleTypeImpl.Builder.newInstance("type", 2).setCostPerDistance(1).setCostPerTime(2).build();
|
||||
Vehicle vehicle = VehicleImpl.Builder.newInstance("vehicle").setLocationId("0").setType(type).build();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue