Skip to content

Commit

Permalink
SetupTime XML
Browse files Browse the repository at this point in the history
  • Loading branch information
braktar committed Oct 11, 2016
1 parent 1f660ee commit a358743
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ private void readVehiclesAndTheirTypes(XMLConfiguration vrpProblem) {
if (waitC != null) typeBuilder.setCostPerWaitingTime(waitC);
}

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);
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 @@ -348,6 +348,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 @@ -356,6 +357,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 @@ -364,6 +366,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 a358743

Please sign in to comment.