|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscheduler.TravelPartsGenerator
A generator of travel parts for the given origin and destination.
Field Summary | |
static double |
AIRPORTS_START_SEARCH_RANGE
A range to start the search for the train stations in, if the greater range value is specified. |
static double |
BUS_STOPS_START_SEARCH_RANGE
A range to start the search for the bus stops in, if the greater range value is specified. |
private FeedbackTravelPartsProvider |
feedbackTravelPartsProvider
A provider of feedback travel parts. |
static double |
HARBOURS_START_SEARCH_RANGE
A range to start the search for the harbours in, if the greater range value is specified. |
private LocationsTravelInfoProvider |
infoProvider
A provider of the travel information on the world. |
static int |
MAX_AIRPORTS_IN_RANGE_NUMBER
The max number of airports to be returned when searching for airports in some range. |
static int |
MAX_BUS_STOPS_IN_RANGE_NUMBER
The max number of bus stops to be returned when searching for bus stops in some range. |
static int |
MAX_DEPTH
Defines the deepest level at which the partitioning algorithm performs to search. |
static int |
MAX_FEEDBACK_KNOWLEDGE_DEPTH
Defines the maximal depth at which the feedback rules are launched. |
static int |
MAX_HARBOURS_IN_RANGE_NUMBER
The max number of harbours to be returned when searching for harbours in some range. |
static int |
MAX_TRAIN_STATIONS_IN_RANGE_NUMBER
The max number of train stations to be returned when searching for train stations in some range. |
static double |
MAX_TRAVEL_PARTS_SPACE
Defines a maximal space between two travel parts in the division. |
private static double |
MAX_UNPLANNED_DISTANCE
Defines a maximal distance route might be away from origin or destination to be considered a close one. |
private MeansOfTransportationProvider |
meansOfTransportationProvider
A provider of means of transportation for the two given points. |
static double |
TRAIN_STATIONS_START_SEARCH_RANGE
A range to start the search for the train stations in, if the greater range value is specified. |
private TravelConstraints |
travelConstraints
The travel constraints. |
Constructor Summary | |
TravelPartsGenerator()
Constructor. |
Method Summary | |
static boolean |
AreCloseEnough(Location x,
Location y)
Gets a boolean value indicating whether the two given locations are close enough to each other to be accepted as a space between two travel parts. |
private java.util.ArrayList |
GenerateParts(Location origin,
Location destination,
Station originStation,
Station destinationStation,
int depth)
Gets a list of all possible divisions into parts taken by some mean of transportation of a travel from the given origin to the given destination. |
java.util.ArrayList |
GenerateTravelParts(Location origin,
Location destination,
TravelConstraints travelConstraints)
Gets a list of possible divisions of the travel into the travel parts. |
private java.util.ArrayList |
GetAirports(Location location,
int range)
Gets the airports close to the given location, but no more then some limit value. |
private java.util.ArrayList |
GetBusStops(Location location,
int range)
Gets the bus stops close to the given location, but no more then some limit value. |
private java.util.ArrayList |
GetClosestStations(java.util.ArrayList stations,
Location location,
int countLimit)
Gets a list of at most given number of stations being the closest ones from the given list to the given location. |
private java.util.ArrayList |
GetHarbours(Location location,
int range)
Gets the harbours close to the given location, but no more then some limit value. |
static int |
GetMaxPartsCount()
Gets the max parts count with the current MAX_DEPTH value. |
private java.util.ArrayList |
GetStations(int meanOfTransportation,
Location location,
int range)
Gets a list of stations for the given location and mean of transportation. |
private java.util.ArrayList |
GetTrainStations(Location location,
int range)
Gets the train stations close to the given location, but no more then some limit value. |
private void |
MinimiseUnplannedDistances(java.util.ArrayList divisions,
Location origin,
Location destination)
Removes routes with the unplanned distances much longer then the of other ones. |
private void |
MinimiseUnplannedDistancesPerSide(java.util.ArrayList divisions,
Location origin,
Location destination)
Removes routes with the unplanned distances much longer then the of other ones. |
private void |
RemoveDuplicatedDivisions(java.util.ArrayList divisions)
Removes all duplicated divisions. |
private void |
RemoveFarTooLongDivisions(java.util.ArrayList divisions)
Removes travel divisions much longer then the rest of them. |
private void |
RemoveForbiddenMeansOfTransportation(java.util.ArrayList meansOfTransportation)
Removes the forbidden means of transportation by user unless it would means a removal of all of them. |
private void |
RemoveProhibitedMeansOfTransportation(java.util.ArrayList divisions)
Removes the divisions that use the forbiden means of transportation, unless it would mean a removal of all divisions. |
void |
SetFeedbackTravelPartsProvider(FeedbackTravelPartsProvider feedbackTravelPartsProvider)
Sets the provider of the feedback travel parts. |
void |
SetMeansOfTransportationProvider(MeansOfTransportationProvider meansOfTransportationProvider)
Sets the provider of the appropriate means of transportation for the two given locations. |
void |
SetTravelInfoProvider(LocationsTravelInfoProvider infoProvider)
Sets the provider of the travel information on the world. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private LocationsTravelInfoProvider infoProvider
private TravelConstraints travelConstraints
public static final double MAX_TRAVEL_PARTS_SPACE
public static final int MAX_DEPTH
private static final double MAX_UNPLANNED_DISTANCE
public static final int MAX_AIRPORTS_IN_RANGE_NUMBER
public static final int MAX_BUS_STOPS_IN_RANGE_NUMBER
public static final int MAX_TRAIN_STATIONS_IN_RANGE_NUMBER
public static final int MAX_HARBOURS_IN_RANGE_NUMBER
public static final double BUS_STOPS_START_SEARCH_RANGE
public static final double TRAIN_STATIONS_START_SEARCH_RANGE
public static final double AIRPORTS_START_SEARCH_RANGE
public static final double HARBOURS_START_SEARCH_RANGE
private MeansOfTransportationProvider meansOfTransportationProvider
private FeedbackTravelPartsProvider feedbackTravelPartsProvider
public static final int MAX_FEEDBACK_KNOWLEDGE_DEPTH
Constructor Detail |
public TravelPartsGenerator()
Method Detail |
public void SetTravelInfoProvider(LocationsTravelInfoProvider infoProvider)
infoProvider
- A provider to be set.public java.util.ArrayList GenerateTravelParts(Location origin, Location destination, TravelConstraints travelConstraints)
origin
- An origin of the travel.destination
- A destination of the travel.travelConstraints
- The travel constraints.
private void RemoveDuplicatedDivisions(java.util.ArrayList divisions)
divisions
- A list of divisions to be cleared of duplicated divisions.public static boolean AreCloseEnough(Location x, Location y)
x
- The first of the locations to be tested.y
- The second of the locations to be tested.
public static int GetMaxPartsCount()
private java.util.ArrayList GenerateParts(Location origin, Location destination, Station originStation, Station destinationStation, int depth)
origin
- The origin of the travel to be divided.destination
- The destination of the travel to be devided.originStation
- The origin station. Null if the origin location is not a station.destinationStation
- The destination station. Null if the destination location is not a station.depth
- The one-based depth of the recursive call.
private void RemoveForbiddenMeansOfTransportation(java.util.ArrayList meansOfTransportation)
meansOfTransportation
- A list to be cleared of forbidden means of transportation.private void RemoveProhibitedMeansOfTransportation(java.util.ArrayList divisions)
divisions
- A list of travel divisions to be cleared.private java.util.ArrayList GetStations(int meanOfTransportation, Location location, int range)
meanOfTransportation
- A mean of transportation.location
- An origin location.range
- A search radius.
MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.SHIP
private void MinimiseUnplannedDistances(java.util.ArrayList divisions, Location origin, Location destination)
divisions
- A set of travel divisions to be cleared.origin
- An origin of the travel.destination
- A destiantion of the travel.private void MinimiseUnplannedDistancesPerSide(java.util.ArrayList divisions, Location origin, Location destination)
divisions
- A set of travel divisions to be cleared.origin
- An origin of the travel.destination
- A destiantion of the travel.private void RemoveFarTooLongDivisions(java.util.ArrayList divisions)
divisions
- A list of travel divisions to be cleared of much longer ones.private java.util.ArrayList GetClosestStations(java.util.ArrayList stations, Location location, int countLimit)
stations
- A list of stations to choose from.location
- A location to count the distances to.countLimit
- A max number of stations to return.
private java.util.ArrayList GetAirports(Location location, int range)
location
- A location around which to search for the airports.range
- A range to search for the airports in.
private java.util.ArrayList GetBusStops(Location location, int range)
location
- A location around which to search for the bus stops.range
- A range to search for the bus stops in.
private java.util.ArrayList GetTrainStations(Location location, int range)
location
- A location around which to search for the train stations.range
- A range to search for the train station in.
private java.util.ArrayList GetHarbours(Location location, int range)
location
- A location around which to search for the harbours.range
- A range to search for the harbours in.
public void SetMeansOfTransportationProvider(MeansOfTransportationProvider meansOfTransportationProvider)
meansOfTransportationProvider
- A provider of means of transportation to be used.public void SetFeedbackTravelPartsProvider(FeedbackTravelPartsProvider feedbackTravelPartsProvider)
feedbackTravelPartsProvider
- A provider of feedback travel parts to be used.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |