mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
service and wait are optionnal
This commit is contained in:
parent
bc7fa35461
commit
eef7b73b30
1 changed files with 9 additions and 4 deletions
|
|
@ -583,14 +583,19 @@ public class VrpXMLReader {
|
|||
Double fix = typeConfig.getDouble("costs.fixed");
|
||||
Double timeC = typeConfig.getDouble("costs.time");
|
||||
Double distC = typeConfig.getDouble("costs.distance");
|
||||
Double serviceC = typeConfig.getDouble("costs.service");
|
||||
Double waitC = typeConfig.getDouble("costs.wait");
|
||||
if(typeConfig.containsKey("costs.service")){
|
||||
Double serviceC = typeConfig.getDouble("costs.service");
|
||||
if (serviceC != null) typeBuilder.setCostPerServiceTime(serviceC);
|
||||
}
|
||||
|
||||
if(typeConfig.containsKey("costs.wait")){
|
||||
Double waitC = typeConfig.getDouble("costs.wait");
|
||||
if (waitC != null) typeBuilder.setCostPerWaitingTime(waitC);
|
||||
}
|
||||
|
||||
if (fix != null) typeBuilder.setFixedCost(fix);
|
||||
if (timeC != null) typeBuilder.setCostPerTransportTime(timeC);
|
||||
if (distC != null) typeBuilder.setCostPerDistance(distC);
|
||||
if (serviceC != null) typeBuilder.setCostPerServiceTime(serviceC);
|
||||
if (waitC != null) typeBuilder.setCostPerWaitingTime(waitC);
|
||||
VehicleType type = typeBuilder.build();
|
||||
String id = type.getTypeId();
|
||||
types.put(id, type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue