Interface IBasicResource
- All Superinterfaces:
Comparable<IBasicResource>,IOptimizationElement,Serializable
- All Known Subinterfaces:
IResource
- All Known Implementing Classes:
AbstractBasicCapacityResource,CapacityResource
IResource like average speed, setting an
alternate destination, setting acceptable overtime etc.- Since:
- 03/09/2019
- Version:
- 23/09/2019
- Author:
- DNA
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.dna.jopt.member.unit.IOptimizationElement
IOptimizationElement.OptimizationElementFlavour -
Method Summary
Modifier and TypeMethodDescriptionvoidaddQualification(IQualification qualification) Puts the input in theHashMapAbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.doubleGets the acceptable overdistance meter.doubleGets the acceptable overtime in seconds.javax.measure.Quantity<javax.measure.quantity.Speed>Gets the average speed aIResourceis traveling with.doubleGets the avg speedAbstractBasicCapacityResource.avgSpeedof which the default value is 22.0 m/s.intDeprecated.doubleGets thelatitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working.doubleGets thelongitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working.com.dna.jopt.config.types.PositiondoubleGets theAbstractBasicCapacityResource.fixCost, the default value is 0.0.doubleGets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometerin [km] that a route can take per day.doubleGets the doubleAbstractBasicCapacityResource.maxGlobalHours, the maximum hours a route [h] can take per day.javax.measure.Quantity<javax.measure.quantity.Length>Gets the maximum time aIResourceis allowed to be on aILogicEntityRoutewithout throwing aViolation.doubleGetsAbstractBasicCapacityResource.perHourCost, the default value is 1.0.doubledoubleGetsAbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.Map<Class<? extends IQualification>,IQualification> GetsAbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.doubleDeprecated.Gets theAbstractBasicCapacityResource.skillEfficiencyFactor, of which the default value is 1.0.doubleGets the strict overdistance limit meter.doubleGets the strict overtime limit seconds.booleanGets theAbstractBasicCapacityResource.hasAlternateDestination.booleanChecksAbstractBasicCapacityResource.emptyAtEndOfRoute.voidResets theAbstractBasicCapacityResource.acceptableOvertimeSecondsto the default value of-1.0.voidsetAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) voidsetAcceptableOvertime(Duration acceptableOvertime) Sets theacceptable overtime.voidsetAcceptableOvertimeSeconds(double seconds) Deprecated.please usesetAcceptableOvertime(Duration)insteadvoidsetAlternateDestination(boolean hasAlternateDestination) Sets theAbstractBasicCapacityResource.hasAlternateDestination.voidsetAvgSpeed(double avgSpeed) Sets the avg speedAbstractBasicCapacityResource.avgSpeed, the default value is 22.0 m/s.voidsetAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed) Sets the average speed theIResourceis allowed to take.voidsetCost(double fixCost, double perHourCost, double perKilometerCost) Sets three cost factors of the resource.voidsetDestinationLatitude(double destinationLatitude) Sets thelatitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working.voidsetDestinationLongitude(double destinationLongitude) Sets thelongitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working.voidsetDestinationPosition(com.dna.jopt.config.types.Position destinationPosition) voidsetFixCost(double fixCost) SetsAbstractBasicCapacityResource.fixCost, the default value is 0.0.booleansetFlexTime(Duration flexTime) Sets the flexTime in seconds.voidsetMaxDistance(double maxDistance) Sets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometerin [km] that a route can take.voidsetMaxHours(double maxHours) Deprecated.please usesetMaxWorkingTime(Duration)insteadvoidsetMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance aIResourceis allowed to travel perWorkingHourwithout throwing aIViolation.voidsetMaxWorkingTime(Duration maxTime) voidsetPerHourCost(double perHourCost) Sets theAbstractBasicCapacityResource.perHourCost, the default value is 1.0.voidsetPerHourProductionCost(double perHourProductionCost) voidsetPerKilometerCost(double perKilometerCost) Sets theAbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.voidsetSkillEfficiencyFactor(double factor) Deprecated.Sets the skill efficiency factor, which is multiplied with the service time at theNode.voidsetStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the strict overdistance limit.voidsetStrictOvertimeLimit(Duration strictOvertime) Sets the strict overtime limit.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.dna.jopt.member.unit.IOptimizationElement
forceSetId, getConstraintAliasId, getDistMatrixId, getDutyHours, getExtraInfo, getFlavour, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, hasRealGeoLocation, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
-
Method Details
-
setMaxHours
Deprecated.please usesetMaxWorkingTime(Duration)insteadDeprecated methodSets the double
AbstractBasicCapacityResource.maxGlobalHours, the maximum hours a route [h] can take per day.- Parameters:
maxHours- the double maxGlobalHours to be set
-
setMaxWorkingTime
- Parameters:
maxTime- the duration max time
-
getMaxHours
double getMaxHours()Gets the doubleAbstractBasicCapacityResource.maxGlobalHours, the maximum hours a route [h] can take per day.- Returns:
- the double maxGlobalHours
-
setMaxDistance
void setMaxDistance(double maxDistance) Sets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometerin [km] that a route can take.- Parameters:
maxDistance- the double to be set for maxGlobalDistanceKilometer
-
getMaxDistance
double getMaxDistance()Gets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometerin [km] that a route can take per day.- Returns:
- the double maxGlobalDistanceKilometer [km] a route can take
-
setAvgSpeed
void setAvgSpeed(double avgSpeed) Sets the avg speedAbstractBasicCapacityResource.avgSpeed, the default value is 22.0 m/s.- Parameters:
avgSpeed- the double average speed of the resource in m/s (applies if no time matrix is provided)
-
getAvgSpeed
double getAvgSpeed()Gets the avg speedAbstractBasicCapacityResource.avgSpeedof which the default value is 22.0 m/s.- Returns:
- the double average speed of the resource in m/s (applies if no time matrix is provided)
-
setCost
void setCost(double fixCost, double perHourCost, double perKilometerCost) Sets three cost factors of the resource.The default values are:
fixCost: 0.0perHourCost: 1.0perKilometerCost: 1.0- Parameters:
fixCost- the double for the fixCostperHourCost- the double cost per hourperKilometerCost- the double cost per kilometer
-
setSkillEfficiencyFactor
Deprecated.Sets the skill efficiency factor, which is multiplied with the service time at theNode. The default value is 1.0- Parameters:
factor- the double for the resource's efficiency factor
-
getSkillEfficiencyFactor
Deprecated.Gets theAbstractBasicCapacityResource.skillEfficiencyFactor, of which the default value is 1.0.- Returns:
- the double skill efficiency factor
-
setDestinationLatitude
void setDestinationLatitude(double destinationLatitude) Sets thelatitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.Implementation example:
CapacityResource jackTheTruckDriver = new CapacityResource( "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours); // Defining the alternate destination where work will end rep1.setDestinationLatitude(51.45); rep1.setDestinationLongitude(7.01667); rep1.setAlternateDestination(true); rep1.setCost(0, 1, 1); this.addElement(jackTheTruckDriver);- Parameters:
destinationLatitude- the double for the alternate destination latitude
-
getDestinationLatitude
double getDestinationLatitude()Gets thelatitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.- Returns:
- the double for the alternate destination latitude
-
setDestinationLongitude
void setDestinationLongitude(double destinationLongitude) Sets thelongitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.Implementation example:
CapacityResource jackTheTruckDriver = new CapacityResource( "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours); // Defining the alternate destination where work will end rep1.setDestinationLatitude(51.45); rep1.setDestinationLongitude(7.01667); rep1.setAlternateDestination(true); rep1.setCost(0, 1, 1); this.addElement(jackTheTruckDriver);- Parameters:
destinationLongitude- the double for the alternate destination longitude
-
getDestinationLongitude
double getDestinationLongitude()Gets thelongitudeof an alternate destination (setAlternateDestination(boolean)) where theIResourcewill stop working. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.- Returns:
- the double for the alternate destination longitude
-
setAlternateDestination
void setAlternateDestination(boolean hasAlternateDestination) Sets theAbstractBasicCapacityResource.hasAlternateDestination. When set totruetheIResourcehas to stop working at thisalternate destination. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.Implementation example:
CapacityResource jackTheTruckDriver = new CapacityResource( "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours); // Defining the alternate destination where work will end rep1.setDestinationLatitude(51.45); rep1.setDestinationLongitude(7.01667); rep1.setAlternateDestination(true); rep1.setCost(0, 1, 1); this.addElement(jackTheTruckDriver);- Parameters:
hasAlternateDestination- the boolean hasAlternateDestination to be set
-
hasAlternateDestination
boolean hasAlternateDestination()Gets theAbstractBasicCapacityResource.hasAlternateDestination. When set totruetheIResourcehas to stop working at thisalternate destination. TheResourcewill have to travel back to its starting location outside of theIWorkingHourssince it will start working there and not at thealternate destination.An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the
WorkingHours.- Returns:
- the boolean hasAlternateDestination
-
setAcceptableOvertimeSeconds
Deprecated.please usesetAcceptableOvertime(Duration)insteadDeprecated methodSets the acceptable overtime in seconds. This does not necessarily mean that this is the maximal overtime. This is just an acceptable overtime that does not increase the total cost much. The default value is -1.
- Parameters:
seconds- the double for new acceptable overtime seconds
-
setAcceptableOvertime
Sets theacceptable overtime. When aResourcearrives inacceptable overtimeaViolationwill be thrown but theNodewill not be filtered by alate Autofilter. Withinacceptable overtimethecostsare rising linearly, while outside ofovertimethey will rise exponentially.Arrival of the
Resourcewithin theacceptable overtimewill not increase the total cost much.- Parameters:
acceptableOvertime- theDurationof acceptable overtime
-
getAcceptableOvertimeSeconds
double getAcceptableOvertimeSeconds()Gets the acceptable overtime in seconds. This is just an acceptable overtime that does not increase the total cost much. When aResourcearrives inacceptable overtimeaViolationwill be thrown but theNodewill not be filtered by alate Autofilter. Withinacceptable overtimethecostsare rising linearly, while outside ofovertimethey will rise exponentially.- Returns:
- the double acceptableOvertimeSeconds
- See Also:
-
resetAcceptableOvertime
void resetAcceptableOvertime()Resets theAbstractBasicCapacityResource.acceptableOvertimeSecondsto the default value of-1.0. -
setStrictOvertimeLimit
Sets the strict overtime limit. This value does only have an effect if the AutoFilter with ForceFiltering is used.- Parameters:
strictOvertime- the new strict overtime limit
-
getStrictOvertimeLimitSeconds
double getStrictOvertimeLimitSeconds()Gets the strict overtime limit seconds.- Returns:
- the strict overtime limit seconds
-
setAcceptableOverdistance
void setAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) -
getAcceptableOverdistanceMeter
double getAcceptableOverdistanceMeter()Gets the acceptable overdistance meter.- Returns:
- the acceptable overdistance meter
-
setStrictOverdistanceLimit
void setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the strict overdistance limit.- Parameters:
maxDistance- the new strict overdistance limit
-
getStrictOverdistanceLimitMeter
double getStrictOverdistanceLimitMeter()Gets the strict overdistance limit meter.- Returns:
- the strict overdistance limit meter
-
getPerKilometerCost
double getPerKilometerCost()GetsAbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.- Returns:
- the double perKilometerCost
-
getPerHourCost
double getPerHourCost()GetsAbstractBasicCapacityResource.perHourCost, the default value is 1.0.- Returns:
- the double perHourCost
-
isEmptyAtEndOfRoute
boolean isEmptyAtEndOfRoute()ChecksAbstractBasicCapacityResource.emptyAtEndOfRoute.- Returns:
- the boolean emptyAtEndOfRoute
-
setFixCost
void setFixCost(double fixCost) SetsAbstractBasicCapacityResource.fixCost, the default value is 0.0.- Parameters:
fixCost- the double fixCost
-
getFixCost
double getFixCost()Gets theAbstractBasicCapacityResource.fixCost, the default value is 0.0.- Returns:
- the double fixCost
-
setPerHourCost
void setPerHourCost(double perHourCost) Sets theAbstractBasicCapacityResource.perHourCost, the default value is 1.0.- Parameters:
perHourCost- the double perHourCost
-
setPerKilometerCost
void setPerKilometerCost(double perKilometerCost) Sets theAbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.- Parameters:
perKilometerCost- the double perKilometerCost
-
addQualification
Puts the input in theHashMapAbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.A
Qualificationis a specific skill aResourceneeds to have to give service to aNodethat has aConstraintfor thatQualification. Giving service to such aNodeby aResourcewithout thatQualificationwill result in additional costs.Cannot be null.
- Parameters:
qualification- the iQualification qualification- See Also:
-
getQualifications
Map<Class<? extends IQualification>,IQualification> getQualifications()GetsAbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.A
Qualificationis a specific skill aResourceneeds to have to give service to aNodethat has aConstraintfor thatQualification. Giving service to such aNodeby aResourcewithout thatQualificationwill result in additional costs.* Cannot be null.
- Returns:
- the hashmap qualifications
- See Also:
-
setFlexTime
Sets the flexTime in seconds. The default is 0.- Parameters:
flexTime- the duration of the flexTimeSeconds to be set- Returns:
- true, if successful
-
getFlexTimeMillis
-
getDestinationDistMatrixId
int getDestinationDistMatrixId()Deprecated.as mentioned inAbstractBasicCapacityResource.getDestinationDistMatrixId()Deprecated method Gets theAbstractBasicCapacityResource.distMatrixId, the default value is -1.- Returns:
- the int distMatrixId
-
setMaxWorkingDistance
void setMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance aIResourceis allowed to travel perWorkingHourwithout throwing aIViolation.- Parameters:
maxDistance- the quantity length of the allowed max distance
-
setAvgSpeed
void setAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed) Sets the average speed theIResourceis allowed to take.- Parameters:
avgSpeed- the quantity speed average speed
-
getMaxWorkingDistance
javax.measure.Quantity<javax.measure.quantity.Length> getMaxWorkingDistance()- Returns:
- the quantity Length maximum distance
-
getMaxWorkingTime
Duration getMaxWorkingTime()Gets the maximum time aIResourceis allowed to be on aILogicEntityRoutewithout throwing aViolation.- Returns:
- the duration of the maximum working time
-
getAverageSpeed
javax.measure.Quantity<javax.measure.quantity.Speed> getAverageSpeed()Gets the average speed aIResourceis traveling with.- Returns:
- the average speed
-
setDestinationPosition
void setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition) -
getDestinationPosition
com.dna.jopt.config.types.Position getDestinationPosition() -
setPerHourProductionCost
void setPerHourProductionCost(double perHourProductionCost) -
getPerHourProductionCost
double getPerHourProductionCost()
-
AbstractBasicCapacityResource.getDestinationDistMatrixId()