mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
intro pickup and delivery
This commit is contained in:
parent
357f7d82b3
commit
89ba3ac2af
3 changed files with 57 additions and 4 deletions
|
|
@ -2,11 +2,32 @@ package basics;
|
|||
|
||||
public class Pickup extends Service {
|
||||
|
||||
|
||||
public static class Builder extends Service.Builder {
|
||||
|
||||
public static Builder newInstance(String id, int size){
|
||||
return new Builder(id,size);
|
||||
}
|
||||
|
||||
Builder(String id, int size) {
|
||||
super(id, size);
|
||||
}
|
||||
|
||||
public Pickup build(){
|
||||
return new Pickup(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Pickup(Builder builder) {
|
||||
super(builder);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Pickup.Builder pickupBuilder = Pickup.Builder.newInstance("myPick", 10);
|
||||
Pickup pickup = (Pickup) pickupBuilder.setLocationId("foo").build();
|
||||
|
||||
System.out.println("loc="+pickup.getLocationId());
|
||||
System.out.println("capDemand="+pickup.getCapacityDemand());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue