public interface IBasicResource extends IOptimizationElement, Comparable<IBasicResource>
IResource
like average speed
, setting an
alternate destination
, setting acceptable overtime
etc.IOptimizationElement.OptimizationElementFlavour
Modifier and Type | Method and Description |
---|---|
void |
addQualification(IQualification qualification)
Puts the input in the
HashMap AbstractBasicCapacityResource.qualifications , whereas the
class is the key and the qualification is the value. |
double |
getAcceptableOverdistanceMeter()
Gets the acceptable overdistance meter.
|
double |
getAcceptableOvertimeSeconds()
Gets the acceptable overtime in seconds.
|
javax.measure.Quantity<javax.measure.quantity.Speed> |
getAverageSpeed()
Gets the average speed a
IResource is traveling with. |
double |
getAvgSpeed()
Gets the avg speed
AbstractBasicCapacityResource.avgSpeed of which the default value is 22.0 m/s. |
int |
getDestinationDistMatrixId()
Deprecated.
as mentioned in
AbstractBasicCapacityResource.getDestinationDistMatrixId() |
double |
getDestinationLatitude()
Gets the
latitude of an alternate destination (setAlternateDestination(boolean) ) where
the IResource will stop working. |
double |
getDestinationLongitude()
Gets the
longitude of an alternate destination (setAlternateDestination(boolean) ) where
the IResource will stop working. |
com.dna.jopt.config.types.Position |
getDestinationPosition() |
double |
getFixCost()
Gets the
AbstractBasicCapacityResource.fixCost , the default value is 0.0. |
Optional<Long> |
getFlexTimeMillis() |
double |
getMaxDistance()
Gets the max distance
AbstractBasicCapacityResource.maxGlobalDistanceKilometer in [km] that a route
can take per day. |
double |
getMaxHours()
Gets the double
AbstractBasicCapacityResource.maxGlobalHours , the maximum hours a route [h] can take
per day. |
javax.measure.Quantity<javax.measure.quantity.Length> |
getMaxWorkingDistance()
|
Duration |
getMaxWorkingTime()
Gets the maximum time a
IResource is allowed to be on
a ILogicEntityRoute without throwing a Violation . |
double |
getPerHourCost()
Gets
AbstractBasicCapacityResource.perHourCost , the default value is 1.0. |
double |
getPerHourProductionCost() |
double |
getPerKilometerCost()
Gets
AbstractBasicCapacityResource.perKilometerCost , the default value is 1.0. |
Map<Class<? extends IQualification>,IQualification> |
getQualifications()
Gets
AbstractBasicCapacityResource.qualifications , whereas the class is the key and the
qualification is the value. |
double |
getSkillEfficiencyFactor()
Deprecated.
Gets the
AbstractBasicCapacityResource.skillEfficiencyFactor , of which the default value
is 1.0. |
double |
getStrictOverdistanceLimitMeter()
Gets the strict overdistance limit meter.
|
double |
getStrictOvertimeLimitSeconds()
Gets the strict overtime limit seconds.
|
boolean |
hasAlternateDestination()
|
boolean |
isEmptyAtEndOfRoute()
|
void |
resetAcceptableOvertime()
Resets the
AbstractBasicCapacityResource.acceptableOvertimeSeconds to the default value of -1.0 . |
void |
setAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) |
void |
setAcceptableOvertime(Duration acceptableOvertime)
Sets the
acceptable overtime . |
void |
setAcceptableOvertimeSeconds(double seconds)
Deprecated.
please use
setAcceptableOvertime(Duration) instead |
void |
setAlternateDestination(boolean hasAlternateDestination)
|
void |
setAvgSpeed(double avgSpeed)
Sets the avg speed
AbstractBasicCapacityResource.avgSpeed , the default value is 22.0 m/s. |
void |
setAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed)
Sets the average speed the
IResource is allowed to
take. |
void |
setCost(double fixCost,
double perHourCost,
double perKilometerCost)
Sets three cost factors of the resource.
|
void |
setDestinationLatitude(double destinationLatitude)
Sets the
latitude of an alternate destination (setAlternateDestination(boolean) ) where
the IResource will stop working. |
void |
setDestinationLongitude(double destinationLongitude)
Sets the
longitude of an alternate destination (setAlternateDestination(boolean) ) where
the IResource will stop working. |
void |
setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition) |
void |
setFixCost(double fixCost)
Sets
AbstractBasicCapacityResource.fixCost , the default value is 0.0. |
boolean |
setFlexTime(Duration flexTime)
Sets the flexTime in seconds.
|
void |
setMaxDistance(double maxDistance)
Sets the max distance
AbstractBasicCapacityResource.maxGlobalDistanceKilometer in [km] that a route
can take. |
void |
setMaxHours(double maxHours)
Deprecated.
please use
setMaxWorkingTime(Duration) instead |
void |
setMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the maximal distance a
IResource is allowed to
travel per WorkingHour without throwing a IViolation . |
void |
setMaxWorkingTime(Duration maxTime)
|
void |
setPerHourCost(double perHourCost)
Sets the
AbstractBasicCapacityResource.perHourCost , the default value is 1.0. |
void |
setPerHourProductionCost(double perHourProductionCost) |
void |
setPerKilometerCost(double perKilometerCost)
Sets the
AbstractBasicCapacityResource.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 the
Node . The default value is 1.0 |
void |
setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the strict overdistance limit.
|
void |
setStrictOvertimeLimit(Duration strictOvertime)
Sets the strict overtime limit.
|
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
compareTo
@Deprecated void setMaxHours(double maxHours)
setMaxWorkingTime(Duration)
insteadSets the double AbstractBasicCapacityResource.maxGlobalHours
, the maximum hours a route [h] can
take per day.
maxHours
- the double maxGlobalHours to be setvoid setMaxWorkingTime(Duration maxTime)
maxTime
- the duration max timedouble getMaxHours()
AbstractBasicCapacityResource.maxGlobalHours
, the maximum hours a route [h] can take
per day.void setMaxDistance(double maxDistance)
AbstractBasicCapacityResource.maxGlobalDistanceKilometer
in [km] that a route
can take.maxDistance
- the double to be set for maxGlobalDistanceKilometerdouble getMaxDistance()
AbstractBasicCapacityResource.maxGlobalDistanceKilometer
in [km] that a route
can take per day.void setAvgSpeed(double avgSpeed)
AbstractBasicCapacityResource.avgSpeed
, the default value is 22.0 m/s.avgSpeed
- the double average speed of the resource in m/s (applies if no time matrix is
provided)double getAvgSpeed()
AbstractBasicCapacityResource.avgSpeed
of which the default value is 22.0 m/s.void setCost(double fixCost, double perHourCost, double perKilometerCost)
The default values are:
fixCost
: 0.0
perHourCost
: 1.0
perKilometerCost
: 1.0
fixCost
- the double for the fixCostperHourCost
- the double cost per hourperKilometerCost
- the double cost per kilometer@Deprecated void setSkillEfficiencyFactor(double factor)
Node
. The default value is 1.0factor
- the double for the resource's efficiency factor@Deprecated double getSkillEfficiencyFactor()
AbstractBasicCapacityResource.skillEfficiencyFactor
, of which the default value
is 1.0.void setDestinationLatitude(double destinationLatitude)
latitude
of an alternate destination (setAlternateDestination(boolean)
) where
the IResource
will stop working. The Resource
will have to travel back to its
starting location outside of the IWorkingHours
since it
will start working there and not at the alternate 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);
destinationLatitude
- the double for the alternate destination latitudedouble getDestinationLatitude()
latitude
of an alternate destination (setAlternateDestination(boolean)
) where
the IResource
will stop working. The Resource
will have to travel back to its
starting location outside of the IWorkingHours
since it
will start working there and not at the alternate 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
.
void setDestinationLongitude(double destinationLongitude)
longitude
of an alternate destination (setAlternateDestination(boolean)
) where
the IResource
will stop working. The Resource
will have to travel back to its
starting location outside of the IWorkingHours
since it
will start working there and not at the alternate 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);
destinationLongitude
- the double for the alternate destination longitudedouble getDestinationLongitude()
longitude
of an alternate destination (setAlternateDestination(boolean)
) where
the IResource
will stop working. The Resource
will have to travel back to its
starting location outside of the IWorkingHours
since it
will start working there and not at the alternate 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
.
void setAlternateDestination(boolean hasAlternateDestination)
AbstractBasicCapacityResource.hasAlternateDestination
. When set to true
the IResource
has to stop working at this alternate destination
. The
Resource
will have to travel back to its starting location outside of the IWorkingHours
since it will start working there and not at the
alternate 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);
hasAlternateDestination
- the boolean hasAlternateDestination to be setboolean hasAlternateDestination()
AbstractBasicCapacityResource.hasAlternateDestination
. When set to true
the IResource
has to stop working at this alternate destination
. The
Resource
will have to travel back to its starting location outside of the IWorkingHours
since it will start working there and not at the
alternate 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
.
@Deprecated void setAcceptableOvertimeSeconds(double seconds)
setAcceptableOvertime(Duration)
insteadSets 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.
seconds
- the double for new acceptable overtime secondsvoid setAcceptableOvertime(Duration acceptableOvertime)
acceptable overtime
. When a Resource
arrives in acceptable
overtime
a Violation
will be thrown but the Node
will not be filtered by a
late Autofilter
. Within acceptable overtime
the costs
are rising
linearly, while outside of overtime
they will rise exponentially.
Arrival of the Resource
within the acceptable overtime
will not increase the
total cost much.
acceptableOvertime
- the Duration
of acceptable overtimedouble getAcceptableOvertimeSeconds()
Resource
arrives in acceptable overtime
a
Violation
will be thrown but the Node
will not be filtered by a late
Autofilter
. Within acceptable overtime
the costs
are rising linearly, while
outside of overtime
they will rise exponentially.setAcceptableOvertime(Duration)
void resetAcceptableOvertime()
AbstractBasicCapacityResource.acceptableOvertimeSeconds
to the default value of -1.0
.void setStrictOvertimeLimit(Duration strictOvertime)
strictOvertime
- the new strict overtime limitdouble getStrictOvertimeLimitSeconds()
void setAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
double getAcceptableOverdistanceMeter()
void setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
maxDistance
- the new strict overdistance limitdouble getStrictOverdistanceLimitMeter()
double getPerKilometerCost()
AbstractBasicCapacityResource.perKilometerCost
, the default value is 1.0.double getPerHourCost()
AbstractBasicCapacityResource.perHourCost
, the default value is 1.0.boolean isEmptyAtEndOfRoute()
void setFixCost(double fixCost)
AbstractBasicCapacityResource.fixCost
, the default value is 0.0.fixCost
- the double fixCostdouble getFixCost()
AbstractBasicCapacityResource.fixCost
, the default value is 0.0.void setPerHourCost(double perHourCost)
AbstractBasicCapacityResource.perHourCost
, the default value is 1.0.perHourCost
- the double perHourCostvoid setPerKilometerCost(double perKilometerCost)
AbstractBasicCapacityResource.perKilometerCost
, the default value is 1.0.perKilometerCost
- the double perKilometerCostvoid addQualification(IQualification qualification)
HashMap
AbstractBasicCapacityResource.qualifications
, whereas the
class is the key and the qualification is the value.
A Qualification
is a specific skill a Resource
needs to have to give service
to a Node
that has a Constraint
for that Qualification
. Giving service
to such a Node
by a Resource
without that Qualification
will result in
additional costs.
Cannot be null.
qualification
- the iQualification qualificationTypeQualification
,
TypeConstraint
Map<Class<? extends IQualification>,IQualification> getQualifications()
AbstractBasicCapacityResource.qualifications
, whereas the class is the key and the
qualification is the value.
A Qualification
is a specific skill a Resource
needs to have to give service
to a Node
that has a Constraint
for that Qualification
. Giving service
to such a Node
by a Resource
without that Qualification
will result in
additional costs.
* Cannot be null.
TypeQualification
,
TypeConstraint
boolean setFlexTime(Duration flexTime)
flexTime
- the duration of the flexTimeSeconds to be setint getDestinationDistMatrixId()
AbstractBasicCapacityResource.getDestinationDistMatrixId()
AbstractBasicCapacityResource.distMatrixId
, the default value is -1.void setMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IResource
is allowed to
travel per WorkingHour
without throwing a IViolation
.maxDistance
- the quantity length of the allowed max distancevoid setAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed)
IResource
is allowed to
take.avgSpeed
- the quantity speed average speedjavax.measure.Quantity<javax.measure.quantity.Length> getMaxWorkingDistance()
Duration getMaxWorkingTime()
IResource
is allowed to be on
a ILogicEntityRoute
without throwing a Violation
.javax.measure.Quantity<javax.measure.quantity.Speed> getAverageSpeed()
IResource
is traveling with.void setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition)
com.dna.jopt.config.types.Position getDestinationPosition()
void setPerHourProductionCost(double perHourProductionCost)
double getPerHourProductionCost()
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.