JOpt.SDK.Implementation
Class TimeWindowGeoNode

java.lang.Object
  extended byJOpt.SDK.Implementation.TimeWindowGeoNode
All Implemented Interfaces:
java.lang.Comparable, IDistanceMatrixEntry, IGeoNode, IJOptSDK, INode, IScheduledNode, ITimeWindowNode, ITypedObject, IViolation
Direct Known Subclasses:
EventNode

public class TimeWindowGeoNode
extends java.lang.Object
implements ITimeWindowNode, IScheduledNode, ITypedObject, IJOptSDK, java.lang.Comparable


Constructor Summary
TimeWindowGeoNode()
           
TimeWindowGeoNode(java.lang.String nodeId, double latitude, double longitude, java.util.GregorianCalendar timeWindowBegin, java.util.GregorianCalendar timeWindowEnd, double[] load, IOpeningHours[] openingHours, int visitDuration, java.lang.String preferableResource, IRelationship[] relationships, int priority)
          Deprecated.  
TimeWindowGeoNode(java.lang.String nodeId, double latitude, double longitude, IOpeningHours[] openingHours, int visitDuration, int priority)
           
 
Method Summary
 void addServicingHours(IServicingHours servicingHours)
           
 void addStrictViolation(IViolation violation)
           
 void addViolation(IViolation violation)
           
 long checkTimewindow(int jOptOptimizationRule)
           
 int compareTo(java.lang.Object compareObj)
           
 ITimeWindowNode copy()
           
 java.util.Vector get_servicingHours()
           
 java.util.GregorianCalendar getArrivalTime()
           
 java.util.GregorianCalendar getDepartureTime()
           
 int getDistMatrixId()
           
 java.lang.Integer getDistMatrixIdInteger()
           
 int getImportance()
           
 int getJointVisitDuration()
           
 double getLatitude()
           
 double[] getLoad()
           
 double getLongitude()
           
 java.util.Map getMapOpeningHours()
           
 int getMinimumInitialVisitDuration()
           
 java.lang.String getNodeId()
           
 int getNumViolationsPerGeneration()
           
 TimeWindowGeoNode[] getObjectInstances()
           
 IOpeningHours[] getOpeningHours()
           
 IOpeningHours getOpeningHours(int i)
           
 java.lang.String getPreferableResource()
           
 int getPreferredResourcePriority()
           
 IPreferredResource[] getPreferredResources()
           
 int getPriority()
           
 IRelationship[] getRelationships()
           
 int getRemainingVisitDuration()
           
 int getSequenceNumber()
           
 IServicingHours[] getServicingHours()
           
 IViolation[] getStrictViolations()
           
 double getTimeDrive()
           
 double getTimeIdle()
           
 java.util.GregorianCalendar getTimeWindowBegin()
           
 java.util.GregorianCalendar getTimeWindowEnd()
           
 java.lang.String getType()
           
 int getTypeId()
           
 IViolation[] getViolations()
           
 int getVisitationFrequency()
           
 int getVisitDuration()
           
 boolean isBreakAttached()
           
 boolean isCollectionPoint()
           
 boolean isUnassigned()
           
 boolean isUnloadAll()
           
 boolean isWaitOnEarlyArrival()
           
 void setArrivalTime(java.util.GregorianCalendar arrivalTime)
           
 void setArrivalTimeSecs(long arrivalTime)
           
 void setBreakAttached(boolean breakAttached)
           
 void setCollectionPoint(boolean collectionPoint)
           
 void setDepartureTime(java.util.GregorianCalendar departureTime)
           
 void setDepartureTimeMillis(long departureTime)
           
 void setDistMatrixId(int distanceMatrixId)
           
 void setImportance(int importance)
           
 void setJointVisitDuration(int jointVisitDuration)
           
 void setLatitude(double latitude)
           
 void setLoad(double[] load)
           
 void setLongitude(double longitude)
           
 void setMapOpeningHours(java.util.TreeMap mapOpeningHours)
           
 void setMinimumInitialVisitDuration(int minimumInitialVisitDuration)
           
 void setNodeId(java.lang.String nodeId)
           
 void setNumViolationsPerGeneration(int numViolationsPerGeneration)
           
 void setOpeningHours(IOpeningHours[] openingHours)
           
 void setPreferableResource(java.lang.String preferableResource)
           
 void setPreferredResourcePriority(int preferredResourcePriority)
           
 void setPreferredResources(IPreferredResource[] preferredResources)
          add a list of preferred resources each with a dedicated priority.
 void setPriority(int priority)
           
 void setRelationships(IRelationship[] relationships)
           
 void setRemainingVisitDuration(int remainingVisitDuration)
           
 void setSequenceNumber(int sequenceNumber)
           
 void setServicingHours(java.util.Vector servicingHours)
           
 void setTimeDrive(double timeDrive)
           
 void setTimeIdle(double timeIdle)
           
 void setTimeWindowBegin(java.util.GregorianCalendar timeWindowBegin)
           
 void setTimeWindowEnd(java.util.GregorianCalendar timeWindowEnd)
           
 void setType(java.lang.String type)
           
 void setUnassigned(boolean unassigned)
           
 void setUnloadAll(boolean unloadAll)
           
 void setVisitationFrequency(int numVisits)
          Defines a visitation frequency for periodic visits.
 void setVisitDuration(int visitDuration)
           
 void setWaitOnEarlyArrival(boolean waitOnEarlyArrival)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeWindowGeoNode

public TimeWindowGeoNode(java.lang.String nodeId,
                         double latitude,
                         double longitude,
                         IOpeningHours[] openingHours,
                         int visitDuration,
                         int priority)

TimeWindowGeoNode

public TimeWindowGeoNode()

TimeWindowGeoNode

public TimeWindowGeoNode(java.lang.String nodeId,
                         double latitude,
                         double longitude,
                         java.util.GregorianCalendar timeWindowBegin,
                         java.util.GregorianCalendar timeWindowEnd,
                         double[] load,
                         IOpeningHours[] openingHours,
                         int visitDuration,
                         java.lang.String preferableResource,
                         IRelationship[] relationships,
                         int priority)
Deprecated.  

Method Detail

getTypeId

public int getTypeId()
Specified by:
getTypeId in interface ITypedObject

setNodeId

public void setNodeId(java.lang.String nodeId)
Specified by:
setNodeId in interface INode
Parameters:
nodeId - set the node's unique Id

getNodeId

public java.lang.String getNodeId()
Specified by:
getNodeId in interface INode
Returns:
get the node's unique Id

setLatitude

public void setLatitude(double latitude)
Specified by:
setLatitude in interface IGeoNode
Parameters:
latitude - set the geographical latitude for linear distance estimation if not using a distance matrix

getLatitude

public double getLatitude()
Specified by:
getLatitude in interface IGeoNode
Returns:
get the nodes geografical latitude

setLongitude

public void setLongitude(double longitude)
Specified by:
setLongitude in interface IGeoNode

getLongitude

public double getLongitude()
Specified by:
getLongitude in interface IGeoNode
Returns:
get the nodes geografical longitude

setTimeWindowBegin

public void setTimeWindowBegin(java.util.GregorianCalendar timeWindowBegin)

getTimeWindowBegin

public java.util.GregorianCalendar getTimeWindowBegin()

setTimeWindowEnd

public void setTimeWindowEnd(java.util.GregorianCalendar timeWindowEnd)

getTimeWindowEnd

public java.util.GregorianCalendar getTimeWindowEnd()

setLoad

public void setLoad(double[] load)
Specified by:
setLoad in interface INode
Parameters:
load - define an arbitrary load vector for this node to be compared to the corresponding capacity vector each resource

getLoad

public double[] getLoad()
Specified by:
getLoad in interface INode
Returns:
load vector for this node

setVisitDuration

public void setVisitDuration(int visitDuration)
Specified by:
setVisitDuration in interface ITimeWindowNode
Parameters:
visitDuration - define the estimated time a resource will stay at that node

getVisitDuration

public int getVisitDuration()
Specified by:
getVisitDuration in interface ITimeWindowNode
Returns:
the estimated time a resource will stay at that node in seconds

setPreferredResources

public void setPreferredResources(IPreferredResource[] preferredResources)
Description copied from interface: INode
add a list of preferred resources each with a dedicated priority. If the list is set the single resource given with setPreferableResource(String resource) is ignored

Specified by:
setPreferredResources in interface INode
Parameters:
preferredResources -

getPreferredResources

public IPreferredResource[] getPreferredResources()
Specified by:
getPreferredResources in interface INode
Returns:
a list of preferred resources

setPreferableResource

public void setPreferableResource(java.lang.String preferableResource)
Specified by:
setPreferableResource in interface INode
Parameters:
preferableResource - set a preferable resource to visit this node

getPreferableResource

public java.lang.String getPreferableResource()
Specified by:
getPreferableResource in interface INode
Returns:
the preferable reource for that node or null if the resource is not set

setRelationships

public void setRelationships(IRelationship[] relationships)
Specified by:
setRelationships in interface INode
Parameters:
relationships - define relationships between nodes (e.g. fixed sequence for pickup and delivery stops, pre-defined succession of stops, separation of goods)

getRelationships

public IRelationship[] getRelationships()
Specified by:
getRelationships in interface INode
Returns:
relationships to other nodes

setSequenceNumber

public void setSequenceNumber(int sequenceNumber)

getSequenceNumber

public int getSequenceNumber()
Specified by:
getSequenceNumber in interface IScheduledNode
Returns:
actual sequence number within route after optimization

setArrivalTime

public void setArrivalTime(java.util.GregorianCalendar arrivalTime)

setArrivalTimeSecs

public void setArrivalTimeSecs(long arrivalTime)

getArrivalTime

public java.util.GregorianCalendar getArrivalTime()
Specified by:
getArrivalTime in interface IScheduledNode
Returns:
actual arrival time according to the optimization

setDepartureTime

public void setDepartureTime(java.util.GregorianCalendar departureTime)

setDepartureTimeMillis

public void setDepartureTimeMillis(long departureTime)

getDepartureTime

public java.util.GregorianCalendar getDepartureTime()
Specified by:
getDepartureTime in interface IScheduledNode
Returns:
actual departure time according to the optimization

addViolation

public void addViolation(IViolation violation)

addStrictViolation

public void addStrictViolation(IViolation violation)

getViolations

public IViolation[] getViolations()
Specified by:
getViolations in interface IScheduledNode
Returns:
actual constraint violations for that node according to the optimization

getStrictViolations

public IViolation[] getStrictViolations()
Specified by:
getStrictViolations in interface ITimeWindowNode
Returns:
actual list of constraint violations that caused the node to be sorted out in strict mode

addServicingHours

public void addServicingHours(IServicingHours servicingHours)

getServicingHours

public IServicingHours[] getServicingHours()
Specified by:
getServicingHours in interface ITimeWindowNode
Returns:
a list of subsequent service hours in case this node requires a mutliple day visit

setPriority

public void setPriority(int priority)
Specified by:
setPriority in interface INode
Parameters:
priority - set the node's priority

getPriority

public int getPriority()
Specified by:
getPriority in interface INode
Returns:
get the node's priority

setType

public void setType(java.lang.String type)
Specified by:
setType in interface INode
Parameters:
type - define the type of the node to be compared to the corresponding permitted types for each resource. If this value is not set, any resource can service this node.

getType

public java.lang.String getType()
Specified by:
getType in interface INode
Returns:
node type

setDistMatrixId

public void setDistMatrixId(int distanceMatrixId)
Specified by:
setDistMatrixId in interface IDistanceMatrixEntry
See Also:
IOptimization#addDistanceMatrix()

getDistMatrixId

public int getDistMatrixId()
Specified by:
getDistMatrixId in interface IDistanceMatrixEntry
Returns:
get the entriy's unique distance matrix Id

getDistMatrixIdInteger

public java.lang.Integer getDistMatrixIdInteger()

setTimeDrive

public void setTimeDrive(double timeDrive)

getTimeDrive

public double getTimeDrive()
Specified by:
getTimeDrive in interface IScheduledNode
Returns:
actual arrival time according to the optimization

setOpeningHours

public void setOpeningHours(IOpeningHours[] openingHours)
Specified by:
setOpeningHours in interface ITimeWindowNode
Parameters:
openingHours - define the opening hours of that node ( e.g. node cannot be visited outside the opening hours).

getOpeningHours

public IOpeningHours[] getOpeningHours()

getOpeningHours

public IOpeningHours getOpeningHours(int i)
Specified by:
getOpeningHours in interface ITimeWindowNode
Returns:
the opening hours

copy

public ITimeWindowNode copy()
Specified by:
copy in interface ITimeWindowNode
Returns:
a new instance of ITimeWindowNode

checkTimewindow

public long checkTimewindow(int jOptOptimizationRule)

setMapOpeningHours

public void setMapOpeningHours(java.util.TreeMap mapOpeningHours)

getMapOpeningHours

public java.util.Map getMapOpeningHours()

setRemainingVisitDuration

public void setRemainingVisitDuration(int remainingVisitDuration)

getRemainingVisitDuration

public int getRemainingVisitDuration()

setMinimumInitialVisitDuration

public void setMinimumInitialVisitDuration(int minimumInitialVisitDuration)

getMinimumInitialVisitDuration

public int getMinimumInitialVisitDuration()

setServicingHours

public void setServicingHours(java.util.Vector servicingHours)

get_servicingHours

public java.util.Vector get_servicingHours()

setVisitationFrequency

public void setVisitationFrequency(int numVisits)
Description copied from interface: INode
Defines a visitation frequency for periodic visits. When visitation frequency is set, JOpt will automatically divide the given opening hours into 'numVisits' clusters where each cluster's upper and lower boundary is defined by equidistant points in time that in turn are calculated as follows: leftboundary[clusterNo] = OpeningHours[0] + (OpeningHours[OpeningHours.Length]-OpeningHours[0])/numVisits * (clusterNo-1) rightboundary[clusterNo] = OpeningHours[0] + (OpeningHours[OpeningHours.Length]-OpeningHours[0])/numVisits * clusterNo

Specified by:
setVisitationFrequency in interface INode
Parameters:
numVisits -

getVisitationFrequency

public int getVisitationFrequency()
Specified by:
getVisitationFrequency in interface INode
Returns:
visitation frequency

getObjectInstances

public TimeWindowGeoNode[] getObjectInstances()

setTimeIdle

public void setTimeIdle(double timeIdle)

getTimeIdle

public double getTimeIdle()
Specified by:
getTimeIdle in interface IScheduledNode
Returns:
actual waiting time at that node according to the optimization

setImportance

public void setImportance(int importance)
Specified by:
setImportance in interface INode
Parameters:
importance - set the node's importance. Nodes that are less important may be left out in the STRICT_SINGLEDEPOT_MIXEDFLEET or the STRICT_MULTIDEPOT_MIXEDFLEET mode if they don't fit into the schedule.

getImportance

public int getImportance()
Specified by:
getImportance in interface INode
Returns:
get the node's importance

setNumViolationsPerGeneration

public void setNumViolationsPerGeneration(int numViolationsPerGeneration)

getNumViolationsPerGeneration

public int getNumViolationsPerGeneration()

setWaitOnEarlyArrival

public void setWaitOnEarlyArrival(boolean waitOnEarlyArrival)
Specified by:
setWaitOnEarlyArrival in interface ITimeWindowNode
Parameters:
waitOnEarlyArrival - true (default) if the resource will have wait until the node's opening hours begin before the node is served false if the node can be served without waiting for the opening hours begin

isWaitOnEarlyArrival

public boolean isWaitOnEarlyArrival()

setJointVisitDuration

public void setJointVisitDuration(int jointVisitDuration)
Specified by:
setJointVisitDuration in interface ITimeWindowNode
Parameters:
jointVisitDuration - define the estimated time a resource will stay at that node if it has already arrived at a node with the same geo position earlier (e.g. pick up mutliple persons at one place where each person is represented by one single node)

getJointVisitDuration

public int getJointVisitDuration()
Specified by:
getJointVisitDuration in interface ITimeWindowNode
Returns:
the estimated joint visit time a resource will stay at that node in seconds

setUnloadAll

public void setUnloadAll(boolean unloadAll)

isUnloadAll

public boolean isUnloadAll()

setUnassigned

public void setUnassigned(boolean unassigned)
Specified by:
setUnassigned in interface INode
Returns:
may be used by the strict mode to mark unassigned nodes

isUnassigned

public boolean isUnassigned()
Specified by:
isUnassigned in interface INode
Returns:
true if the node could not be assigned in stric mode

setBreakAttached

public void setBreakAttached(boolean breakAttached)

isBreakAttached

public boolean isBreakAttached()
Specified by:
isBreakAttached in interface INode
Returns:
true if the node directly follows a daily break

compareTo

public int compareTo(java.lang.Object compareObj)
Specified by:
compareTo in interface java.lang.Comparable

setCollectionPoint

public void setCollectionPoint(boolean collectionPoint)

isCollectionPoint

public boolean isCollectionPoint()

setPreferredResourcePriority

public void setPreferredResourcePriority(int preferredResourcePriority)
Specified by:
setPreferredResourcePriority in interface INode
Parameters:
preferredResourcePriority - set the node's priority

getPreferredResourcePriority

public int getPreferredResourcePriority()
Specified by:
getPreferredResourcePriority in interface INode
Returns:
get the node's priority