public interface INode extends IOptimizationElement
INode
. Nodes
are single work orders
to be performed within a schedule
(IOpeningHours
). Each
node
has different properties like skills, workload,
time-window, loading restrictions. Together with
IResource
, Nodes
build
the input for the optimization run.IOptimizationElement.OptimizationElementFlavour
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(IConstraint constraint)
Adds a
constraint which limits the Resources that can serve
this Node to those that have the specific Qualification to do
so. |
void |
addNode2NodeRelation(INode2NodeRelation relation)
Sets two
Nodes in a Relation . |
void |
addQualification(IQualification qualification)
Adds a
IQualification to the Resource , which means that by
adding a IConstraint to the INode , they are limited to which
Nodes they can give service. |
void |
addSubsequentSlaveNode(INode node)
Adds a subsequent slave node, which need to be visited in direct succession.
|
void |
addSubsequentSlaveNodes(List<INode> nodes)
Adds a list of subsequent slave nodes, which need to be visited in direct
succession.
|
void |
addViolation(IViolation violation)
Adds a
IViolation to Node . |
int |
decrementCurrentAutoFilterProtectedExecutions()
The number of
iterations the Node is still protected from
being autofiltered. |
void |
detachNodeRelations() |
void |
detachResourceConstraints()
Removes all
IConstraint . |
void |
detachResourceConstraints(String resId)
|
IAutoFilterViolationAndConstrainCollector |
getAutoFilterViolationCollector()
Gets the
AbstractNode.myAutoFilterViolationCollector that collected
all IViolation . |
int |
getBaseJointVisitDuration()
Deprecated.
|
long |
getBaseJointVisitDurationMillis() |
int |
getBaseVisitDuration()
Deprecated.
|
long |
getBaseVisitDurationMillis()
Gets the base visit duration in millis
|
List<IConstraint> |
getConstraints()
Gets the
Constraints which limit the Resources that can serve
this Node to those that have the specific Qualification to do
so. |
int |
getCurrentLeftAutoFilterProtectedExecutions()
Gets the
AbstractNode.numCurrentProtectedExecutions , the default
value is 0 . |
int |
getFirstNodeInRouteImportance() |
double |
getFixCost()
Gets the
fixCost . |
int |
getImportance()
Gets the
priority . |
double |
getIndividualOfferedNodeMultiplier()
Gets a cost
multiplier for this specific Node . |
int |
getJointVisitDuration(ILogicEntityRoute ownerRoute)
Deprecated.
|
long |
getJointVisitDurationMillis(ILogicEntityRoute ownerRoute)
Gets the
AbstractNode.getJointVisitDurationMillis(com.dna.jopt.member.bucket.route.ILogicEntityRoute) , which is the reduced
visitDuration of a Node caused by efficiency effects since several
Nodes close to one another. |
List<String> |
getLastKnownAttachedAndRemovedResIds() |
int |
getLastNodeInRouteImportance() |
double[] |
getLoad()
Gets the amount of goods the
Resource is getting added by visiting
the Resource . |
Optional<Long> |
getLockdownTime() |
long |
getMinVisitDurationMillis()
Gets the min visit duration millis.
|
List<INode2NodeRelation> |
getNode2NodeRelations()
Gets the
Relations of the Node . |
INodeColor |
getNodeColor()
Gets the
INodeColor of the Node . |
Optional<INodeDepot> |
getNodeDepot() |
List<IDutyHours> |
getOriginalDutyHours() |
Map<Class<? extends IQualification>,IQualification> |
getQualifications()
Gets the
IQualification of the Resource . |
Duration |
getStayAtStartDuration() |
List<INode> |
getSubsequentSlaveNodes() |
int |
getTempImplausibleScore() |
int |
getTotalLoadDimension()
Gets the total load of a specific good.
|
int |
getUnloadAllDimension()
Gets if it is allowed for a
Resource to unload all its
Capacity of a specific good (dimension ) at this Node . |
List<IViolation> |
getViolations()
Gets the
IViolation of the Node . |
long |
getVisitDurationMillis(ILogicEntityRoute ownerRoute)
Gets the defined visit duration of a job at a
Node in seconds. |
boolean |
hasFullJobLevelRelations()
Checks if all the data of the
Node should be saved in a
ILogicRouteElementDetailItem . |
boolean |
hasRelations()
Checks if the
Node has any Relations . |
boolean |
hasRouteDependentVisitDuration()
Checks for route dependent visit duration.
|
boolean |
isAllowMoveToReduceFlexTime() |
boolean |
isAutoFilterProtected()
Checks if the
Node is protected from being filtered. |
boolean |
isCausingIdleTimeCost()
Checks if the
Node can cause idle time . |
boolean |
isDutyHoursIncludesVisitDuration()
Checks whether the job at the
Node has to be done within the
IOpeningHours or if the
IResource only has to arrive and
start the job within that time. |
boolean |
isOfferedNode()
Checks if the
Node is a offered Node which has its own
AbstractNode.individualOfferedNodeMultiplier . |
boolean |
isOptimizable()
Checks
isOptimizable , the default value is true . |
boolean |
isOptional()
Checks if it is an
optional Node one of which the Resource
may visit in order to further be able to do its job (for example a waste dump
or a packet station.The default value is false . |
boolean |
isPillarNode()
Checks if the node is a
isPillarNode . |
boolean |
isReturnStart() |
boolean |
isStayNode()
Checks if the
Node can be used as for an overnight stay . |
boolean |
isUnassigned()
Checks if the node was unassigned by the
INodeUnassigner . |
boolean |
isUnloadAll()
Checks if it is possible for the
Resource to unload all its
Capacity at this Node . |
boolean |
isUseJointVisitDuration()
Checks if there are beneficial effects of a reduced
visitDuration
since several Nodes are close to one another. |
boolean |
isWaitOnEarlyArrival()
Checks if the
Resource , if arriving early, has to wait until the
start of the IOpeningHours before
being able to work. |
boolean |
isWaitOnEarlyArrivalFirstNode() |
boolean |
isWorkNode()
Deprecated.
Checks if is a
Node is a work Node which is the
default where a Resource has a job to do. This method is
needed because it is possible to define a Node as a
setIsStayNode(boolean) but not as a work Node . |
boolean |
removeConstraint(IConstraint removeConstraint)
Removes the
IConstraint from this Node . |
boolean |
removeNode2NodeRelations(INode2NodeRelation removeRelation)
Removes a
INode2NodeRelation from the Node |
void |
resetDutyHoursTempActivation() |
void |
resetLockdownTime() |
void |
resetSubsequentSlaveNodes() |
void |
setAllowMoveToReduceFlexTime(boolean allowMoveToReduceFlexTime) |
void |
setAutoFilterConstraints(List<IAutoFilterNodeConstraint> autoFilterNodeConstraints)
Sets a
IConstraint at a Node for which it could be filtered. |
void |
setConstraints(List<IConstraint> constraints)
Sets the
ArrayList constraints which limit the Resources that
can serve this * Node to those that have the specific
Qualification to do so. |
void |
setFirstNodeInRouteImportance(int importance) |
void |
setFixCost(double fixCost)
Sets the
fixCost for visiting the Node . |
void |
setHasRouteDependentVisitDuration(boolean hasRouteDependentVisitDuration)
Sets the checks for route dependent visit duration.
|
void |
setImportance(int priority)
Sets the
priority/importance . |
void |
setIndividualOfferedNodeMultiplier(double individualOfferedNodeMultiplier)
Sets the
multiplier of the cost for this specific Node . |
void |
setIsCausingIdleTimeCost(boolean isCausingIdleTimeCost)
Sets
isCausingIdleTimeCost , the default value is true . |
void |
setIsDutyHoursIncludesVisitDuration(boolean isDutyHoursIncludeVisitDuration)
Sets
isDutyHoursIncludesVisitDuration , if set to false, the
DutyHours act as an access window in which the work has to be
started. |
void |
setIsOfferedNode(boolean isOfferedNode)
Sets as a
offered Node . |
void |
setIsOptional(boolean isOptional)
Sets the
Node as an optional Node . |
boolean |
setIsReturnStart(Duration stayAtStartDuration) |
void |
setIsStayNode(boolean canBeResourceStay)
Sets
Node as a possible overnight stay Node . |
void |
setIsWorkNode(boolean isWorkNode)
Deprecated.
Sets the
Node as a work Node which is the default
where a Resource has a job to do. This method is needed because it is possible
to define a Node as a setIsStayNode(boolean) but not as a
work Node |
void |
setJointVisitDuration(Duration visitDuration)
If two or more
Nodes are close to one another, the
visitDuration of the Nodes after the first one can be reduced since for example less loading and
unloading time is needed . |
void |
setLastNodeInRouteImportance(int importance) |
void |
setLoad(double[] load)
Sets the amount of goods the
Resource is getting added by visiting
the Resource . |
void |
setLockdownTime(long lockdowntime) |
void |
setMinAutoFilterProtectedExecutions(int numProtectedExecutions)
Sets a number of
iterations of the Optimizer in which the
Node is protected from being filtered by the
IAutoNodeFilter . |
void |
setMinimalVisitDuration(Duration minimalVisitDuration) |
void |
setNodeColor(INodeColor color)
|
void |
setNodeDepot(INodeDepot depot) |
void |
setOptimizable(boolean isOptimizable)
Sets if the
Node can still be moved around or if it is on
lockdown and is fixed. |
void |
setOptimizable(boolean isOptimizable,
boolean forceKeepLockdownTime) |
void |
setUnassigned(boolean unassigned)
Sets the
Node to be unassigned , meaning not part of any
Route . |
void |
setUnloadAll(boolean unloadAll)
Allows the
Resource to unload all its Capacity at this
Node |
void |
setUnloadAllDimension(int unloadAllDimension,
int totalLoadDimension)
Allows a
Resource to unload all its Capacity of a specific
good (dimension ) at this Node . |
void |
setVisitDuration(int visitDuration)
Deprecated.
|
void |
setVisitDurationMillis(long visitDurationMillis)
Sets the visit duration millis.
|
void |
setWaitOnEarlyArrival(boolean waitOnEarlyArrival)
Sets whether a
Resource has to wait when arriving before the
IOpeningHours of the Node . |
void |
setWaitOnEarlyArrivalFirstNode(boolean waitOnEarlyArrival) |
void |
tempIncreaseImplausibleScore() |
void |
tempSetActiveDutyHours(Set<Integer> tempActivateIndicesSet) |
forceSetId, getDistMatrixId, getDutyHours, getExtraInfo, getFlavour, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, hasRealGeoLocation, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
long getVisitDurationMillis(ILogicEntityRoute ownerRoute)
Node
in seconds.ownerRoute
- the owner routeboolean hasRouteDependentVisitDuration()
void setHasRouteDependentVisitDuration(boolean hasRouteDependentVisitDuration)
hasRouteDependentVisitDuration
- the new checks for route dependent
visit durationlong getBaseVisitDurationMillis()
int getBaseVisitDuration()
void setVisitDuration(int visitDuration)
Node
in seconds.visitDuration
- the int new visit duration seconds.void setVisitDurationMillis(long visitDurationMillis)
visitDurationMillis
- the new visit duration millisvoid setMinimalVisitDuration(Duration minimalVisitDuration)
long getMinVisitDurationMillis()
void setUnassigned(boolean unassigned)
Node
to be unassigned
, meaning not part of any
Route
. The default value is false
.
This method es bing used internally.
unassigned
- the boolean for the new unassignedboolean isUnassigned()
INodeUnassigner
. An
unassigned Node
is not part of any Route
void addViolation(IViolation violation)
IViolation
to Node
. This method is used internally.violation
- the violationList<IViolation> getViolations()
IViolation
of the Node
. Only has a non-empty list in
case a result was requested.List<IViolation> violations
void setFixCost(double fixCost)
fixCost
for visiting the Node
. The default
value of the
double
is 0.fixCost
- the double fixCostdouble getFixCost()
fixCost
. The default value of the double
is 0.boolean isStayNode()
Node
can be used as for an overnight stay
. The
default value is false
.
This allows the Resource
to stay at this Node
at the end of
the Route
instead of returning home and proceeding from there the next day. The
Resource also needs IWorkingHours.getIsAvailableForStay()
to be set
to true
in order to be able to stay there at the end of the
Route
.
void setIsStayNode(boolean canBeResourceStay)
Node
as a possible overnight stay Node
.
This allows the Resource
to stay at this Node
at the end of
the Route
instead of returning home and proceeding from there the next day. The
Resource also needs IWorkingHours.getIsAvailableForStay()
to be set
to true
in order to be able to stay there at the end of the
Route
.
canBeResourceStay
- if the boolean is set to true
the
Node
can be used for
overnight stays
@Deprecated boolean isWorkNode()
Node
is a work Node
which is the
default where a Resource
has a job to do. This method is
needed because it is possible to define a Node
as a
setIsStayNode(boolean)
but not as a work Node
.@Deprecated void setIsWorkNode(boolean isWorkNode)
Node
as a work Node
which is the default
where a Resource
has a job to do. This method is needed because it is possible
to define a Node
as a setIsStayNode(boolean)
but not as a
work Node
isWorkNode
- the boolean for the workNode
boolean isOfferedNode()
Node
is a offered Node
which has its own
AbstractNode.individualOfferedNodeMultiplier
. An offered Node
usually has a higher priority to be integrated into a Route
which is
done by multiplying the cost for this specific Node
when being
missed.isOfferedNode
void setIsOfferedNode(boolean isOfferedNode)
offered Node
. The default value is false
. When
a node is marked as offered node more costs can arise when violating any of
the constraints of the node. An offered Node
usually has a higher
priority to be integrated into a Route
which is done by multiplying
the cost for this specific Node
when being missed.isOfferedNode
- the boolean to be setsetIndividualOfferedNodeMultiplier(double)
double getIndividualOfferedNodeMultiplier()
multiplier
for this specific Node
. individualOfferedNodeMultiplier
void setIndividualOfferedNodeMultiplier(double individualOfferedNodeMultiplier)
multiplier
of the cost for this specific Node
.
The default value is 1. When using a higher value the default costs arising
from not fulfilling any constraints of the node are multiplied by this
factor, therefore giving the Node
a higher priority to be given
service on time.individualOfferedNodeMultiplier
- the double to be setvoid setImportance(int priority)
priority/importance
. The default value is 1.priority
- the int priority to be set.int getImportance()
priority
.priority
boolean isWaitOnEarlyArrival()
Resource
, if arriving early, has to wait until the
start of the IOpeningHours
before
being able to work. The default value is true
, in which case
arriving too early means idle time
.waitOnEarlyArrival
void setWaitOnEarlyArrival(boolean waitOnEarlyArrival)
Resource
has to wait when arriving before the
IOpeningHours
of the Node
. The default value is
true
.
When wait on early arrival is set to false, a visiting resource will start
working right away. In contrast, if WaitOnEarlyArrival
is set to
true
, a Resource
will idle until a Node
opens based on its defined
IWorkingHours
.
waitOnEarlyArrival
- the boolean to be setboolean isPillarNode()
isPillarNode
. PillarNodes
will
only be served if the Resource
arrives on time. If the
Resource
is arriving too late the PillarNode
will be skipped.isPillarNode
void addNode2NodeRelation(INode2NodeRelation relation)
Nodes
in a Relation
. A MasterNode
has to be
served before a RelatedNode
.
For further explanation and implementation examples please see
INode2NodeRelation
.
relation
- the INode2NodeRelation
to be addedList<INode2NodeRelation> getNode2NodeRelations()
Relations
of the Node
.
For further explanation and implementation examples please see
INode2NodeRelation
.
List<INode2NodeRelation> node2NodeRelation
boolean hasFullJobLevelRelations()
Node
should be saved in a
ILogicRouteElementDetailItem
.
The default value is false
.
The only other instance when this data is saved is when a ILogicRouteElementDetailItem
is requested.
boolean hasFullJobLevelRelations
boolean hasRelations()
Node
has any Relations
.
For further explanation and implementation examples of Relations
please see INode2NodeRelation
hasRelations
void addConstraint(IConstraint constraint)
constraint
which limits the Resources
that can serve
this Node
to those that have the specific Qualification
to do
so.
For further explanations and implementation examples please see
TypeConstraint
and
TypeQualification
.
constraint
- the Iconstraint
to be addedList<IConstraint> getConstraints()
Constraints
which limit the Resources
that can serve
this Node
to those that have the specific Qualification
to do
so.
For further explanations and implementation examples please see
TypeConstraint
and
TypeQualification
.
List<IConstraint> constraints
void setConstraints(List<IConstraint> constraints)
ArrayList constraints
which limit the Resources
that
can serve this * Node
to those that have the specific
Qualification
to do so. Cannot be null
.
For further explanations and implementation examples please see
TypeConstraint
and
TypeQualification
constraints
- the Arraylist constraints
to be setvoid setLoad(double[] load)
Resource
is getting added by visiting
the Resource
. Can be negative (delivering packages).load
- the double arrayIResource.addCapacity(double)
double[] getLoad()
Resource
is getting added by visiting
the Resource
. Can be negative (delivering packages).IResource.addCapacity(double)
void setUnloadAll(boolean unloadAll)
Resource
to unload all its Capacity
at this
Node
unloadAll
- the boolean to be setIResource.addCapacity(double)
boolean isUnloadAll()
Resource
to unload all its
Capacity
at this Node
.void setUnloadAllDimension(int unloadAllDimension, int totalLoadDimension)
Resource
to unload all its Capacity
of a specific
good (dimension
) at this Node
.unloadAllDimension
- the int unloadAllDimensiontotalLoadDimension
- the int totalLoadDimensionint getUnloadAllDimension()
Resource
to unload all its
Capacity
of a specific good (dimension
) at this Node
.int getTotalLoadDimension()
IAutoFilterViolationAndConstrainCollector getAutoFilterViolationCollector()
AbstractNode.myAutoFilterViolationCollector
that collected
all IViolation
.void setAutoFilterConstraints(List<IAutoFilterNodeConstraint> autoFilterNodeConstraints)
IConstraint
at a Node
for which it could be filtered.autoFilterNodeConstraints
- the
AutoFilterViolationAndConstraintCollector to
be setboolean removeConstraint(IConstraint removeConstraint)
IConstraint
from this Node
.removeConstraint
- the constraint to be removedList<IConstraint>
constraints that were removedboolean removeNode2NodeRelations(INode2NodeRelation removeRelation)
INode2NodeRelation
from the Node
removeRelation
- the INode2NodeRelation that will be removedvoid setOptimizable(boolean isOptimizable)
Node
can still be moved around or if it is on
lockdown
and is fixed.isOptimizable
- the boolean isOptimizable to be setboolean isOptimizable()
isOptimizable
, the default value is true
.boolean isDutyHoursIncludesVisitDuration()
Node
has to be done within the
IOpeningHours
or if the
IResource
only has to arrive and
start the job within that time.setIsDutyHoursIncludesVisitDuration(boolean)
void setIsDutyHoursIncludesVisitDuration(boolean isDutyHoursIncludeVisitDuration)
isDutyHoursIncludesVisitDuration
, if set to false, the
DutyHours
act as an access window in which the work has to be
started. If set to true
the work has to be finished within the
DutyHours
.isDutyHoursIncludeVisitDuration
- the boolean if the work has to be done
within the Dutyhoursvoid setJointVisitDuration(Duration visitDuration)
Nodes
are close to one another, the
visitDuration
of the Nodes
after the first one can be reduced since for example less loading and
unloading time is needed . Sets the reduced visitDuration
for these
Nodes
instead of the normal visit duration.visitDuration
- the duration of the reduced visitint getJointVisitDuration(ILogicEntityRoute ownerRoute)
visitDuration
of a Node
caused by efficiency effects since several
Nodes
close to one another.ownerRoute
- the owner routelong getJointVisitDurationMillis(ILogicEntityRoute ownerRoute)
AbstractNode.getJointVisitDurationMillis(com.dna.jopt.member.bucket.route.ILogicEntityRoute)
, which is the reduced
visitDuration
of a Node
caused by efficiency effects since several
Nodes
close to one another.ownerRoute
- the owner routeboolean isUseJointVisitDuration()
visitDuration
since several Nodes
are close to one another. The default value is false
.
Will be set to true
by setJointVisitDuration(Duration)
.
visitDuration
is reducedvoid setIsCausingIdleTimeCost(boolean isCausingIdleTimeCost)
isCausingIdleTimeCost
, the default value is true
. When
isWaitOnEarlyArrival()
is true, a resource can generate idle time at
a node. However, in a partially loaded optimization (so the amount of
available working time of the resources is much higher than the required
working time at the nodes) with tight
IOpeningHours
of the nodes, a lot of
idle time can arise, as resources have to wait till nodes are opening and
have nothing else to do. This can lead to bad optimization results, as the
optimizer tries to avoid idle time and whitespace.
By setting isCausingIdleTimeCost
to false, idle time at this
node does not generate cost.
isCausingIdleTimeCost
- the boolean to be setboolean isCausingIdleTimeCost()
Node
can cause idle time
. If set to
false
the Node
still causes idle time
but at no cost. The default value is
true
.isCausingIdleTimeCost
void setIsOptional(boolean isOptional)
Node
as an optional Node
. The Resource
can
go to one of many optional Nodes
to do a task (for example dump
waste, get new packets to deliver) but does not have to go to a specific
optional Node
.isOptional
- the boolean to set the Node as an optional Nodeboolean isOptional()
optional Node
one of which the Resource
may visit in order to further be able to do its job (for example a waste dump
or a packet station.The default value is false
.void setNodeColor(INodeColor color)
INodeColor
to the Node
by adding a
NodeColorCapacityItem
. By using
IWorkingHours.addNodeColorCapacity(NodeColorCapacityItem)
it limits
the amount of Color
coded Nodes
a Resource
can give service to. This way
can be made sure that Nodes
with a certain Color
are not
overrepresented and can be used for white space generation. The default value
is NodeColors.DEFAULT
.color
- the iNodeColor
INodeColor getNodeColor()
iNodeColor
boolean isAutoFilterProtected()
Node
is protected from being filtered.true
if the condition allowsvoid setMinAutoFilterProtectedExecutions(int numProtectedExecutions)
iterations
of the Optimizer
in which the
Node
is protected from being filtered by the
IAutoNodeFilter
.numProtectedExecutions
- the int valueint decrementCurrentAutoFilterProtectedExecutions()
iterations
the Node
is still protected from
being autofiltered.int getCurrentLeftAutoFilterProtectedExecutions()
AbstractNode.numCurrentProtectedExecutions
, the default
value is 0
.void detachResourceConstraints()
IConstraint
. This method is used internally.void detachResourceConstraints(String resId)
IResource
with the given resId
from the
IConstraint
that are IConstraintResource
. This method is used
internally.resId
- the string Resource /Dvoid addQualification(IQualification qualification)
IQualification
to the Resource
, which means that by
adding a IConstraint
to the INode
, they are limited to which
Nodes
they can give service.
Used in
UKPostCodeConstraint
.
qualification
- the iQualification that is to be addedMap<Class<? extends IQualification>,IQualification> getQualifications()
IQualification
of the Resource
.addQualification(IQualification)
void addSubsequentSlaveNode(INode node)
node
- the subsequent slave nodevoid addSubsequentSlaveNodes(List<INode> nodes)
nodes
- the subsequent slave nodesvoid resetSubsequentSlaveNodes()
List<IDutyHours> getOriginalDutyHours()
void resetDutyHoursTempActivation()
void setNodeDepot(INodeDepot depot)
Optional<INodeDepot> getNodeDepot()
void detachNodeRelations()
void setWaitOnEarlyArrivalFirstNode(boolean waitOnEarlyArrival)
boolean isWaitOnEarlyArrivalFirstNode()
void setFirstNodeInRouteImportance(int importance)
int getFirstNodeInRouteImportance()
void setLastNodeInRouteImportance(int importance)
int getLastNodeInRouteImportance()
void setLockdownTime(long lockdowntime)
@Deprecated int getBaseJointVisitDuration()
long getBaseJointVisitDurationMillis()
void setOptimizable(boolean isOptimizable, boolean forceKeepLockdownTime)
boolean isReturnStart()
boolean setIsReturnStart(Duration stayAtStartDuration)
Duration getStayAtStartDuration()
void resetLockdownTime()
void tempIncreaseImplausibleScore()
int getTempImplausibleScore()
void setAllowMoveToReduceFlexTime(boolean allowMoveToReduceFlexTime)
boolean isAllowMoveToReduceFlexTime()
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.