Package com.dna.jopt.member.unit
Interface IOptimizationElement
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
IBasicResource,INode,IPillarEventNode,IPillarExtendableNode,IPillarNode,IPillarTimeWindowGeoNode,IResource
- All Known Implementing Classes:
AbstractBasicCapacityResource,AbstractNode,AbstractOptimizationElement,CapacityResource,EventNode,InducedIdleEventNode,PillarEventNode,PillarExtenbdableEventNode,PillarTimeWindowGeoNode,TimeWindowGeoNode
The
IOptimizationElement is the super class of INode and IResource.
Each one can be given a specific ID, the IDutyHours can be set, as well as the
NodeConnection can be set or the longitude and latitude retrieved.- Since:
- 02/08/2019
- Version:
- 19/09/2019
- Author:
- DNA
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe OptimizationElementFlavour. -
Method Summary
Modifier and TypeMethodDescriptionvoidforceSetId(String id) Force set a new Id after construction of the element if absolutely necessary.Gets the constraint alias id.intDeprecated.Gets theIDutyHoursof theelement.Gets the extra info.Gets the flavour which spells out the kind ofNodeof the element.getId()Gets the unique id.doubleGets the latitude of theelement.Gets the location id.doubleGets the longitude of theelement.getNodeConnection(IOptimizationElement toElement) Gets the node connection from this element to another element.Gets the node connection key set.Gets the list ofnode connectionsseen by thiselement.com.dna.jopt.config.types.PositionbooleanReturnstrueif the item has a real geo location.voidputNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.voidputNodeConnectionFromElement(INodeConnectorItem conncetorItem) Put a newnode connectionfrom thiselementto anotherelement.voidremoveNodeConnection(IOptimizationElement toElement) Removes anode connection.voidsetConstraintAliasId(String ignorablePostFixId) Sets the constraint alias id.voidsetDistMatrixId(int matrixId) Deprecated.voidsetDutyHours(List<? extends IDutyHours> dutyHours) Sets theduty hours.voidsetExtraInfo(String extraInfo) Sets a custom extra info.voidSets the unique id.voidsetLatitude(double latitude) Sets the latitude of theelement.voidsetLocationId(String locationId) Sets the location id.voidsetLongitude(double longitude) Sets the longitude of theelement.voidsetPosition(com.dna.jopt.config.types.Position position)
-
Method Details
-
getFlavour
IOptimizationElement.OptimizationElementFlavour getFlavour()Gets the flavour which spells out the kind ofNodeof the element.- Returns:
- the flavour
-
getId
String getId()Gets the unique id.- Returns:
- the id
-
setId
Sets the unique id. By default this value is provided on construction.- Parameters:
id- the new id
-
forceSetId
Force set a new Id after construction of the element if absolutely necessary. Usually the id should be set on construction.- Parameters:
id- the id
-
hasRealGeoLocation
boolean hasRealGeoLocation()Returnstrueif the item has a real geo location. For example, anEventNodehas no real geo location.- Returns:
- true, if real geo location exists
-
setLatitude
void setLatitude(double latitude) Sets the latitude of theelement.- Parameters:
latitude- the new latitude
-
getLatitude
double getLatitude()Gets the latitude of theelement.- Returns:
- the latitude
-
setLongitude
void setLongitude(double longitude) Sets the longitude of theelement.- Parameters:
longitude- the new longitude
-
getLongitude
double getLongitude()Gets the longitude of theelement.- Returns:
- the longitude
-
getDutyHours
List<IDutyHours> getDutyHours()Gets theIDutyHoursof theelement.- Returns:
- the duty hours
-
getNodeConnection
Gets the node connection from this element to another element. During the optimization connections gathered from theINodeEdgeConnectorare saved also in the element. This speeds up the optimization as frequently seen connections can be directly extracted from the element instead of invoking a table lookup in the INodeEdgeConnector.- Parameters:
toElement- the end element of the connection- Returns:
- the node connection or null if not present
-
getNodeConnections
List<INodeConnectorItem> getNodeConnections()Gets the list ofnode connectionsseen by thiselement.- Returns:
- the node connections
-
putNodeConnectionFromElement
Put a newnode connectionfrom thiselementto anotherelement.- Parameters:
conncetorItem- the new found INodeConnectorItem
-
putNodeConnection
@Deprecated void putNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.Deprecated method.Put node connection.
- Parameters:
toElement- the to elementconncetorItem- the conncetor item
-
setDistMatrixId
Deprecated.Sets the dist matrix id.- Parameters:
matrixId- the new dist matrix id- Category:
- Legacy Sets the dist matrix id.
-
getDistMatrixId
Deprecated.Gets the dist matrix id.- Returns:
- the dist matrix id
- Category:
- Legacy
Gets the dist matrix id.
-
removeNodeConnection
Removes anode connection. This method is most often used to clean upconnectionswhich are not in use any longer.- Parameters:
toElement- the to element
-
getNodeConnectionKeySet
Set<IOptimizationElement> getNodeConnectionKeySet()Gets the node connection key set.- Returns:
- the node connection key set
-
setDutyHours
Sets theduty hours.Attention: Make sure that each Resource/Node has its own independent list of WorkingHours/OpeningHours (WorkingHours and OpeningHours are both derived from DutyHours). Further, make sure that each WorkingHour Object/ OpeningHours Object is also unique and is not shared in the List of another Resource/Node.
- Parameters:
dutyHours- the new duty hours
-
getPreferredHoursInteractionController
IPreferredHoursInteractionController getPreferredHoursInteractionController() -
setPosition
void setPosition(com.dna.jopt.config.types.Position position) -
getPosition
com.dna.jopt.config.types.Position getPosition() -
setLocationId
Sets the location id. A location id does not need to be unique. Moreover, the more elements can share the same locations id the better, as less connections need to be created. For elements the same location id, means they have the same geographical position.- Parameters:
locationId- the new location id
-
getLocationId
String getLocationId()Gets the location id. In case no location id was defined, the mandatory unique id is used as location id.- Returns:
- the location id
-
setExtraInfo
Sets a custom extra info. For example, use JSON to encode your custom data.- Parameters:
extraInfo- the new extra info
-
getExtraInfo
Gets the extra info.- Returns:
- the extra info
-
setConstraintAliasId
Sets the constraint alias id. For example, a constraint requires the resource Jane. However, Jane is split into multiple resources. Let's assume, those ids are Jane_Morning, Jane_Noon and so on. Now, we can simply set the constraintAliasId for all resources to be "Jane". The constraint, now treats all the resources the same.- Parameters:
ignorablePostFixId- the new constraint alias id
-
getConstraintAliasId
Gets the constraint alias id.- Returns:
- the constraint alias id
-
putNodeConnectionFromElement(INodeConnectorItem)