From 701b615f6e995ec5d5331b81d8ff893dad4a508a Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Fri, 20 Dec 2024 12:54:55 +0100 Subject: [PATCH] reorder variables --- .../freight/carriers/CarrierService.java | 12 +++++++----- .../freight/carriers/CarrierShipment.java | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java index 94cd241d2b1..3b66fbfb657 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java @@ -35,11 +35,11 @@ public static Builder newInstance(Id id, Id locationLinkId } private final Id id; - private final Id locationLinkId; + private int demand = 0; - private double serviceTime = 0.0; + private final Id locationLinkId; private TimeWindow timeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE); - private int demand = 0; + private double serviceTime = 0.0; private Builder(Id id, Id locationLinkId) { super(); @@ -86,10 +86,12 @@ public Builder setCapacityDemand(int value) { private final Id id; + private final int demand; + private final Id locationId; - private final double serviceDuration; private final TimeWindow timeWindow; - private final int demand; + private final double serviceDuration; + private final Attributes attributes = new AttributesImpl(); private CarrierService(Builder builder){ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java index 3cb62a59182..22d11824e3f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java @@ -49,7 +49,6 @@ public static class Builder { * @deprecated Please use Builder newInstance(Id id, Id from, Id to, int size) instead. *

* Returns a new shipment builder. - * *

The builder is init with the shipment's origin (from), destination (to) and with the shipment's size. * The default-value for serviceTime is 0.0. The default-value for a timeWindow is [start=0.0, end=Double.maxValue()]. * @@ -65,7 +64,6 @@ public static Builder newInstance(Id from, Id to, int size){ /** * Returns a new shipment builder. - * *

The builder is init with the shipment's origin (from), destination (to) and with the shipment's size. * The default-value for serviceTime is 0.0. The default-value for a timeWindow is [start=0.0, end=Double.maxValue()]. * @@ -80,12 +78,14 @@ public static Builder newInstance(Id id, Id from, Id id; - final Id from; - final Id to; final int size; + + final Id from; TimeWindow pickTW = TimeWindow.newInstance(0.0, Integer.MAX_VALUE); - TimeWindow delTW = TimeWindow.newInstance(0.0, Integer.MAX_VALUE); double pickServiceTime = 0.0; + + final Id to; + TimeWindow delTW = TimeWindow.newInstance(0.0, Integer.MAX_VALUE); double delServiceTime = 0.0; /** @@ -133,13 +133,16 @@ public CarrierShipment build(){ } private final Id id; - private final Id from; - private final Id to; private final int demand; + + private final Id from; private final TimeWindow pickupTimeWindow; - private final TimeWindow deliveryTimeWindow; private double pickupServiceTime; + + private final Id to; + private final TimeWindow deliveryTimeWindow; private double deliveryServiceTime; + private final Attributes attributes = new AttributesImpl();