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

add helper methods - related to #380

This commit is contained in:
oblonski 2017-10-23 22:16:10 +02:00 committed by Michal Maciejewski
parent 0dfffdd9dd
commit 6166c0ea10
2 changed files with 15 additions and 1 deletions

View file

@ -232,7 +232,7 @@ public class Service extends AbstractJob {
public Builder<T> addAllSizeDimensions(Capacity size){ public Builder<T> addAllSizeDimensions(Capacity size){
for(int i=0;i<size.getNuOfDimensions();i++){ for(int i=0;i<size.getNuOfDimensions();i++){
capacityBuilder.addDimension(i,size.get(i)); addSizeDimension(i, size.get(i));
} }
return this; return this;
} }

View file

@ -235,6 +235,13 @@ public class Shipment extends AbstractJob {
return this; return this;
} }
public Builder addAllSizeDimensions(Capacity size) {
for (int i = 0; i < size.getNuOfDimensions(); i++) {
addSizeDimension(i, size.get(i));
}
return this;
}
/** /**
* Builds the shipment. * Builds the shipment.
@ -257,6 +264,13 @@ public class Shipment extends AbstractJob {
return this; return this;
} }
public Builder addAllRequiredSkills(Skills skills) {
for (String s : skills.values()) {
addRequiredSkill(s);
}
return this;
}
public Builder setName(String name) { public Builder setName(String name) {
this.name = name; this.name = name;
return this; return this;