Skip to content

Commit

Permalink
comments and javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Dec 20, 2024
1 parent 10071db commit cbe5a12
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public static class Builder {
private final Id<CarrierService> id;
private int demand = 0;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> serviceLinkId;
private TimeWindow serviceStartsTimeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE);
private double serviceDuration = 0.0;
Expand All @@ -59,7 +62,7 @@ public CarrierService build(){
* Note that the time-window restricts the start-time of the service (i.e. serviceActivity). If one works with hard time-windows (which means that
* time-windows must be met) than the service is allowed to start between startTimeWindow.getStart() and startTimeWindow.getEnd().
*
* @param startTimeWindow time-window for the beginning of the service acti
* @param startTimeWindow time-window for the beginning of the service activity
* @return the builder
*/
public Builder setServiceStartTimeWindow(TimeWindow startTimeWindow){
Expand All @@ -79,9 +82,15 @@ public Builder setServiceDuration(double serviceDuration){
return this;
}




/**
* Sets the demand (size; capacity needed) of the service.
* When not set, it is by default 0.
* <p>
* IMO we can put this into the Builder directly instead of a separate method? kturner dec'24
*
* @param value the demand (size; capacity needed) of the service
* @return the builder
*/
public Builder setCapacityDemand(int value) {
this.demand = value;
return this;
Expand All @@ -93,6 +102,9 @@ public Builder setCapacityDemand(int value) {
private final Id<CarrierService> id;
private final int demand;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> serviceLinkId;
private final TimeWindow serviceStartsTimeWindow;
private final double serviceDuration;
Expand Down Expand Up @@ -127,7 +139,7 @@ public TimeWindow getServiceStartTimeWindow(){
/**
* @deprecated please inline and use {@link #getDemand()} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public int getCapacityDemand() {
return getDemand();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ public static class Builder {
private final Id<CarrierShipment> id;
private final int demand;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> pickupLinkId;
private TimeWindow pickupStartsTimeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE);
private double pickupDuration = 0.0;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> deliveryLinkId;
private TimeWindow deliveryStartsTimeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE);
private double deliveryDuration = 0.0;
Expand Down Expand Up @@ -174,46 +180,49 @@ public CarrierShipment build(){
/**
* @deprecated please inline and use {@link #setPickupStartsTimeWindow(TimeWindow)} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public Builder setPickupTimeWindow(TimeWindow pickupTW){
return setPickupStartsTimeWindow(pickupTW);
}

/**
* @deprecated please inline and use {@link #setPickupDuration(double)} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public Builder setPickupServiceTime(double pickupServiceTime){
return setPickupDuration(pickupServiceTime);
}

/**
* @deprecated please inline and use {@link #setDeliveryStartsTimeWindow(TimeWindow)} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public Builder setDeliveryTimeWindow(TimeWindow deliveryTW){
return setDeliveryStartsTimeWindow(deliveryTW);
}

/**
* @deprecated please inline and use {@link #setDeliveryDuration(double)} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public Builder setDeliveryServiceTime(double deliveryServiceTime){
return setDeliveryDuration(deliveryServiceTime);
}



}

private final Id<CarrierShipment> id;
private final int demand;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> pickupLinkId;
private final TimeWindow pickupStartsTimeWindow;
private double pickupDuration;

//IMO we could build a general class (CarrierActivity ???), containing the location, StartTimeWindow and Duration.
//This could be used for both, CarrierService and CarrierShipment (Pickup and Delivery).
//kturner dec'24
private final Id<Link> deliveryLinkId;
private final TimeWindow deliveryStartsTimeWindow;
private double deliveryDuration;
Expand Down Expand Up @@ -264,7 +273,7 @@ public Id<Link> getTo() {
/**
* @deprecated please inline and use {@link #getDemand()} instead
*/
@Deprecated(since = "dez 2024")
@Deprecated(since = "dec'24")
public int getSize() {
return getDemand();
}
Expand Down

0 comments on commit cbe5a12

Please sign in to comment.