diff --git a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Service.java b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Service.java index 09167dc6..af4e6b85 100644 --- a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Service.java +++ b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Service.java @@ -72,8 +72,6 @@ public class Service extends AbstractJob { protected double serviceTime; - protected TimeWindow timeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE); - protected Capacity.Builder capacityBuilder = Capacity.Builder.newInstance(); protected Capacity capacity; @@ -98,7 +96,7 @@ public class Service extends AbstractJob { Builder(String id){ this.id = id; timeWindows = new TimeWindowsImpl(); - timeWindows.add(timeWindow); + timeWindows.add(TimeWindow.newInstance(0.0, Double.MAX_VALUE)); } /** @@ -176,7 +174,6 @@ public class Service extends AbstractJob { public Builder setTimeWindow(TimeWindow tw){ if(tw == null) throw new IllegalArgumentException("time-window arg must not be null"); - this.timeWindow = tw; this.timeWindows = new TimeWindowsImpl(); timeWindows.add(tw); return this; diff --git a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Shipment.java b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Shipment.java index 91a8b628..a3eeaaf6 100644 --- a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Shipment.java +++ b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/job/Shipment.java @@ -61,10 +61,6 @@ public class Shipment extends AbstractJob { private double deliveryServiceTime = 0.0; - private TimeWindow deliveryTimeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE); - - private TimeWindow pickupTimeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE); - private Capacity.Builder capacityBuilder = Capacity.Builder.newInstance(); private Capacity capacity; @@ -107,9 +103,9 @@ public class Shipment extends AbstractJob { if (id == null) throw new IllegalArgumentException("id must not be null"); this.id = id; pickupTimeWindows = new TimeWindowsImpl(); - pickupTimeWindows.add(pickupTimeWindow); + pickupTimeWindows.add(TimeWindow.newInstance(0.0, Double.MAX_VALUE)); deliveryTimeWindows = new TimeWindowsImpl(); - deliveryTimeWindows.add(deliveryTimeWindow); + deliveryTimeWindows.add(TimeWindow.newInstance(0.0, Double.MAX_VALUE)); } /** @@ -169,7 +165,6 @@ public class Shipment extends AbstractJob { */ public Builder setPickupTimeWindow(TimeWindow timeWindow) { if (timeWindow == null) throw new IllegalArgumentException("delivery time-window must not be null"); - this.pickupTimeWindow = timeWindow; this.pickupTimeWindows = new TimeWindowsImpl(); this.pickupTimeWindows.add(timeWindow); return this; @@ -215,7 +210,6 @@ public class Shipment extends AbstractJob { */ public Builder setDeliveryTimeWindow(TimeWindow timeWindow) { if (timeWindow == null) throw new IllegalArgumentException("delivery time-window must not be null"); - this.deliveryTimeWindow = timeWindow; this.deliveryTimeWindows = new TimeWindowsImpl(); this.deliveryTimeWindows.add(timeWindow); return this;