Package com.dna.jopt.member.unit
Class AbstractOptimizationElement
java.lang.Object
com.dna.jopt.member.unit.AbstractOptimizationElement
- All Implemented Interfaces:
IOptimizationElement
,Serializable
- Direct Known Subclasses:
AbstractBasicCapacityResource
,AbstractNode
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.dna.jopt.member.unit.IOptimizationElement
IOptimizationElement.OptimizationElementFlavour
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
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.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
int
hashCode()
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 constraintAliasId) 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) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.dna.jopt.member.unit.IOptimizationElement
getFlavour, hasRealGeoLocation
-
Field Details
-
dutyHours
-
-
Constructor Details
-
AbstractOptimizationElement
protected AbstractOptimizationElement()
-
-
Method Details
-
getId
Description copied from interface:IOptimizationElement
Gets the unique id.- Specified by:
getId
in interfaceIOptimizationElement
- Returns:
- the id
-
setId
Description copied from interface:IOptimizationElement
Sets the unique id. By default this value is provided on construction.- Specified by:
setId
in interfaceIOptimizationElement
- Parameters:
id
- the new id
-
forceSetId
Description copied from interface:IOptimizationElement
Force set a new Id after construction of the element if absolutely necessary. Usually the id should be set on construction.- Specified by:
forceSetId
in interfaceIOptimizationElement
- Parameters:
id
- the id
-
setLocationId
Description copied from interface:IOptimizationElement
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.- Specified by:
setLocationId
in interfaceIOptimizationElement
- Parameters:
locationId
- the new location id
-
getConstraintAliasId
Description copied from interface:IOptimizationElement
Gets the constraint alias id.- Specified by:
getConstraintAliasId
in interfaceIOptimizationElement
- Returns:
- the constraint alias id
-
setConstraintAliasId
Description copied from interface:IOptimizationElement
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.- Specified by:
setConstraintAliasId
in interfaceIOptimizationElement
- Parameters:
constraintAliasId
- the new constraint alias id
-
setExtraInfo
Description copied from interface:IOptimizationElement
Sets a custom extra info. For example, use JSON to encode your custom data.- Specified by:
setExtraInfo
in interfaceIOptimizationElement
- Parameters:
extraInfo
- the new extra info
-
getExtraInfo
Description copied from interface:IOptimizationElement
Gets the extra info.- Specified by:
getExtraInfo
in interfaceIOptimizationElement
- Returns:
- the extra info
-
getLocationId
Description copied from interface:IOptimizationElement
Gets the location id. In case no location id was defined, the mandatory unique id is used as location id.- Specified by:
getLocationId
in interfaceIOptimizationElement
- Returns:
- the location id
-
setPosition
public void setPosition(com.dna.jopt.config.types.Position position) - Specified by:
setPosition
in interfaceIOptimizationElement
-
getPosition
public com.dna.jopt.config.types.Position getPosition()- Specified by:
getPosition
in interfaceIOptimizationElement
-
setLatitude
public void setLatitude(double latitude) Description copied from interface:IOptimizationElement
Sets the latitude of theelement
.- Specified by:
setLatitude
in interfaceIOptimizationElement
- Parameters:
latitude
- the new latitude
-
getLatitude
public double getLatitude()Description copied from interface:IOptimizationElement
Gets the latitude of theelement
.- Specified by:
getLatitude
in interfaceIOptimizationElement
- Returns:
- the latitude
-
setLongitude
public void setLongitude(double longitude) Description copied from interface:IOptimizationElement
Sets the longitude of theelement
.- Specified by:
setLongitude
in interfaceIOptimizationElement
- Parameters:
longitude
- the new longitude
-
getLongitude
public double getLongitude()Description copied from interface:IOptimizationElement
Gets the longitude of theelement
.- Specified by:
getLongitude
in interfaceIOptimizationElement
- Returns:
- the longitude
-
setDutyHours
Description copied from interface:IOptimizationElement
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.
- Specified by:
setDutyHours
in interfaceIOptimizationElement
- Parameters:
dutyHours
- the new duty hours
-
getPreferredHoursInteractionController
- Specified by:
getPreferredHoursInteractionController
in interfaceIOptimizationElement
-
getDutyHours
Description copied from interface:IOptimizationElement
Gets theIDutyHours
of theelement
.- Specified by:
getDutyHours
in interfaceIOptimizationElement
- Returns:
- the duty hours
-
toString
-
hashCode
public int hashCode() -
equals
-
getNodeConnection
Description copied from interface:IOptimizationElement
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.- Specified by:
getNodeConnection
in interfaceIOptimizationElement
- Parameters:
toElement
- the end element of the connection- Returns:
- the node connection or null if not present
-
getNodeConnections
Description copied from interface:IOptimizationElement
Gets the list ofnode connections
seen by thiselement
.- Specified by:
getNodeConnections
in interfaceIOptimizationElement
- Returns:
- the node connections
-
putNodeConnectionFromElement
Description copied from interface:IOptimizationElement
Put a newnode connection
from thiselement
to anotherelement
.- Specified by:
putNodeConnectionFromElement
in interfaceIOptimizationElement
- Parameters:
conncetorItem
- the new found INodeConnectorItem
-
putNodeConnection
@Deprecated public void putNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.Description copied from interface:IOptimizationElement
Deprecated method.Put node connection.
- Specified by:
putNodeConnection
in interfaceIOptimizationElement
- Parameters:
toElement
- the to elementconncetorItem
- the conncetor item
-
removeNodeConnection
Description copied from interface:IOptimizationElement
Removes anode connection
. This method is most often used to clean upconnections
which are not in use any longer.- Specified by:
removeNodeConnection
in interfaceIOptimizationElement
- Parameters:
toElement
- the to element
-
getNodeConnectionKeySet
Description copied from interface:IOptimizationElement
Gets the node connection key set.- Specified by:
getNodeConnectionKeySet
in interfaceIOptimizationElement
- Returns:
- the node connection key set
-
setDistMatrixId
Deprecated.Description copied from interface:IOptimizationElement
Sets the dist matrix id.- Specified by:
setDistMatrixId
in interfaceIOptimizationElement
- Parameters:
matrixId
- the new dist matrix id
-
getDistMatrixId
Deprecated.Description copied from interface:IOptimizationElement
Gets the dist matrix id.- Specified by:
getDistMatrixId
in interfaceIOptimizationElement
- Returns:
- the dist matrix id
-