Skip to content

Commit

Permalink
SetupTime XML
Browse files Browse the repository at this point in the history
  • Loading branch information
braktar committed Aug 16, 2016
1 parent 34c7a57 commit ceb2a44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,16 @@ private void readVehiclesAndTheirTypes(XMLConfiguration vrpProblem) {
Double waitC = typeConfig.getDouble("costs.wait");
if (waitC != null) typeBuilder.setCostPerWaitingTime(waitC);
}
Double setupC = typeConfig.getDouble("costs.setup");


if(typeConfig.containsKey("costs.setup")){
Double setupC = typeConfig.getDouble("costs.setup");
if (setupC != null) typeBuilder.setCostPerSetupTime(setupC);
}

if (fix != null) typeBuilder.setFixedCost(fix);
if (timeC != null) typeBuilder.setCostPerTransportTime(timeC);
if (distC != null) typeBuilder.setCostPerDistance(distC);
if (setupC != null) typeBuilder.setCostPerSetupTime(setupC);
VehicleType type = typeBuilder.build();
String id = type.getTypeId();
types.put(id, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ private void writeSolutions(XMLConf xmlConfig) {
throw new IllegalStateException("cannot write solution correctly since job-type is not know. make sure you use either service or shipment, or another writer");
}
}
xmlConfig.setProperty(solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").setupTime", act.getSetupTime());
xmlConfig.setProperty(solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").arrTime", act.getArrTime());
xmlConfig.setProperty(solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").endTime", act.getEndTime());
actCounter++;
Expand Down
3 changes: 3 additions & 0 deletions jsprit-io/src/main/resources/vrp_xml_schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
<xs:group name="serviceActGroup">
<xs:sequence>
<xs:element name="serviceId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="setupTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="arrTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="endTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
Expand All @@ -366,6 +367,7 @@
<xs:group name="shipmentActGroup">
<xs:sequence>
<xs:element name="shipmentId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="setupTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="arrTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="endTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
Expand All @@ -374,6 +376,7 @@
<xs:group name="breakActGroup">
<xs:sequence>
<xs:element name="breakId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="setupTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="arrTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="endTime" type="xs:double" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
Expand Down

0 comments on commit ceb2a44

Please sign in to comment.