mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
added non-negative restriction
This commit is contained in:
parent
bcfe9a401d
commit
21e4bb09f5
6 changed files with 15 additions and 3 deletions
|
|
@ -160,8 +160,10 @@ public class Service implements Job {
|
|||
* @param dimensionIndex
|
||||
* @param dimensionValue
|
||||
* @return the builder
|
||||
* @throws IllegalArgumentException if dimensionValue < 0
|
||||
*/
|
||||
public Builder addCapacityDimension(int dimensionIndex, int dimensionValue){
|
||||
if(dimensionValue<0) throw new IllegalArgumentException("capacity value cannot be negative");
|
||||
capacityBuilder.addDimension(dimensionIndex, dimensionValue);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,9 +212,11 @@ public class Shipment implements Job{
|
|||
*
|
||||
* @param dimIndex
|
||||
* @param dimVal
|
||||
* @return
|
||||
* @return builder
|
||||
* @throws IllegalArgumentException if dimVal < 0
|
||||
*/
|
||||
public Builder addCapacityDimension(int dimIndex, int dimVal) {
|
||||
if(dimVal<0) throw new IllegalArgumentException("capacity value cannot be negative");
|
||||
capacityBuilder.addDimension(dimIndex, dimVal);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
* @param dimIndex
|
||||
* @param dimVal
|
||||
* @return the builder
|
||||
* @throws IllegalArgumentException if dimVal < 0
|
||||
*/
|
||||
public Builder addCapacityDimension(int dimIndex, int dimVal) {
|
||||
if(dimVal<0) throw new IllegalArgumentException("capacity value cannot be negative");
|
||||
capacityBuilder.addDimension(dimIndex,dimVal);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue