1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

introduce Pickup and Delivery, and adjust tests

This commit is contained in:
oblonski 2013-08-25 18:49:29 +02:00
parent 462864d53e
commit 1f53c72620
8 changed files with 23 additions and 27 deletions

View file

@ -34,7 +34,7 @@ public class Service implements Job {
private String id;
private String locationId;
private String name = "service";
private String type = "service";
private Coordinate coord;
private double serviceTime;
private TimeWindow timeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE);
@ -46,8 +46,8 @@ public class Service implements Job {
this.demand = size;
}
public Builder setName(String name){
this.name = name;
protected Builder setType(String name){
this.type = name;
return this;
}
@ -76,7 +76,7 @@ public class Service implements Job {
if(coord == null) throw new IllegalStateException("either locationId or a coordinate must be given. But is not.");
locationId = coord.toString();
}
this.setType("service");
return new Service(this);
}
@ -87,7 +87,7 @@ public class Service implements Job {
private final String locationId;
private final String name;
private final String type;
private final Coordinate coord;
@ -104,7 +104,7 @@ public class Service implements Job {
serviceTime = builder.serviceTime;
timeWindow = builder.timeWindow;
demand = builder.demand;
name = builder.name;
type = builder.type;
}
@Override
@ -137,7 +137,7 @@ public class Service implements Job {
* @return the name
*/
public String getType() {
return name;
return type;
}
@Override