JOpt.SDK.Implementation
Class CapacityResource

java.lang.Object
  extended byJOpt.SDK.Implementation.CapacityResource
All Implemented Interfaces:
ICapacityResource, IDistanceMatrixEntry, IGeoResource, IResource

public class CapacityResource
extends java.lang.Object
implements ICapacityResource


Field Summary
static java.util.HashMap serviceTimePointer
           
 
Constructor Summary
CapacityResource()
           
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance)
           
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance, double BOS_MONDAY, double EOS_MONDAY, double BOS_TUESDAY, double EOS_TUESDAY, double BOS_WEDNESDAY, double EOS_WEDNESDAY, double BOS_THURSDAY, double EOS_THURSDAY, double BOS_FRIDAY, double EOS_FRIDAY, double BOS_SATURDAY, double EOS_SATURDAY, double BOS_SUNDAY, double EOS_SUNDAY)
          Deprecated.  
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance, double BOS_MONDAY, double EOS_MONDAY, double BOS_TUESDAY, double EOS_TUESDAY, double BOS_WEDNESDAY, double EOS_WEDNESDAY, double BOS_THURSDAY, double EOS_THURSDAY, double BOS_FRIDAY, double EOS_FRIDAY, double BOS_SATURDAY, double EOS_SATURDAY, double BOS_SUNDAY, double EOS_SUNDAY, java.lang.String[] nodeTypes, double[] capacity, double avgSpeed, int distanceMatrixId)
           
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance, IWorkingHours[] workingHours)
           
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance, java.lang.String[] nodeTypes, double[] capacity, double avgSpeed, int distanceMatrixId)
           
CapacityResource(java.lang.String resourceId, double latitude, double longitude, double maxHours, double maxDistance, java.lang.String[] nodeTypes, double[] capacity, double avgSpeed, int distanceMatrixId, IWorkingHours[] workingHours)
           
 
Method Summary
 void addCapacity(double capacity)
           
 void addPermittedNodeType(java.lang.String nodeType)
           
 double calculateDailyBreakAZO(double increment, long serviceTime)
           
 long calculateTimeBreak3(long curWorkingHoursEnd)
           
 double calculateWeeklyBreakAZO(double increment, long serviceTime)
           
 double calulateAZO(long traveltime, long curServiceTime)
           
 boolean checkNodeTypePermission(java.lang.String nodeType)
           
 double getAvgSpeed()
           
 double[] getCapacity()
           
 IWorkingHours getCurrentWorkingHours()
           
 long getCurResTime()
           
 java.util.HashMap getDailyWorkingHours()
           
 int getDistMatrixId()
           
 double getFixCost()
           
 double[] getInitialLoad()
           
 double getLatitude()
           
 double getLongitude()
           
 double getMaxDailyHours()
           
 double getMaxDistance()
           
 double getMaxHours()
           
 double getMaxWeeklyHours()
           
 double getPerHourCost()
           
 double getPerKilometerCost()
           
 java.lang.String[] getPermittedNodeTypes()
           
 java.lang.String getResourceId()
           
 double getTimeBreak()
           
 double getTimeMatrixFactor()
           
 IWorkingHours getWorkingHours(int i)
           
 void incCurResTime(long increment)
           
 void incrementDailyAZO(double increment)
           
 void incrementWeeklyAZO(double increment)
           
 void IncWorkingHours()
           
 void incWorkingHoursToNextNearest()
           
 void resetBOS()
           
 void resetDailyAZO()
           
 void resetWeeklyAZO()
           
 void setAvgSpeed(double avgSpeed)
           
 void setCost(double fixCost, double perHourCost, double perKilometerCost)
           
 void setCurResTime(long curResTime)
           
 void setDailyWorkingHours(java.util.HashMap dailyWorkingHours)
           
 void setDistMatrixId(int distanceMatrixId)
           
 void setFixCost(double fixCost)
           
 void setInitialLoad(double[] initialLoad)
           
 void setLatitude(double latitude)
           
 void setLongitude(double longitude)
           
 void setMaxDailyHours(double maxDailyHours)
           
 void setMaxDistance(double maxDistance)
           
 void setMaxHours(double maxHours)
           
 void setMaxWeeklyHours(double maxWeeklyHours)
           
 void setPerHourCost(double perHourCost)
           
 void setPerKilometerCost(double perKilometerCost)
           
 void setResourceId(java.lang.String resourceId)
           
 void setTimeBreak(double timeBreak)
           
 void setTimeMatrixFactor(double timeFactor)
           
 void setWorkingHours(IWorkingHours[] workingHours)
           
 void sleepUntilNextWorkBegin()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceTimePointer

public static java.util.HashMap serviceTimePointer
Constructor Detail

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance,
                        double BOS_MONDAY,
                        double EOS_MONDAY,
                        double BOS_TUESDAY,
                        double EOS_TUESDAY,
                        double BOS_WEDNESDAY,
                        double EOS_WEDNESDAY,
                        double BOS_THURSDAY,
                        double EOS_THURSDAY,
                        double BOS_FRIDAY,
                        double EOS_FRIDAY,
                        double BOS_SATURDAY,
                        double EOS_SATURDAY,
                        double BOS_SUNDAY,
                        double EOS_SUNDAY)
Deprecated.  

Parameters:
EOS_SUNDAY -
BOS_SUNDAY -
EOS_SATURDAY -
BOS_SATURDAY -
EOS_FRIDAY -
BOS_FRIDAY -
EOS_THURSDAY -
BOS_THURSDAY -
EOS_WEDNESDAY -
BOS_WEDNESDAY -
EOS_TUESDAY -
BOS_TUESDAY -
EOS_MONDAY -
BOS_MONDAY -
maxDistance -
maxHours -
longitude -
latitude -
resourceId -

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance,
                        double BOS_MONDAY,
                        double EOS_MONDAY,
                        double BOS_TUESDAY,
                        double EOS_TUESDAY,
                        double BOS_WEDNESDAY,
                        double EOS_WEDNESDAY,
                        double BOS_THURSDAY,
                        double EOS_THURSDAY,
                        double BOS_FRIDAY,
                        double EOS_FRIDAY,
                        double BOS_SATURDAY,
                        double EOS_SATURDAY,
                        double BOS_SUNDAY,
                        double EOS_SUNDAY,
                        java.lang.String[] nodeTypes,
                        double[] capacity,
                        double avgSpeed,
                        int distanceMatrixId)

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance,
                        java.lang.String[] nodeTypes,
                        double[] capacity,
                        double avgSpeed,
                        int distanceMatrixId)

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance,
                        java.lang.String[] nodeTypes,
                        double[] capacity,
                        double avgSpeed,
                        int distanceMatrixId,
                        IWorkingHours[] workingHours)

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance)

CapacityResource

public CapacityResource(java.lang.String resourceId,
                        double latitude,
                        double longitude,
                        double maxHours,
                        double maxDistance,
                        IWorkingHours[] workingHours)

CapacityResource

public CapacityResource()
Method Detail

setResourceId

public void setResourceId(java.lang.String resourceId)
Specified by:
setResourceId in interface IResource
Parameters:
resourceId - the resource's unique id

getResourceId

public java.lang.String getResourceId()
Specified by:
getResourceId in interface IResource
Returns:
the resource's unique id

setLatitude

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

getLatitude

public double getLatitude()
Specified by:
getLatitude in interface IGeoResource
Returns:

setLongitude

public void setLongitude(double longitude)
Specified by:
setLongitude in interface IGeoResource
Parameters:
longitude - set the geografical longitude for linear distance estimation if not using a distance matrix

getLongitude

public double getLongitude()
Specified by:
getLongitude in interface IGeoResource
Returns:

setMaxHours

public void setMaxHours(double maxHours)
Specified by:
setMaxHours in interface ICapacityResource

getMaxHours

public double getMaxHours()
Specified by:
getMaxHours in interface ICapacityResource
Returns:
the maximum time a that a route may take for this resource

setMaxDistance

public void setMaxDistance(double maxDistance)
Specified by:
setMaxDistance in interface ICapacityResource

getMaxDistance

public double getMaxDistance()
Specified by:
getMaxDistance in interface ICapacityResource
Returns:
the maximum distance a that a route may have for this resource

addCapacity

public void addCapacity(double capacity)
Specified by:
addCapacity in interface ICapacityResource
Parameters:
capacity - an arbitrary capacity vector for this resource. This vector will be matched with the corresponding load vector of a visited node during the optimization run.

getCapacity

public double[] getCapacity()
Specified by:
getCapacity in interface ICapacityResource
Returns:
the capacity vector

addPermittedNodeType

public void addPermittedNodeType(java.lang.String nodeType)
Specified by:
addPermittedNodeType in interface ICapacityResource
Parameters:
nodeType - a node type that a resources is allowed to visit. This is only in effect if one has defined node types for some of the nodes before. Otherwise node types are ignored.
See Also:
INode.setType()

getPermittedNodeTypes

public java.lang.String[] getPermittedNodeTypes()
Specified by:
getPermittedNodeTypes in interface ICapacityResource
Returns:
a list of permitted node types

checkNodeTypePermission

public boolean checkNodeTypePermission(java.lang.String nodeType)
Specified by:
checkNodeTypePermission in interface ICapacityResource
Parameters:
nodeType -
Returns:
true if the resource holds the permission to visit the given nodeType

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

setAvgSpeed

public void setAvgSpeed(double avgSpeed)
Specified by:
setAvgSpeed in interface ICapacityResource
Parameters:
avgSpeed - the average speed for this resource. This is only in effect when no timeMatrix has been defined. Otherwise the timeFactor is the effective value.
See Also:
setTimeMatrixFactor()

getAvgSpeed

public double getAvgSpeed()
Specified by:
getAvgSpeed in interface ICapacityResource
Returns:
the average speed of this resource

resetBOS

public void resetBOS()

IncWorkingHours

public void IncWorkingHours()

getCurrentWorkingHours

public IWorkingHours getCurrentWorkingHours()

incWorkingHoursToNextNearest

public void incWorkingHoursToNextNearest()

calculateTimeBreak3

public long calculateTimeBreak3(long curWorkingHoursEnd)

sleepUntilNextWorkBegin

public void sleepUntilNextWorkBegin()

setWorkingHours

public void setWorkingHours(IWorkingHours[] workingHours)

getWorkingHours

public IWorkingHours getWorkingHours(int i)

setCost

public void setCost(double fixCost,
                    double perHourCost,
                    double perKilometerCost)
Specified by:
setCost in interface ICapacityResource
Parameters:
perKilometerCost - the cost the vehicle will cause with each kilometer
perHourCost - the cost the vehicle will cause with each hour
fixCost - the fix cost the vehicle will cause when it is scheduled

setFixCost

public void setFixCost(double fixCost)

getFixCost

public double getFixCost()

setPerHourCost

public void setPerHourCost(double perHourCost)

getPerHourCost

public double getPerHourCost()

setPerKilometerCost

public void setPerKilometerCost(double perKilometerCost)

getPerKilometerCost

public double getPerKilometerCost()

setMaxDailyHours

public void setMaxDailyHours(double maxDailyHours)
Specified by:
setMaxDailyHours in interface ICapacityResource
Parameters:
maxDailyHours - the maximum hours a resource is allowed to work each day

getMaxDailyHours

public double getMaxDailyHours()
Specified by:
getMaxDailyHours in interface ICapacityResource
Returns:
the maximum hours a resource is allowed to work each day

setMaxWeeklyHours

public void setMaxWeeklyHours(double maxWeeklyHours)
Specified by:
setMaxWeeklyHours in interface ICapacityResource
Parameters:
maxWeeklyHours - the maximum hours a resource is allowed to work each week

getMaxWeeklyHours

public double getMaxWeeklyHours()
Specified by:
getMaxWeeklyHours in interface ICapacityResource
Returns:
the maximum hours a resource is allowed to work each days

setTimeBreak

public void setTimeBreak(double timeBreak)

getTimeBreak

public double getTimeBreak()

setDailyWorkingHours

public void setDailyWorkingHours(java.util.HashMap dailyWorkingHours)
Specified by:
setDailyWorkingHours in interface ICapacityResource
Parameters:
dailyWorkingHours - the current daily working hours. Used by JOpt only

getDailyWorkingHours

public java.util.HashMap getDailyWorkingHours()
Specified by:
getDailyWorkingHours in interface ICapacityResource
Returns:
the current working Hours

calculateDailyBreakAZO

public double calculateDailyBreakAZO(double increment,
                                     long serviceTime)

calculateWeeklyBreakAZO

public double calculateWeeklyBreakAZO(double increment,
                                      long serviceTime)

calulateAZO

public double calulateAZO(long traveltime,
                          long curServiceTime)

incrementDailyAZO

public void incrementDailyAZO(double increment)

incrementWeeklyAZO

public void incrementWeeklyAZO(double increment)

resetDailyAZO

public void resetDailyAZO()

resetWeeklyAZO

public void resetWeeklyAZO()

setCurResTime

public void setCurResTime(long curResTime)

getCurResTime

public long getCurResTime()

incCurResTime

public void incCurResTime(long increment)

setInitialLoad

public void setInitialLoad(double[] initialLoad)
Specified by:
setInitialLoad in interface ICapacityResource
Parameters:
initialLoad - set up an initial loadvector (eg. initial load when leaving the depot)

getInitialLoad

public double[] getInitialLoad()
Specified by:
getInitialLoad in interface ICapacityResource
Returns:
initial load

setTimeMatrixFactor

public void setTimeMatrixFactor(double timeFactor)
Specified by:
setTimeMatrixFactor in interface ICapacityResource
Parameters:
timeFactor - the factor to affect the average driving times given in the timeMatrix. If not set the time factor is set to 1.0 by default. remark: Is in effect only in case a timeMatrix has been defined.

getTimeMatrixFactor

public double getTimeMatrixFactor()
Specified by:
getTimeMatrixFactor in interface ICapacityResource
Returns:
the timeFactor of that resource