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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidforceSetId(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.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.PositioninthashCode()voidputNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.voidputNodeConnectionFromElement(INodeConnectorItem conncetorItem) Put a newnode connectionfrom thiselementto anotherelement.voidremoveNodeConnection(IOptimizationElement toElement) Removes anode connection.voidsetConstraintAliasId(String constraintAliasId) 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) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:IOptimizationElementGets the unique id.- Specified by:
getIdin interfaceIOptimizationElement- Returns:
- the id
-
setId
Description copied from interface:IOptimizationElementSets the unique id. By default this value is provided on construction.- Specified by:
setIdin interfaceIOptimizationElement- Parameters:
id- the new id
-
forceSetId
Description copied from interface:IOptimizationElementForce set a new Id after construction of the element if absolutely necessary. Usually the id should be set on construction.- Specified by:
forceSetIdin interfaceIOptimizationElement- Parameters:
id- the id
-
setLocationId
Description copied from interface:IOptimizationElementSets 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:
setLocationIdin interfaceIOptimizationElement- Parameters:
locationId- the new location id
-
getConstraintAliasId
Description copied from interface:IOptimizationElementGets the constraint alias id.- Specified by:
getConstraintAliasIdin interfaceIOptimizationElement- Returns:
- the constraint alias id
-
setConstraintAliasId
Description copied from interface:IOptimizationElementSets 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:
setConstraintAliasIdin interfaceIOptimizationElement- Parameters:
constraintAliasId- the new constraint alias id
-
setExtraInfo
Description copied from interface:IOptimizationElementSets a custom extra info. For example, use JSON to encode your custom data.- Specified by:
setExtraInfoin interfaceIOptimizationElement- Parameters:
extraInfo- the new extra info
-
getExtraInfo
Description copied from interface:IOptimizationElementGets the extra info.- Specified by:
getExtraInfoin interfaceIOptimizationElement- Returns:
- the extra info
-
getLocationId
Description copied from interface:IOptimizationElementGets the location id. In case no location id was defined, the mandatory unique id is used as location id.- Specified by:
getLocationIdin interfaceIOptimizationElement- Returns:
- the location id
-
setPosition
public void setPosition(com.dna.jopt.config.types.Position position) - Specified by:
setPositionin interfaceIOptimizationElement
-
getPosition
public com.dna.jopt.config.types.Position getPosition()- Specified by:
getPositionin interfaceIOptimizationElement
-
setLatitude
public void setLatitude(double latitude) Description copied from interface:IOptimizationElementSets the latitude of theelement.- Specified by:
setLatitudein interfaceIOptimizationElement- Parameters:
latitude- the new latitude
-
getLatitude
public double getLatitude()Description copied from interface:IOptimizationElementGets the latitude of theelement.- Specified by:
getLatitudein interfaceIOptimizationElement- Returns:
- the latitude
-
setLongitude
public void setLongitude(double longitude) Description copied from interface:IOptimizationElementSets the longitude of theelement.- Specified by:
setLongitudein interfaceIOptimizationElement- Parameters:
longitude- the new longitude
-
getLongitude
public double getLongitude()Description copied from interface:IOptimizationElementGets the longitude of theelement.- Specified by:
getLongitudein interfaceIOptimizationElement- Returns:
- the longitude
-
setDutyHours
Description copied from interface:IOptimizationElementSets 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:
setDutyHoursin interfaceIOptimizationElement- Parameters:
dutyHours- the new duty hours
-
getPreferredHoursInteractionController
- Specified by:
getPreferredHoursInteractionControllerin interfaceIOptimizationElement
-
getDutyHours
Description copied from interface:IOptimizationElementGets theIDutyHoursof theelement.- Specified by:
getDutyHoursin interfaceIOptimizationElement- Returns:
- the duty hours
-
toString
-
hashCode
public int hashCode() -
equals
-
getNodeConnection
Description copied from interface:IOptimizationElementGets 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.- Specified by:
getNodeConnectionin interfaceIOptimizationElement- Parameters:
toElement- the end element of the connection- Returns:
- the node connection or null if not present
-
getNodeConnections
Description copied from interface:IOptimizationElementGets the list ofnode connectionsseen by thiselement.- Specified by:
getNodeConnectionsin interfaceIOptimizationElement- Returns:
- the node connections
-
putNodeConnectionFromElement
Description copied from interface:IOptimizationElementPut a newnode connectionfrom thiselementto anotherelement.- Specified by:
putNodeConnectionFromElementin interfaceIOptimizationElement- Parameters:
conncetorItem- the new found INodeConnectorItem
-
putNodeConnection
@Deprecated public void putNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem) Deprecated.Description copied from interface:IOptimizationElementDeprecated method.Put node connection.
- Specified by:
putNodeConnectionin interfaceIOptimizationElement- Parameters:
toElement- the to elementconncetorItem- the conncetor item
-
removeNodeConnection
Description copied from interface:IOptimizationElementRemoves anode connection. This method is most often used to clean upconnectionswhich are not in use any longer.- Specified by:
removeNodeConnectionin interfaceIOptimizationElement- Parameters:
toElement- the to element
-
getNodeConnectionKeySet
Description copied from interface:IOptimizationElementGets the node connection key set.- Specified by:
getNodeConnectionKeySetin interfaceIOptimizationElement- Returns:
- the node connection key set
-
setDistMatrixId
Deprecated.Description copied from interface:IOptimizationElementSets the dist matrix id.- Specified by:
setDistMatrixIdin interfaceIOptimizationElement- Parameters:
matrixId- the new dist matrix id
-
getDistMatrixId
Deprecated.Description copied from interface:IOptimizationElementGets the dist matrix id.- Specified by:
getDistMatrixIdin interfaceIOptimizationElement- Returns:
- the dist matrix id
-