Skip to content

Commit

Permalink
Avoid ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
braktar committed Aug 16, 2016
1 parent ceb2a44 commit 4af8c7f
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BreakActivity extends AbstractActivity implements TourActivity.JobA
private double duration;

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down Expand Up @@ -98,7 +98,7 @@ protected BreakActivity(Break aBreak) {
protected BreakActivity(BreakActivity breakActivity) {
counter++;
this.aBreak = (Break) breakActivity.getJob();
this.setupTime = breakActivity.getSetupTime();
this.setupTime = breakActivity.getSetupArrival();
this.arrTime = breakActivity.getArrTime();
this.endTime = breakActivity.getEndTime();
this.location = breakActivity.getLocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public DeliverService(Delivery delivery) {

private DeliverService(DeliverService deliveryActivity) {
this.delivery = deliveryActivity.getJob();
this.setupTime = deliveryActivity.getSetupTime();
this.setupTime = deliveryActivity.getSetupArrival();
this.arrTime = deliveryActivity.getArrTime();
this.endTime = deliveryActivity.getEndTime();
capacity = deliveryActivity.getSize();
Expand Down Expand Up @@ -92,7 +92,7 @@ public double getOperationTime() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public DeliverShipment(Shipment shipment) {

private DeliverShipment(DeliverShipment deliveryShipmentActivity) {
this.shipment = (Shipment) deliveryShipmentActivity.getJob();
this.setupTime = deliveryShipmentActivity.getSetupTime();
this.setupTime = deliveryShipmentActivity.getSetupArrival();
this.arrTime = deliveryShipmentActivity.getArrTime();
this.endTime = deliveryShipmentActivity.getEndTime();
this.capacity = deliveryShipmentActivity.getSize();
Expand Down Expand Up @@ -102,7 +102,7 @@ public double getOperationTime() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public String getName() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public PickupService(Service service) {

private PickupService(PickupService pickupActivity) {
this.pickup = pickupActivity.getJob();
this.setupTime = pickupActivity.getSetupTime();
this.setupTime = pickupActivity.getSetupArrival();
this.arrTime = pickupActivity.getArrTime();
this.depTime = pickupActivity.getEndTime();
setIndex(pickupActivity.getIndex());
Expand Down Expand Up @@ -92,7 +92,7 @@ public double getOperationTime() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public PickupShipment(Shipment shipment) {

private PickupShipment(PickupShipment pickupShipmentActivity) {
this.shipment = (Shipment) pickupShipmentActivity.getJob();
this.setupTime = pickupShipmentActivity.getSetupTime();
this.setupTime = pickupShipmentActivity.getSetupArrival();
this.arrTime = pickupShipmentActivity.getArrTime();
this.endTime = pickupShipmentActivity.getEndTime();
setIndex(pickupShipmentActivity.getIndex());
Expand Down Expand Up @@ -98,7 +98,7 @@ public double getOperationTime() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ServiceActivity extends AbstractActivity implements TourActivity.Jo
private double theoreticalLatest;

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down Expand Up @@ -89,7 +89,7 @@ protected ServiceActivity(Service service) {

protected ServiceActivity(ServiceActivity serviceActivity) {
this.service = serviceActivity.getJob();
this.setupTime = serviceActivity.getSetupTime();
this.setupTime = serviceActivity.getSetupArrival();
this.arrTime = serviceActivity.getArrTime();
this.endTime = serviceActivity.getEndTime();
setIndex(serviceActivity.getIndex());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public String getName() {
}

@Override
public double getSetupTime() {
public double getSetupArrival() {
return setupTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ public interface JobActivity extends TourActivity {
*/
public abstract double getOperationTime();

public abstract double getSetupTime();


/**
* Returns the setup arrival time of this activity.
*
* @return setup arrival time
*/
public abstract double getSetupArrival();

/**
* Returns the arrival-time of this activity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ private void readInitialRoutes(XMLConfiguration xmlConfig) {
for (HierarchicalConfiguration actConfig : actConfigs) {
String type = actConfig.getString("[@type]");
if (type == null) throw new IllegalArgumentException("act[@type] is missing.");
double setTime = 0.;
double arrTime = 0.;
double endTime = 0.;
String setTimeS = actConfig.getString("setTime");
if (setTimeS != null) setTime = Double.parseDouble(setTimeS);
String arrTimeS = actConfig.getString("arrTime");
if (arrTimeS != null) arrTime = Double.parseDouble(arrTimeS);
String endTimeS = actConfig.getString("endTime");
Expand Down Expand Up @@ -277,8 +280,11 @@ private void readSolutions(XMLConfiguration vrpProblem) {
for (HierarchicalConfiguration actConfig : actConfigs) {
String type = actConfig.getString("[@type]");
if (type == null) throw new IllegalArgumentException("act[@type] is missing.");
double setTime = 0.;
double arrTime = 0.;
double endTime = 0.;
String setTimeS = actConfig.getString("setTime");
if (setTimeS != null) setTime = Double.parseDouble(setTimeS);
String arrTimeS = actConfig.getString("arrTime");
if (arrTimeS != null) arrTime = Double.parseDouble(arrTimeS);
String endTimeS = actConfig.getString("endTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +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 + ").setTime", act.getSetupArrival());
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
6 changes: 3 additions & 3 deletions jsprit-io/src/main/resources/vrp_xml_schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +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="setTime" 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 @@ -367,7 +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="setTime" 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 @@ -376,7 +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="setTime" 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 4af8c7f

Please sign in to comment.