Class EnhancedTTSP
- java.lang.Object
-
- ai.libs.jaicore.problems.enhancedttsp.EnhancedTTSP
-
public class EnhancedTTSP extends java.lang.Object
This class provides a search graph generator for an augmented version of the timed TSP (TTSP) problem. In TTSP, the original route graph has not only one cost per edge (u,v) but a list of costs where each position in the list represents an hour of departure from u. That is, depending on the time when leaving u, the cost to reach v may vary. The intended time measure is hours. That is, the length of the lists of all edges should be identical and reflect the number of hours considered. Typically, this is 24 or a multiple of that, e.g. 7 * 24. Time is considered cyclic. That is, if you consider 24 hours and the current time is 25.5, then it is automatically set to 1.5. The TTSP is enhanced by the consideration of blocking times for the streets, e.g. on Sundays (as in Germany) or during nights (as in Austria or Switzerland). Blocking times are stored in a separated list of Booleans. Also, the TTSP is enhanced in that driving pauses need to be considered. That is, the driver must only drive x hours in a row and then make a break of duration y. In addition, there must be an uninterrupted break of z hours every day. IT IS ASSUMED THAT BREAKS CAN ONLY BE MADE AT LOCATIONS AND NOT "ON THE ROAD"!
-
-
Constructor Summary
Constructors Constructor Description EnhancedTTSP(java.util.List<Location> locations, short startLocation, java.util.List<java.lang.Boolean> blockedHours, double hourOfDeparture, double maxConsecutiveDrivingTime, double durationOfShortBreak, double durationOfLongBreak)
-
Method Summary
-
-
-
Constructor Detail
-
EnhancedTTSP
public EnhancedTTSP(java.util.List<Location> locations, short startLocation, java.util.List<java.lang.Boolean> blockedHours, double hourOfDeparture, double maxConsecutiveDrivingTime, double durationOfShortBreak, double durationOfLongBreak)
-
-
Method Detail
-
getLocations
public java.util.List<Location> getLocations()
-
getStartLocation
public short getStartLocation()
-
getNumberOfConsideredHours
public int getNumberOfConsideredHours()
-
getBlockedHours
public java.util.List<java.lang.Boolean> getBlockedHours()
-
getHourOfDeparture
public double getHourOfDeparture()
-
getDurationOfShortBreak
public double getDurationOfShortBreak()
-
getDurationOfLongBreak
public double getDurationOfLongBreak()
-
getMaxConsecutiveDrivingTime
public double getMaxConsecutiveDrivingTime()
-
getMaxDrivingTimeBetweenLongBreaks
public double getMaxDrivingTimeBetweenLongBreaks()
-
getPossibleDestinations
public it.unimi.dsi.fastutil.shorts.ShortList getPossibleDestinations()
-
getInitalState
public EnhancedTTSPState getInitalState()
-
computeSuccessorState
public EnhancedTTSPState computeSuccessorState(EnhancedTTSPState n, short destination) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getPossibleRemainingDestinationsInState
public it.unimi.dsi.fastutil.shorts.ShortList getPossibleRemainingDestinationsInState(EnhancedTTSPState n)
-
getActualDrivingTimeWithoutBreak
public double getActualDrivingTimeWithoutBreak(double minTravelTime, double departure, double shareOfTheTripDone)
-
getShareOfTripWhenDrivingOverEdgeAtAGivenTimeForAGivenTimeWithoutDoingABreak
public double getShareOfTripWhenDrivingOverEdgeAtAGivenTimeForAGivenTimeWithoutDoingABreak(double minTravelTime, double departureOfCurrentPoint, double shareOfTripDone, double drivingTime)
-
getSolutionEvaluator
public EnhancedTTSPSolutionEvaluator getSolutionEvaluator()
-
getMinTravelTimeBetweenLocations
public double getMinTravelTimeBetweenLocations(short a, short b)
-
getLongestMinTravelTimeBetweenTwoLocations
public double getLongestMinTravelTimeBetweenTwoLocations()
-
getUpperBoundForAnyTour
public double getUpperBoundForAnyTour()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-