2014-11-28 06:13:18 -05:00
|
|
|
#ifndef PROCESSING_CHAIN_HPP
|
|
|
|
#define PROCESSING_CHAIN_HPP
|
2014-07-03 07:29:15 -04:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "contractor/contractor.hpp"
|
|
|
|
#include "contractor/contractor_options.hpp"
|
|
|
|
#include "contractor/query_edge.hpp"
|
|
|
|
#include "util/static_graph.hpp"
|
|
|
|
#include "util/deallocating_vector.hpp"
|
|
|
|
#include "util/node_based_graph.hpp"
|
2014-11-28 06:13:18 -05:00
|
|
|
|
2015-06-23 19:55:30 -04:00
|
|
|
struct SpeedProfileProperties;
|
2014-10-21 13:05:56 -04:00
|
|
|
struct EdgeBasedNode;
|
|
|
|
struct lua_State;
|
2014-07-03 07:29:15 -04:00
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
/**
|
|
|
|
\brief class of 'prepare' utility.
|
|
|
|
*/
|
|
|
|
class Prepare
|
|
|
|
{
|
2014-07-10 09:24:30 -04:00
|
|
|
public:
|
2014-08-19 07:01:38 -04:00
|
|
|
using EdgeData = QueryEdge::EdgeData;
|
2014-07-03 07:29:15 -04:00
|
|
|
|
2015-08-18 06:56:34 -04:00
|
|
|
explicit Prepare(ContractorConfig contractor_config) : config(std::move(contractor_config)) {}
|
2014-07-10 09:24:30 -04:00
|
|
|
Prepare(const Prepare &) = delete;
|
2014-07-03 07:29:15 -04:00
|
|
|
~Prepare();
|
|
|
|
|
2015-04-24 08:51:25 -04:00
|
|
|
int Run();
|
2014-07-03 07:29:15 -04:00
|
|
|
|
2014-07-10 09:24:30 -04:00
|
|
|
protected:
|
2015-07-01 11:55:54 -04:00
|
|
|
void ContractGraph(const unsigned max_edge_id,
|
2015-09-09 12:34:09 -04:00
|
|
|
DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
|
|
|
DeallocatingVector<QueryEdge> &contracted_edge_list,
|
2015-11-09 15:14:39 -05:00
|
|
|
std::vector<bool> &is_core_node,
|
|
|
|
std::vector<float> &node_levels) const;
|
2015-09-09 12:34:09 -04:00
|
|
|
void WriteCoreNodeMarker(std::vector<bool> &&is_core_node) const;
|
2015-11-09 15:14:39 -05:00
|
|
|
void WriteNodeLevels(std::vector<float> &&node_levels) const;
|
|
|
|
void ReadNodeLevels(std::vector<float> &contraction_order) const;
|
2015-04-23 12:53:36 -04:00
|
|
|
std::size_t WriteContractedGraph(unsigned number_of_edge_based_nodes,
|
2015-09-09 12:34:09 -04:00
|
|
|
const DeallocatingVector<QueryEdge> &contracted_edge_list);
|
|
|
|
void FindComponents(unsigned max_edge_id,
|
|
|
|
const DeallocatingVector<EdgeBasedEdge> &edges,
|
|
|
|
std::vector<EdgeBasedNode> &nodes) const;
|
2015-10-14 18:08:22 -04:00
|
|
|
|
2014-07-10 09:24:30 -04:00
|
|
|
private:
|
2015-04-24 08:51:25 -04:00
|
|
|
ContractorConfig config;
|
2015-10-14 18:08:22 -04:00
|
|
|
std::size_t LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
|
|
|
|
DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
|
|
|
const std::string &edge_segment_lookup_path,
|
|
|
|
const std::string &edge_penalty_path,
|
|
|
|
const std::string &segment_speed_path);
|
2014-07-03 07:29:15 -04:00
|
|
|
};
|
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif // PROCESSING_CHAIN_HPP
|