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

public interface IOptimizationElement extends Serializable
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
  • Method Details

    • getFlavour

      Gets the flavour which spells out the kind of Node of the element.
      Returns:
      the flavour
    • getId

      String getId()
      Gets the unique id.
      Returns:
      the id
    • setId

      void setId(String id)
      Sets the unique id. By default this value is provided on construction.
      Parameters:
      id - the new id
    • forceSetId

      void forceSetId(String id)
      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()
      Returns true if the item has a real geo location. For example, an EventNode has no real geo location.
      Returns:
      true, if real geo location exists
    • setLatitude

      void setLatitude(double latitude)
      Sets the latitude of the element.
      Parameters:
      latitude - the new latitude
    • getLatitude

      double getLatitude()
      Gets the latitude of the element.
      Returns:
      the latitude
    • setLongitude

      void setLongitude(double longitude)
      Sets the longitude of the element.
      Parameters:
      longitude - the new longitude
    • getLongitude

      double getLongitude()
      Gets the longitude of the element.
      Returns:
      the longitude
    • getDutyHours

      List<IDutyHours> getDutyHours()
      Gets the IDutyHours of the element.
      Returns:
      the duty hours
    • getNodeConnection

      INodeConnectorItem getNodeConnection(IOptimizationElement toElement)
      Gets the node connection from this element to another element. During the optimization connections gathered from the INodeEdgeConnector 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 of node connections seen by this element.
      Returns:
      the node connections
    • putNodeConnectionFromElement

      void putNodeConnectionFromElement(INodeConnectorItem conncetorItem)
      Put a new node connection from this element to another element.
      Parameters:
      conncetorItem - the new found INodeConnectorItem
    • putNodeConnection

      @Deprecated void putNodeConnection(IOptimizationElement toElement, INodeConnectorItem conncetorItem)
      Deprecated method.

      Put node connection.

      Parameters:
      toElement - the to element
      conncetorItem - the conncetor item
    • setDistMatrixId

      @Deprecated void setDistMatrixId(int matrixId)
      Deprecated.
      Sets the dist matrix id.
      Parameters:
      matrixId - the new dist matrix id
      Category:
      Legacy Sets the dist matrix id.
    • getDistMatrixId

      @Deprecated int getDistMatrixId()
      Deprecated.
      Gets the dist matrix id.
      Returns:
      the dist matrix id
      Category:
      Legacy

      Gets the dist matrix id.

    • removeNodeConnection

      void removeNodeConnection(IOptimizationElement toElement)
      Removes a node connection. This method is most often used to clean up connections 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

      void setDutyHours(List<? extends IDutyHours> dutyHours)
      Sets the duty 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

      void setLocationId(String locationId)
      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

      void setExtraInfo(String extraInfo)
      Sets a custom extra info. For example, use JSON to encode your custom data.
      Parameters:
      extraInfo - the new extra info
    • getExtraInfo

      Optional<String> getExtraInfo()
      Gets the extra info.
      Returns:
      the extra info
    • setConstraintAliasId

      void setConstraintAliasId(String ignorablePostFixId)
      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

      Optional<String> getConstraintAliasId()
      Gets the constraint alias id.
      Returns:
      the constraint alias id