Class VehicleTypeImpl.Builder
java.lang.Object
com.graphhopper.jsprit.core.problem.vehicle.VehicleTypeImpl.Builder
- Enclosing class:
VehicleTypeImpl
Builder that builds the vehicle-type.
- Author:
- schroeder
-
Method Summary
Modifier and TypeMethodDescriptionaddCapacityDimension(int dimIndex, int dimVal) Adds a capacity dimension.build()Builds the vehicle-type.static VehicleTypeImpl.BuildernewInstance(String id) setCapacityDimensions(Capacity capacity) Sets capacity dimensions.setCostPerDistance(double perDistance) Sets the cost per distance unit, for instance € per meter.setCostPerServiceTime(double perServiceTime) setCostPerTime(double perTime) Deprecated.use .setCostPerTransportTime(..) insteadsetCostPerTransportTime(double perTime) Sets cost per time unit, for instance € per second.setCostPerWaitingTime(double perWaitingTime) Sets cost per waiting time unit, for instance € per second.setFixedCost(double fixedCost) Sets the fixed costs of the vehicle-type.setMaxVelocity(double inMeterPerSeconds) Sets the maximum velocity this vehicle-type can go [in meter per seconds].setProfile(String profile) setUserData(Object userData) Sets user specific domain data associated with the object.
-
Method Details
-
newInstance
-
setUserData
Sets user specific domain data associated with the object.The user data is a black box for the framework, it only stores it, but never interacts with it in any way.
- Parameters:
userData- any object holding the domain specific user data associated with the object.- Returns:
- builder
-
setMaxVelocity
Sets the maximum velocity this vehicle-type can go [in meter per seconds].- Parameters:
inMeterPerSeconds- in m/s- Returns:
- this builder
- Throws:
IllegalArgumentException- if velocity is smaller than zero
-
setFixedCost
Sets the fixed costs of the vehicle-type.by default it is 0.
- Parameters:
fixedCost- fixed cost of vehicle type- Returns:
- this builder
- Throws:
IllegalArgumentException- if fixedCost is smaller than zero
-
setCostPerDistance
Sets the cost per distance unit, for instance € per meter.by default it is 1.0
- Parameters:
perDistance- cost per distance- Returns:
- this builder
- Throws:
IllegalArgumentException- if perDistance is smaller than zero
-
setCostPerTime
Deprecated.use .setCostPerTransportTime(..) insteadSets cost per time unit, for instance € per second.by default it is 0.0
- Parameters:
perTime- cost per time- Returns:
- this builder
- Throws:
IllegalArgumentException- if costPerTime is smaller than zero
-
setCostPerTransportTime
Sets cost per time unit, for instance € per second.by default it is 0.0
- Parameters:
perTime- cost per time- Returns:
- this builder
- Throws:
IllegalArgumentException- if costPerTime is smaller than zero
-
setCostPerWaitingTime
Sets cost per waiting time unit, for instance € per second.by default it is 0.0
- Parameters:
perWaitingTime- cost per waiting time- Returns:
- this builder
- Throws:
IllegalArgumentException- if costPerTime is smaller than zero
-
setCostPerServiceTime
-
build
Builds the vehicle-type.- Returns:
- VehicleTypeImpl
-
addCapacityDimension
Adds a capacity dimension.- Parameters:
dimIndex- dimension indexdimVal- dimension value- Returns:
- the builder
- Throws:
IllegalArgumentException- if dimVal invalid input: '<' 0IllegalArgumentException- if capacity dimension is already set
-
setCapacityDimensions
Sets capacity dimensions.Note if you use this you cannot use
addCapacityDimension(int dimIndex, int dimVal)anymore. Thus either build your dimensions withaddCapacityDimension(int dimIndex, int dimVal)or set the already built dimensions with this method.- Parameters:
capacity- capacity of vehicle type- Returns:
- this builder
- Throws:
IllegalArgumentException- if capacityDimension has already been added
-
setProfile
-