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 TypeMethodDescriptionvoid
addQualification
(IQualification qualification) Puts the input in theHashMap
AbstractBasicCapacityResource.qualifications
, whereas the class is the key and the qualification is the value.double
Gets the acceptable overdistance meter.double
Gets the acceptable overtime in seconds.javax.measure.Quantity<javax.measure.quantity.Speed>
Gets the average speed aIResource
is traveling with.double
Gets the avg speedAbstractBasicCapacityResource.avgSpeed
of which the default value is 22.0 m/s.int
Deprecated.double
Gets thelatitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working.double
Gets thelongitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working.com.dna.jopt.config.types.Position
double
Gets theAbstractBasicCapacityResource.fixCost
, the default value is 0.0.double
Gets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometer
in [km] that a route can take per day.double
Gets the doubleAbstractBasicCapacityResource.maxGlobalHours
, the maximum hours a route [h] can take per day.javax.measure.Quantity<javax.measure.quantity.Length>
Gets the maximum time aIResource
is allowed to be on aILogicEntityRoute
without throwing aViolation
.double
GetsAbstractBasicCapacityResource.perHourCost
, the default value is 1.0.double
double
GetsAbstractBasicCapacityResource.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.double
Deprecated.Gets theAbstractBasicCapacityResource.skillEfficiencyFactor
, of which the default value is 1.0.double
Gets the strict overdistance limit meter.double
Gets the strict overtime limit seconds.boolean
Gets theAbstractBasicCapacityResource.hasAlternateDestination
.boolean
ChecksAbstractBasicCapacityResource.emptyAtEndOfRoute
.void
Resets theAbstractBasicCapacityResource.acceptableOvertimeSeconds
to the default value of-1.0
.void
setAcceptableOverdistance
(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) void
setAcceptableOvertime
(Duration acceptableOvertime) Sets theacceptable overtime
.void
setAcceptableOvertimeSeconds
(double seconds) Deprecated.please usesetAcceptableOvertime(Duration)
insteadvoid
setAlternateDestination
(boolean hasAlternateDestination) Sets theAbstractBasicCapacityResource.hasAlternateDestination
.void
setAvgSpeed
(double avgSpeed) Sets the avg speedAbstractBasicCapacityResource.avgSpeed
, the default value is 22.0 m/s.void
setAvgSpeed
(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed) Sets the average speed theIResource
is allowed to take.void
setCost
(double fixCost, double perHourCost, double perKilometerCost) Sets three cost factors of the resource.void
setDestinationLatitude
(double destinationLatitude) Sets thelatitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working.void
setDestinationLongitude
(double destinationLongitude) Sets thelongitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working.void
setDestinationPosition
(com.dna.jopt.config.types.Position destinationPosition) void
setFixCost
(double fixCost) SetsAbstractBasicCapacityResource.fixCost
, the default value is 0.0.boolean
setFlexTime
(Duration flexTime) Sets the flexTime in seconds.void
setMaxDistance
(double maxDistance) Sets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometer
in [km] that a route can take.void
setMaxHours
(double maxHours) Deprecated.please usesetMaxWorkingTime(Duration)
insteadvoid
setMaxWorkingDistance
(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance aIResource
is allowed to travel perWorkingHour
without throwing aIViolation
.void
setMaxWorkingTime
(Duration maxTime) void
setPerHourCost
(double perHourCost) Sets theAbstractBasicCapacityResource.perHourCost
, the default value is 1.0.void
setPerHourProductionCost
(double perHourProductionCost) void
setPerKilometerCost
(double perKilometerCost) Sets theAbstractBasicCapacityResource.perKilometerCost
, the default value is 1.0.void
setSkillEfficiencyFactor
(double factor) Deprecated.Sets the skill efficiency factor, which is multiplied with the service time at theNode
.void
setStrictOverdistanceLimit
(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the strict overdistance limit.void
setStrictOvertimeLimit
(Duration strictOvertime) Sets the strict overtime limit.Methods inherited from interface java.lang.Comparable
compareTo
Methods 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.maxGlobalDistanceKilometer
in [km] that a route can take.- Parameters:
maxDistance
- the double to be set for maxGlobalDistanceKilometer
-
getMaxDistance
double getMaxDistance()Gets the max distanceAbstractBasicCapacityResource.maxGlobalDistanceKilometer
in [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.avgSpeed
of 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 thelatitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 thelatitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 thelongitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 thelongitude
of an alternate destination (setAlternateDestination(boolean)
) where theIResource
will stop working. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 totrue
theIResource
has to stop working at thisalternate destination
. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 totrue
theIResource
has to stop working at thisalternate destination
. TheResource
will have to travel back to its starting location outside of theIWorkingHours
since 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 aResource
arrives inacceptable overtime
aViolation
will be thrown but theNode
will not be filtered by alate Autofilter
. Withinacceptable overtime
thecosts
are rising linearly, while outside ofovertime
they will rise exponentially.Arrival of the
Resource
within theacceptable overtime
will not increase the total cost much.- Parameters:
acceptableOvertime
- theDuration
of 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 aResource
arrives inacceptable overtime
aViolation
will be thrown but theNode
will not be filtered by alate Autofilter
. Withinacceptable overtime
thecosts
are rising linearly, while outside ofovertime
they will rise exponentially.- Returns:
- the double acceptableOvertimeSeconds
- See Also:
-
resetAcceptableOvertime
void resetAcceptableOvertime()Resets theAbstractBasicCapacityResource.acceptableOvertimeSeconds
to 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 theHashMap
AbstractBasicCapacityResource.qualifications
, whereas the class is the key and the qualification is the value.A
Qualification
is a specific skill aResource
needs to have to give service to aNode
that has aConstraint
for thatQualification
. Giving service to such aNode
by aResource
without thatQualification
will 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
Qualification
is a specific skill aResource
needs to have to give service to aNode
that has aConstraint
for thatQualification
. Giving service to such aNode
by aResource
without thatQualification
will 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 aIResource
is allowed to travel perWorkingHour
without 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 theIResource
is 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 aIResource
is allowed to be on aILogicEntityRoute
without throwing aViolation
.- Returns:
- the duration of the maximum working time
-
getAverageSpeed
javax.measure.Quantity<javax.measure.quantity.Speed> getAverageSpeed()Gets the average speed aIResource
is 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()