Skip to content

Commit

Permalink
remove field name from CarrierService, incl. Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Dec 20, 2024
1 parent 9e964e0 commit 91a19fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public static Builder newInstance(Id<CarrierService> id, Id<Link> locationLinkId

private final Id<CarrierService> id;
private final Id<Link> locationLinkId;
private String name = "service";

private double serviceTime = 0.0;
private TimeWindow timeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE);
Expand All @@ -48,10 +47,6 @@ private Builder(Id<CarrierService> id, Id<Link> locationLinkId) {
this.locationLinkId = locationLinkId;
}

public Builder setName(String name){
this.name = name;
return this;
}

/**
* By default, it is [0.0,Integer.MaxValue].
Expand Down Expand Up @@ -92,7 +87,6 @@ public Builder setCapacityDemand(int value) {

private final Id<CarrierService> id;
private final Id<Link> locationId;
private final String name;
private final double serviceDuration;
private final TimeWindow timeWindow;
private final int demand;
Expand All @@ -104,7 +98,6 @@ private CarrierService(Builder builder){
serviceDuration = builder.serviceTime;
timeWindow = builder.timeWindow;
demand = builder.demand;
name = builder.name;
}

@Override
Expand Down Expand Up @@ -148,12 +141,6 @@ public Attributes getAttributes() {
return attributes;
}

/**
* @return the name
*/
public String getType() {
return name;
}

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public CarrierService getService(){

@Override
public String getActivityType() {
return service.getType();
return CarrierConstants.SERVICE;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void testAddAndGetServiceToCarrier() {
Carrier carrier = new CarrierImpl(Id.create("carrier", Carrier.class));
Id<CarrierService> serviceId = Id.create("testVehicle", CarrierService.class);
CarrierService service1 = CarrierService.Builder.newInstance(serviceId,Id.createLinkId("link0") )
.setName("service1").setCapacityDemand(15).setServiceDuration(30).build();
.setCapacityDemand(15).setServiceDuration(30).build();

//add Service
CarriersUtils.addService(carrier, service1);
Expand Down

0 comments on commit 91a19fb

Please sign in to comment.