public abstract class AbstractBasicCapacityResource extends AbstractOptimizationElement implements IBasicResource
IOptimizationElement.OptimizationElementFlavour
dutyHours
Modifier | Constructor and Description |
---|---|
protected |
AbstractBasicCapacityResource() |
protected |
AbstractBasicCapacityResource(String resourceId,
double latitude,
double longitude,
double maxHours,
double maxDistance,
List<IDutyHours> workingHours)
Deprecated.
|
|
AbstractBasicCapacityResource(String resourceId,
double latitude,
double longitude,
double maxHours,
double maxDistance,
WorkingHours[] workingHours)
Deprecated.
|
protected |
AbstractBasicCapacityResource(String resourceId,
double latitude,
double longitude,
Duration maxTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance,
List<IWorkingHours> workingHours) |
protected |
AbstractBasicCapacityResource(String resourceId,
com.dna.jopt.config.types.Position pos,
Duration maxTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance,
List<IWorkingHours> workingHours) |
Modifier and Type | Method and Description |
---|---|
void |
addQualification(IQualification qualification)
Puts the input in the
HashMap qualifications , whereas the
class is the key and the qualification is the value. |
int |
compareTo(IBasicResource o) |
static IResource |
copyWithNewId(IResource src,
String targetId) |
boolean |
equals(Object obj) |
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
avgSpeed of which the default value is 22.0 m/s. |
int |
getDestinationDistMatrixId()
Deprecated.
|
double |
getDestinationLatitude()
Gets the
latitude of an alternate destination (IBasicResource.setAlternateDestination(boolean) ) where
the IResource will stop working. |
double |
getDestinationLongitude()
Gets the
longitude of an alternate destination (IBasicResource.setAlternateDestination(boolean) ) where
the IResource will stop working. |
com.dna.jopt.config.types.Position |
getDestinationPosition() |
double |
getFixCost()
Gets the
fixCost , the default value is 0.0. |
IOptimizationElement.OptimizationElementFlavour |
getFlavour()
Gets the flavour which spells out the kind of
Node of the element. |
Optional<Long> |
getFlexTimeMillis() |
double |
getMaxDistance()
Gets the max distance
maxGlobalDistanceKilometer in [km] that a route
can take per day. |
double |
getMaxHours()
Gets the double
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
perHourCost , the default value is 1.0. |
double |
getPerKilometerCost()
Gets
perKilometerCost , the default value is 1.0. |
Map<Class<? extends IQualification>,IQualification> |
getQualifications()
Gets
qualifications , whereas the class is the key and the
qualification is the value. |
String |
getResourceId()
Deprecated.
|
double |
getSkillEfficiencyFactor()
Deprecated.
|
double |
getStrictOverdistanceLimitMeter()
Gets the strict overdistance limit meter.
|
double |
getStrictOvertimeLimitSeconds()
Gets the strict overtime limit seconds.
|
boolean |
hasAlternateDestination()
Gets the
hasAlternateDestination . |
int |
hashCode() |
boolean |
hasRealGeoLocation()
Returns
true if the item has a real geo location. |
boolean |
isEmptyAtEndOfRoute()
Checks
emptyAtEndOfRoute . |
void |
resetAcceptableOvertime()
Resets the
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.
|
void |
setAlternateDestination(boolean hasAlternateDestination)
Sets the
hasAlternateDestination . |
void |
setAvgSpeed(double avgSpeed)
Deprecated.
|
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 |
setDestinationDistMatrixId(int distMatrixId)
Deprecated.
|
void |
setDestinationLatitude(double destinationLatitude)
Sets the
latitude of an alternate destination (IBasicResource.setAlternateDestination(boolean) ) where
the IResource will stop working. |
void |
setDestinationLongitude(double destinationLongitude)
Sets the
longitude of an alternate destination (IBasicResource.setAlternateDestination(boolean) ) where
the IResource will stop working. |
void |
setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition) |
void |
setFixCost(double fixCost)
Sets
fixCost , the default value is 0.0. |
boolean |
setFlexTime(Duration idleTimeReductionTime)
Sets the flexTime in seconds.
|
void |
setMaxDistance(double maxDistance)
Deprecated.
|
void |
setMaxHours(double maxHours)
Deprecated.
|
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
perHourCost , the default value is 1.0. |
void |
setPerKilometerCost(double perKilometerCost)
Sets the
perKilometerCost , the default value is 1.0. |
void |
setResourceId(String id)
Deprecated.
|
void |
setSkillEfficiencyFactor(double skillEfficiencyFactor)
Deprecated.
|
void |
setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the strict overdistance limit.
|
void |
setStrictOvertimeLimit(Duration strictOvertimeLimit)
Sets the strict overtime limit.
|
void |
setWorkingHours(WorkingHours[] workingHours)
Deprecated.
|
String |
toString() |
forceSetId, getConstraintAliasId, getDistMatrixId, getDutyHours, getExtraInfo, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forceSetId, getConstraintAliasId, getDistMatrixId, getDutyHours, getExtraInfo, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
protected AbstractBasicCapacityResource()
protected AbstractBasicCapacityResource(String resourceId, double latitude, double longitude, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours)
protected AbstractBasicCapacityResource(String resourceId, com.dna.jopt.config.types.Position pos, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours)
@Deprecated protected AbstractBasicCapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, List<IDutyHours> workingHours)
@Deprecated public AbstractBasicCapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, WorkingHours[] workingHours)
resourceId
- the resource idlatitude
- the latitudelongitude
- the longitudemaxHours
- the max hoursmaxDistance
- the max distanceworkingHours
- the working hoursLEGACY CONSTRUCTOR
Instantiates a new capacity resource.
PLEASE DO NOT USE THIS CONSTRUCTOR ANYMORE! IT WILL BE REMOVED IN FUTURE VERSIONS
public int hashCode()
hashCode
in class AbstractOptimizationElement
public boolean equals(Object obj)
equals
in class AbstractOptimizationElement
public void setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition)
setDestinationPosition
in interface IBasicResource
public com.dna.jopt.config.types.Position getDestinationPosition()
getDestinationPosition
in interface IBasicResource
public void setDestinationLatitude(double destinationLatitude)
IBasicResource
latitude
of an alternate destination (IBasicResource.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);
setDestinationLatitude
in interface IBasicResource
destinationLatitude
- the double for the alternate destination latitudepublic double getDestinationLatitude()
IBasicResource
latitude
of an alternate destination (IBasicResource.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
.
getDestinationLatitude
in interface IBasicResource
public void setDestinationLongitude(double destinationLongitude)
IBasicResource
longitude
of an alternate destination (IBasicResource.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);
setDestinationLongitude
in interface IBasicResource
destinationLongitude
- the double for the alternate destination longitudepublic double getDestinationLongitude()
IBasicResource
longitude
of an alternate destination (IBasicResource.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
.
getDestinationLongitude
in interface IBasicResource
public void setAlternateDestination(boolean hasAlternateDestination)
IBasicResource
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);
setAlternateDestination
in interface IBasicResource
hasAlternateDestination
- the boolean hasAlternateDestination to be setpublic boolean hasAlternateDestination()
IBasicResource
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
.
hasAlternateDestination
in interface IBasicResource
@Deprecated public void setMaxHours(double maxHours)
IBasicResource
Sets the double maxGlobalHours
, the maximum hours a route [h] can
take per day.
setMaxHours
in interface IBasicResource
maxHours
- the double maxGlobalHours to be setpublic void setMaxWorkingTime(Duration maxTime)
IBasicResource
setMaxWorkingTime
in interface IBasicResource
maxTime
- the duration max timepublic Duration getMaxWorkingTime()
IBasicResource
IResource
is allowed to be on
a ILogicEntityRoute
without throwing a Violation
.getMaxWorkingTime
in interface IBasicResource
public double getMaxHours()
IBasicResource
maxGlobalHours
, the maximum hours a route [h] can take
per day.getMaxHours
in interface IBasicResource
@Deprecated public void setMaxDistance(double maxDistance)
IBasicResource
maxGlobalDistanceKilometer
in [km] that a route
can take.setMaxDistance
in interface IBasicResource
maxDistance
- the double to be set for maxGlobalDistanceKilometerpublic void setMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IBasicResource
IResource
is allowed to
travel per WorkingHour
without throwing a IViolation
.setMaxWorkingDistance
in interface IBasicResource
maxDistance
- the quantity length of the allowed max distancepublic javax.measure.Quantity<javax.measure.quantity.Length> getMaxWorkingDistance()
IBasicResource
getMaxWorkingDistance
in interface IBasicResource
public double getMaxDistance()
IBasicResource
maxGlobalDistanceKilometer
in [km] that a route
can take per day.getMaxDistance
in interface IBasicResource
public void setAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed)
IBasicResource
IResource
is allowed to
take.setAvgSpeed
in interface IBasicResource
avgSpeed
- the quantity speed average speedpublic javax.measure.Quantity<javax.measure.quantity.Speed> getAverageSpeed()
IBasicResource
IResource
is traveling with.getAverageSpeed
in interface IBasicResource
@Deprecated public void setAvgSpeed(double avgSpeed)
IBasicResource
avgSpeed
, the default value is 22.0 m/s.setAvgSpeed
in interface IBasicResource
avgSpeed
- the double average speed of the resource in m/s (applies if no time matrix is
provided)public double getAvgSpeed()
IBasicResource
avgSpeed
of which the default value is 22.0 m/s.getAvgSpeed
in interface IBasicResource
public void setCost(double fixCost, double perHourCost, double perKilometerCost)
IBasicResource
The default values are:
fixCost
: 0.0
perHourCost
: 1.0
perKilometerCost
: 1.0
setCost
in interface IBasicResource
fixCost
- the double for the fixCostperHourCost
- the double cost per hourperKilometerCost
- the double cost per kilometerpublic void setFixCost(double fixCost)
IBasicResource
fixCost
, the default value is 0.0.setFixCost
in interface IBasicResource
fixCost
- the double fixCostpublic double getFixCost()
IBasicResource
fixCost
, the default value is 0.0.getFixCost
in interface IBasicResource
public void setPerHourCost(double perHourCost)
IBasicResource
perHourCost
, the default value is 1.0.setPerHourCost
in interface IBasicResource
perHourCost
- the double perHourCostpublic double getPerHourCost()
IBasicResource
perHourCost
, the default value is 1.0.getPerHourCost
in interface IBasicResource
public void setPerKilometerCost(double perKilometerCost)
IBasicResource
perKilometerCost
, the default value is 1.0.setPerKilometerCost
in interface IBasicResource
perKilometerCost
- the double perKilometerCostpublic double getPerKilometerCost()
IBasicResource
perKilometerCost
, the default value is 1.0.getPerKilometerCost
in interface IBasicResource
public boolean hasRealGeoLocation()
IOptimizationElement
true
if the item has a real geo location. For example, an EventNode
has no real geo location.hasRealGeoLocation
in interface IOptimizationElement
public boolean isEmptyAtEndOfRoute()
IBasicResource
emptyAtEndOfRoute
.isEmptyAtEndOfRoute
in interface IBasicResource
public void addQualification(IQualification qualification)
IBasicResource
HashMap
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.
addQualification
in interface IBasicResource
qualification
- the iQualification qualificationTypeQualification
,
TypeConstraint
public Map<Class<? extends IQualification>,IQualification> getQualifications()
IBasicResource
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.
getQualifications
in interface IBasicResource
TypeQualification
,
TypeConstraint
public int compareTo(IBasicResource o)
compareTo
in interface Comparable<IBasicResource>
@Deprecated public double getSkillEfficiencyFactor()
getSkillEfficiencyFactor
in interface IBasicResource
@Deprecated public void setSkillEfficiencyFactor(double skillEfficiencyFactor)
setSkillEfficiencyFactor
in interface IBasicResource
skillEfficiencyFactor
- the double for the resource's efficiency factorpublic String toString()
toString
in class AbstractOptimizationElement
public IOptimizationElement.OptimizationElementFlavour getFlavour()
IOptimizationElement
Node
of the element.getFlavour
in interface IOptimizationElement
@Deprecated public void setAcceptableOvertimeSeconds(double seconds)
IBasicResource
Sets 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.
setAcceptableOvertimeSeconds
in interface IBasicResource
seconds
- the double for new acceptable overtime secondspublic void setAcceptableOvertime(Duration acceptableOvertime)
IBasicResource
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.
setAcceptableOvertime
in interface IBasicResource
acceptableOvertime
- the Duration
of acceptable overtimepublic void resetAcceptableOvertime()
IBasicResource
acceptableOvertimeSeconds
to the default value of -1.0
.resetAcceptableOvertime
in interface IBasicResource
public double getAcceptableOvertimeSeconds()
IBasicResource
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.getAcceptableOvertimeSeconds
in interface IBasicResource
IBasicResource.setAcceptableOvertime(Duration)
public void setStrictOvertimeLimit(Duration strictOvertimeLimit)
IBasicResource
setStrictOvertimeLimit
in interface IBasicResource
strictOvertimeLimit
- the new strict overtime limitpublic double getStrictOvertimeLimitSeconds()
IBasicResource
getStrictOvertimeLimitSeconds
in interface IBasicResource
public void setAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
setAcceptableOverdistance
in interface IBasicResource
public double getAcceptableOverdistanceMeter()
IBasicResource
getAcceptableOverdistanceMeter
in interface IBasicResource
public void setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IBasicResource
setStrictOverdistanceLimit
in interface IBasicResource
maxDistance
- the new strict overdistance limitpublic double getStrictOverdistanceLimitMeter()
IBasicResource
getStrictOverdistanceLimitMeter
in interface IBasicResource
public boolean setFlexTime(Duration idleTimeReductionTime)
IBasicResource
setFlexTime
in interface IBasicResource
idleTimeReductionTime
- the duration of the flexTimeSeconds to be setpublic Optional<Long> getFlexTimeMillis()
getFlexTimeMillis
in interface IBasicResource
@Deprecated public String getResourceId()
Gets the resource id. Use getId() instead
@Deprecated public void setResourceId(String id)
id
- the new resource idSets the resource id. Use setId(String id) instead
@Deprecated public void setDestinationDistMatrixId(int distMatrixId)
distMatrixId
- the new destination dist matrix idSets the destination dist matrix id.
@Deprecated public int getDestinationDistMatrixId()
IBasicResource
distMatrixId
, the default value is -1.getDestinationDistMatrixId
in interface IBasicResource
Gets the destination dist matrix id.
@Deprecated public void setWorkingHours(WorkingHours[] workingHours)
workingHours
- the new working hoursSets the working hours.
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.