SuperStreetViewRouter
Documentation for SuperStreetViewRouter.
SuperStreetViewRouter.CityDataSuperStreetViewRouter.StreetDataSuperStreetViewRouter.check_solution_feasibilitySuperStreetViewRouter.find_best_pathSuperStreetViewRouter.get_path_valueSuperStreetViewRouter.get_possible_pathsSuperStreetViewRouter.get_possible_streetsSuperStreetViewRouter.get_solution_distanceSuperStreetViewRouter.get_total_city_costSuperStreetViewRouter.get_total_city_lengthSuperStreetViewRouter.path_timeSuperStreetViewRouter.solve
SuperStreetViewRouter.CityData — TypeCityData(total_duration::Int, nb_cars::Int, starting_junction::Int)A struct that holds the metadata for a city. Has constructor(s)
CityData(c::City)
CityData(;total_duration=Int, nb_cars=Int, starting_junction::Int)SuperStreetViewRouter.StreetData — TypeStreetData(duration::Int, id::Int, distance::Int)Structure storing the data required for greedy algorithm in edges of city graph. Has constructors
StreetData(street::Street)
StreetData(street::Street, id::Int)SuperStreetViewRouter.check_solution_feasibility — Methodcheck_solution_feasibility(soln::Solution, city_meta_graph::CityGraph; verbose=false)::BoolCheck if soln satisfies the constraints for the instance defined by city_meta_graph. The following criteria are considered (taken from the problem statement): - the number of itineraries has to match the number of cars of city_meta_graph - the first junction of each itinerary has to be the starting junction of city_meta_graph - for each consecutive pair of junctions on an itinerary, a street connecting these junctions has to exist in city_meta_graph (if the street is one directional, it has to be traversed in the correct direction) - the duration of each itinerary has to be lower or equal to the total duration of city_meta_graph
Credit to HashCode2014 for such a clear docstring
SuperStreetViewRouter.find_best_path — Methodfind_best_path(possible_paths, traversed_streets, penalty_function)Returns the best path to traverse from the provided list of possible paths. The best path is the one with the highest value considering the number of times each street has been traversed with the provided penalty
SuperStreetViewRouter.get_path_value — Methodget_path_value(path, traversed_streets, penalty_function)Returns the value of the provided path, taking into account the number of times each street has been traversed with the provided penalty
SuperStreetViewRouter.get_possible_paths — Method get_possible_paths(city_graph, current_junction, remaining_time, depth)returns list of tuples
SuperStreetViewRouter.get_possible_streets — Methodget_possible_streets(city_graph, current_junction, remaining_time)Returns a list of all streets that can be traversed from the provided junction. The streets are tuples of (endjunction, streetdata)
SuperStreetViewRouter.get_solution_distance — Methodget_solution_distance(solution::Solution, city_meta_graph::CityGraph)Compute the total distance of all itineraries in solution based on the street data from city. Streets visited several times are only counted once.
SuperStreetViewRouter.get_total_city_cost — Methodget_total_city_cost(city::City)Returns the total time (in seconds) required to traverse all streets of the provided city.
SuperStreetViewRouter.get_total_city_length — Methodget_total_city_length(city::City)Returns the total length (in meters) of all streets in the provided city.
SuperStreetViewRouter.path_time — Methodpath_time(path)Returns the time it takes to traverse the provided path
SuperStreetViewRouter.solve — Methodsolve(prob::CityProblem; depth=5, n_steps=1)Generates a Solution object to the provided CityProblem`, or uses the default city if none is provided. The depth parameter specifies the depth of the performed BFS and n_steps specifices how many steps to traverse the chosen BFS path per iteration.