File tree 12 files changed +32
-19
lines changed
jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity
java/com/graphhopper/jsprit/io/problem
12 files changed +32
-19
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public class BreakActivity extends AbstractActivity implements TourActivity.JobA
38
38
private double duration ;
39
39
40
40
@ Override
41
- public double getSetupTime () {
41
+ public double getSetupArrival () {
42
42
return setupTime ;
43
43
}
44
44
@@ -98,7 +98,7 @@ protected BreakActivity(Break aBreak) {
98
98
protected BreakActivity (BreakActivity breakActivity ) {
99
99
counter ++;
100
100
this .aBreak = (Break ) breakActivity .getJob ();
101
- this .setupTime = breakActivity .getSetupTime ();
101
+ this .setupTime = breakActivity .getSetupArrival ();
102
102
this .arrTime = breakActivity .getArrTime ();
103
103
this .endTime = breakActivity .getEndTime ();
104
104
this .location = breakActivity .getLocation ();
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public DeliverService(Delivery delivery) {
46
46
47
47
private DeliverService (DeliverService deliveryActivity ) {
48
48
this .delivery = deliveryActivity .getJob ();
49
- this .setupTime = deliveryActivity .getSetupTime ();
49
+ this .setupTime = deliveryActivity .getSetupArrival ();
50
50
this .arrTime = deliveryActivity .getArrTime ();
51
51
this .endTime = deliveryActivity .getEndTime ();
52
52
capacity = deliveryActivity .getSize ();
@@ -92,7 +92,7 @@ public double getOperationTime() {
92
92
}
93
93
94
94
@ Override
95
- public double getSetupTime () {
95
+ public double getSetupArrival () {
96
96
return setupTime ;
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public DeliverShipment(Shipment shipment) {
47
47
48
48
private DeliverShipment (DeliverShipment deliveryShipmentActivity ) {
49
49
this .shipment = (Shipment ) deliveryShipmentActivity .getJob ();
50
- this .setupTime = deliveryShipmentActivity .getSetupTime ();
50
+ this .setupTime = deliveryShipmentActivity .getSetupArrival ();
51
51
this .arrTime = deliveryShipmentActivity .getArrTime ();
52
52
this .endTime = deliveryShipmentActivity .getEndTime ();
53
53
this .capacity = deliveryShipmentActivity .getSize ();
@@ -102,7 +102,7 @@ public double getOperationTime() {
102
102
}
103
103
104
104
@ Override
105
- public double getSetupTime () {
105
+ public double getSetupArrival () {
106
106
return setupTime ;
107
107
}
108
108
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ public String getName() {
126
126
}
127
127
128
128
@ Override
129
- public double getSetupTime () {
129
+ public double getSetupArrival () {
130
130
return setupTime ;
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public PickupService(Service service) {
48
48
49
49
private PickupService (PickupService pickupActivity ) {
50
50
this .pickup = pickupActivity .getJob ();
51
- this .setupTime = pickupActivity .getSetupTime ();
51
+ this .setupTime = pickupActivity .getSetupArrival ();
52
52
this .arrTime = pickupActivity .getArrTime ();
53
53
this .depTime = pickupActivity .getEndTime ();
54
54
setIndex (pickupActivity .getIndex ());
@@ -92,7 +92,7 @@ public double getOperationTime() {
92
92
}
93
93
94
94
@ Override
95
- public double getSetupTime () {
95
+ public double getSetupArrival () {
96
96
return setupTime ;
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public PickupShipment(Shipment shipment) {
44
44
45
45
private PickupShipment (PickupShipment pickupShipmentActivity ) {
46
46
this .shipment = (Shipment ) pickupShipmentActivity .getJob ();
47
- this .setupTime = pickupShipmentActivity .getSetupTime ();
47
+ this .setupTime = pickupShipmentActivity .getSetupArrival ();
48
48
this .arrTime = pickupShipmentActivity .getArrTime ();
49
49
this .endTime = pickupShipmentActivity .getEndTime ();
50
50
setIndex (pickupShipmentActivity .getIndex ());
@@ -98,7 +98,7 @@ public double getOperationTime() {
98
98
}
99
99
100
100
@ Override
101
- public double getSetupTime () {
101
+ public double getSetupArrival () {
102
102
return setupTime ;
103
103
}
104
104
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public class ServiceActivity extends AbstractActivity implements TourActivity.Jo
35
35
private double theoreticalLatest ;
36
36
37
37
@ Override
38
- public double getSetupTime () {
38
+ public double getSetupArrival () {
39
39
return setupTime ;
40
40
}
41
41
@@ -89,7 +89,7 @@ protected ServiceActivity(Service service) {
89
89
90
90
protected ServiceActivity (ServiceActivity serviceActivity ) {
91
91
this .service = serviceActivity .getJob ();
92
- this .setupTime = serviceActivity .getSetupTime ();
92
+ this .setupTime = serviceActivity .getSetupArrival ();
93
93
this .arrTime = serviceActivity .getArrTime ();
94
94
this .endTime = serviceActivity .getEndTime ();
95
95
setIndex (serviceActivity .getIndex ());
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ public String getName() {
122
122
}
123
123
124
124
@ Override
125
- public double getSetupTime () {
125
+ public double getSetupArrival () {
126
126
return setupTime ;
127
127
}
128
128
Original file line number Diff line number Diff line change @@ -93,7 +93,14 @@ public interface JobActivity extends TourActivity {
93
93
*/
94
94
public abstract double getOperationTime ();
95
95
96
- public abstract double getSetupTime ();
96
+
97
+
98
+ /**
99
+ * Returns the setup arrival time of this activity.
100
+ *
101
+ * @return setup arrival time
102
+ */
103
+ public abstract double getSetupArrival ();
97
104
98
105
/**
99
106
* Returns the arrival-time of this activity.
Original file line number Diff line number Diff line change @@ -206,8 +206,11 @@ private void readInitialRoutes(XMLConfiguration xmlConfig) {
206
206
for (HierarchicalConfiguration actConfig : actConfigs ) {
207
207
String type = actConfig .getString ("[@type]" );
208
208
if (type == null ) throw new IllegalArgumentException ("act[@type] is missing." );
209
+ double setTime = 0. ;
209
210
double arrTime = 0. ;
210
211
double endTime = 0. ;
212
+ String setTimeS = actConfig .getString ("setTime" );
213
+ if (setTimeS != null ) setTime = Double .parseDouble (setTimeS );
211
214
String arrTimeS = actConfig .getString ("arrTime" );
212
215
if (arrTimeS != null ) arrTime = Double .parseDouble (arrTimeS );
213
216
String endTimeS = actConfig .getString ("endTime" );
@@ -277,8 +280,11 @@ private void readSolutions(XMLConfiguration vrpProblem) {
277
280
for (HierarchicalConfiguration actConfig : actConfigs ) {
278
281
String type = actConfig .getString ("[@type]" );
279
282
if (type == null ) throw new IllegalArgumentException ("act[@type] is missing." );
283
+ double setTime = 0. ;
280
284
double arrTime = 0. ;
281
285
double endTime = 0. ;
286
+ String setTimeS = actConfig .getString ("setTime" );
287
+ if (setTimeS != null ) setTime = Double .parseDouble (setTimeS );
282
288
String arrTimeS = actConfig .getString ("arrTime" );
283
289
if (arrTimeS != null ) arrTime = Double .parseDouble (arrTimeS );
284
290
String endTimeS = actConfig .getString ("endTime" );
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ private void writeSolutions(XMLConf xmlConfig) {
213
213
throw new IllegalStateException ("cannot write solution correctly since job-type is not know. make sure you use either service or shipment, or another writer" );
214
214
}
215
215
}
216
- xmlConfig .setProperty (solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").setupTime " , act .getSetupTime ());
216
+ xmlConfig .setProperty (solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").setTime " , act .getSetupArrival ());
217
217
xmlConfig .setProperty (solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").arrTime" , act .getArrTime ());
218
218
xmlConfig .setProperty (solutionPath + "(" + counter + ").routes.route(" + routeCounter + ").act(" + actCounter + ").endTime" , act .getEndTime ());
219
219
actCounter ++;
Original file line number Diff line number Diff line change 348
348
<xs : group name =" serviceActGroup" >
349
349
<xs : sequence >
350
350
<xs : element name =" serviceId" type =" xs:string" minOccurs =" 1" maxOccurs =" 1" />
351
- <xs : element name =" setupTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
351
+ <xs : element name =" setTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
352
352
<xs : element name =" arrTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
353
353
<xs : element name =" endTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
354
354
</xs : sequence >
357
357
<xs : group name =" shipmentActGroup" >
358
358
<xs : sequence >
359
359
<xs : element name =" shipmentId" type =" xs:string" minOccurs =" 1" maxOccurs =" 1" />
360
- <xs : element name =" setupTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
360
+ <xs : element name =" setTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
361
361
<xs : element name =" arrTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
362
362
<xs : element name =" endTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
363
363
</xs : sequence >
366
366
<xs : group name =" breakActGroup" >
367
367
<xs : sequence >
368
368
<xs : element name =" breakId" type =" xs:string" minOccurs =" 1" maxOccurs =" 1" />
369
- <xs : element name =" setupTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
369
+ <xs : element name =" setTime " type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
370
370
<xs : element name =" arrTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
371
371
<xs : element name =" endTime" type =" xs:double" minOccurs =" 0" maxOccurs =" 1" />
372
372
</xs : sequence >
You can’t perform that action at this time.
0 commit comments