rename all names with round_trip, trip or tsp to trip to standardize the naming
This commit is contained in:
@@ -25,8 +25,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TSP_BRUTE_FORCE_HPP
|
||||
#define TSP_BRUTE_FORCE_HPP
|
||||
#ifndef Trip_BRUTE_FORCE_HPP
|
||||
#define Trip_BRUTE_FORCE_HPP
|
||||
|
||||
|
||||
#include "../data_structures/search_engine.hpp"
|
||||
@@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tsp
|
||||
namespace trip
|
||||
{
|
||||
|
||||
// computes the distance of a given permutation
|
||||
@@ -71,7 +71,7 @@ EdgeWeight ReturnDistance(const DistTableWrapper<EdgeWeight> & dist_table,
|
||||
|
||||
// computes the route by computing all permutations and selecting the shortest
|
||||
template <typename NodeIDIterator>
|
||||
std::vector<NodeID> BruteForceTSP(const NodeIDIterator start,
|
||||
std::vector<NodeID> BruteForceTrip(const NodeIDIterator start,
|
||||
const NodeIDIterator end,
|
||||
const std::size_t number_of_locations,
|
||||
const DistTableWrapper<EdgeWeight> & dist_table) {
|
||||
@@ -99,6 +99,6 @@ std::vector<NodeID> BruteForceTSP(const NodeIDIterator start,
|
||||
return route;
|
||||
}
|
||||
|
||||
} //end namespace tsp
|
||||
} //end namespace trip
|
||||
} //end namespace osrm
|
||||
#endif // TSP_BRUTE_FORCE_HPP
|
||||
#endif // Trip_BRUTE_FORCE_HPP
|
||||
+9
-10
@@ -25,14 +25,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TSP_FARTHEST_INSERTION_HPP
|
||||
#define TSP_FARTHEST_INSERTION_HPP
|
||||
#ifndef TRIP_FARTHEST_INSERTION_HPP
|
||||
#define TRIP_FARTHEST_INSERTION_HPP
|
||||
|
||||
|
||||
#include "../data_structures/search_engine.hpp"
|
||||
#include "../util/string_util.hpp"
|
||||
#include "../util/dist_table_wrapper.hpp"
|
||||
#include "../tools/tsp_logs.hpp"
|
||||
|
||||
#include <osrm/json_container.hpp>
|
||||
|
||||
@@ -47,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tsp
|
||||
namespace trip
|
||||
{
|
||||
|
||||
// given a route and a new location, find the best place of insertion and
|
||||
@@ -150,10 +149,10 @@ std::vector<NodeID> FindRoute(const std::size_t & number_of_locations,
|
||||
}
|
||||
|
||||
template <typename NodeIDIterator>
|
||||
std::vector<NodeID> FarthestInsertionTSP(const NodeIDIterator & start,
|
||||
const NodeIDIterator & end,
|
||||
const std::size_t number_of_locations,
|
||||
const DistTableWrapper<EdgeWeight> & dist_table) {
|
||||
std::vector<NodeID> FarthestInsertionTrip(const NodeIDIterator & start,
|
||||
const NodeIDIterator & end,
|
||||
const std::size_t number_of_locations,
|
||||
const DistTableWrapper<EdgeWeight> & dist_table) {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// START FARTHEST INSERTION HERE
|
||||
// 1. start at a random round trip of 2 locations
|
||||
@@ -192,7 +191,7 @@ std::vector<NodeID> FarthestInsertionTSP(const NodeIDIterator & start,
|
||||
}
|
||||
|
||||
|
||||
} //end namespace tsp
|
||||
} //end namespace trip
|
||||
} //end namespace osrm
|
||||
|
||||
#endif // TSP_FARTHEST_INSERTION_HPP
|
||||
#endif // TRIP_FARTHEST_INSERTION_HPP
|
||||
+9
-9
@@ -25,8 +25,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TSP_NEAREST_NEIGHBOUR_HPP
|
||||
#define TSP_NEAREST_NEIGHBOUR_HPP
|
||||
#ifndef TRIP_NEAREST_NEIGHBOUR_HPP
|
||||
#define TRIP_NEAREST_NEIGHBOUR_HPP
|
||||
|
||||
|
||||
#include "../data_structures/search_engine.hpp"
|
||||
@@ -46,13 +46,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tsp
|
||||
namespace trip
|
||||
{
|
||||
template <typename NodeIDIterator>
|
||||
std::vector<NodeID> NearestNeighbourTSP(const NodeIDIterator & start,
|
||||
const NodeIDIterator & end,
|
||||
const std::size_t number_of_locations,
|
||||
const DistTableWrapper<EdgeWeight> & dist_table) {
|
||||
std::vector<NodeID> NearestNeighbourTrip(const NodeIDIterator & start,
|
||||
const NodeIDIterator & end,
|
||||
const std::size_t number_of_locations,
|
||||
const DistTableWrapper<EdgeWeight> & dist_table) {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// START GREEDY NEAREST NEIGHBOUR HERE
|
||||
// 1. grab a random location and mark as starting point
|
||||
@@ -117,6 +117,6 @@ std::vector<NodeID> NearestNeighbourTSP(const NodeIDIterator & start,
|
||||
return route;
|
||||
}
|
||||
|
||||
} //end namespace tsp
|
||||
} //end namespace trip
|
||||
} //end namespace osrm
|
||||
#endif // TSP_NEAREST_NEIGHBOUR_HPP
|
||||
#endif // TRIP_NEAREST_NEIGHBOUR_HPP
|
||||
@@ -25,8 +25,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TSP_BRUTE_FORCE_HPP
|
||||
#define TSP_BRUTE_FORCE_HPP
|
||||
#ifndef TRIP_BRUTE_FORCE_HPP
|
||||
#define TRIP_BRUTE_FORCE_HPP
|
||||
|
||||
|
||||
#include "../data_structures/search_engine.hpp"
|
||||
@@ -48,10 +48,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tsp
|
||||
namespace trip
|
||||
{
|
||||
|
||||
void TabuSearchTSP(std::vector<unsigned> & location,
|
||||
void TabuSearchTrip(std::vector<unsigned> & location,
|
||||
const PhantomNodeArray & phantom_node_vector,
|
||||
const std::vector<EdgeWeight> & dist_table,
|
||||
InternalRouteResult & min_route,
|
||||
@@ -60,7 +60,7 @@ void TabuSearchTSP(std::vector<unsigned> & location,
|
||||
|
||||
}
|
||||
|
||||
void TabuSearchTSP(const PhantomNodeArray & phantom_node_vector,
|
||||
void TabuSearchTrip(const PhantomNodeArray & phantom_node_vector,
|
||||
const std::vector<EdgeWeight> & dist_table,
|
||||
InternalRouteResult & min_route,
|
||||
std::vector<int> & min_loc_permutation) {
|
||||
@@ -70,4 +70,4 @@ void TabuSearchTSP(const PhantomNodeArray & phantom_node_vector,
|
||||
|
||||
}
|
||||
}
|
||||
#endif // TSP_BRUTE_FORCE_HPP
|
||||
#endif // TRIP_BRUTE_FORCE_HPP
|
||||
Reference in New Issue
Block a user