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
Modifier and TypeInterfaceDescriptionstatic enum
The OptimizationElementFlavour. -
Method Summary
Modifier and TypeMethodDescriptionvoid
forceSetId
(String id) Force set a new Id after construction of the element if absolutely necessary.Gets the constraint alias id.int
Deprecated.Gets theIDutyHours
of theelement
.Gets the extra info.Gets the flavour which spells out the kind ofNode
of the element.getId()
Gets the unique id.double
Gets the latitude of theelement
.Gets the location id.double
Gets 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 connections
seen by thiselement
.com.dna.jopt.config.types.Position
boolean
Returnstrue
if the item has a real geo location.void
putNodeConnection
(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.void
putNodeConnectionFromElement
(INodeConnectorItem conncetorItem) Put a newnode connection
from thiselement
to anotherelement
.void
removeNodeConnection
(IOptimizationElement toElement) Removes anode connection
.void
setConstraintAliasId
(String ignorablePostFixId) Sets the constraint alias id.void
setDistMatrixId
(int matrixId) Deprecated.void
setDutyHours
(List<? extends IDutyHours> dutyHours) Sets theduty hours
.void
setExtraInfo
(String extraInfo) Sets a custom extra info.void
Sets the unique id.void
setLatitude
(double latitude) Sets the latitude of theelement
.void
setLocationId
(String locationId) Sets the location id.void
setLongitude
(double longitude) Sets the longitude of theelement
.void
setPosition
(com.dna.jopt.config.types.Position position)
-
Method Details
-
getFlavour
IOptimizationElement.OptimizationElementFlavour getFlavour()Gets the flavour which spells out the kind ofNode
of 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()Returnstrue
if the item has a real geo location. For example, anEventNode
has 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 theIDutyHours
of theelement
.- Returns:
- the duty hours
-
getNodeConnection
Gets the node connection from this element to another element. During the optimization connections gathered from theINodeEdgeConnector
are 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 connections
seen by thiselement
.- Returns:
- the node connections
-
putNodeConnectionFromElement
Put a newnode connection
from thiselement
to 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 upconnections
which 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)