remove unneeded includes, fix variable names
This commit is contained in:
parent
293b462fd2
commit
fd0946b770
@ -27,9 +27,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "../typedefs.h"
|
||||
#include "../Algorithms/StronglyConnectedComponents.h"
|
||||
#include "../DataStructures/DynamicGraph.h"
|
||||
#include "../DataStructures/QueryEdge.h"
|
||||
#include "../DataStructures/TurnInstructions.h"
|
||||
#include "../Util/GraphLoader.h"
|
||||
#include "../Util/OSRMException.h"
|
||||
#include "../Util/SimpleLogger.h"
|
||||
@ -40,16 +37,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
typedef QueryEdge::EdgeData EdgeData;
|
||||
typedef DynamicGraph<EdgeData>::InputEdge InputEdge;
|
||||
|
||||
std::vector<NodeInfo> internal_to_external_node_map;
|
||||
std::vector<NodeInfo> coordinate_list;
|
||||
std::vector<TurnRestriction> restrictions_vector;
|
||||
std::vector<NodeID> bollard_node_IDs_vector;
|
||||
std::vector<NodeID> traffic_light_node_IDs_vector;
|
||||
std::vector<NodeID> bollard_ID_list;
|
||||
std::vector<NodeID> trafficlight_ID_list;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// enable logging
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
if (argc < 3)
|
||||
{
|
||||
@ -65,6 +60,7 @@ int main(int argc, char *argv[])
|
||||
FingerPrint fingerprint_loaded;
|
||||
restriction_ifstream.read((char *)&fingerprint_loaded, sizeof(FingerPrint));
|
||||
|
||||
// check fingerprint and warn if necessary
|
||||
if (!fingerprint_loaded.TestGraphUtil(fingerprint_orig))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << argv[2] << " was prepared with a different build. "
|
||||
@ -79,6 +75,7 @@ int main(int argc, char *argv[])
|
||||
restriction_ifstream.read((char *)&usable_restriction_count, sizeof(uint32_t));
|
||||
restrictions_vector.resize(usable_restriction_count);
|
||||
|
||||
// load restrictions
|
||||
if (usable_restriction_count>0)
|
||||
{
|
||||
restriction_ifstream.read((char *)&(restrictions_vector[0]),
|
||||
@ -86,20 +83,19 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
restriction_ifstream.close();
|
||||
|
||||
std::ifstream input_stream;
|
||||
input_stream.open(argv[1], std::ifstream::in | std::ifstream::binary);
|
||||
|
||||
std::ifstream input_stream(argv[1], std::ifstream::in | std::ifstream::binary);
|
||||
if (!input_stream.is_open())
|
||||
{
|
||||
throw OSRMException("Cannot open osrm file");
|
||||
}
|
||||
|
||||
// load graph data
|
||||
std::vector<ImportEdge> edge_list;
|
||||
const NodeID number_of_nodes = readBinaryOSRMGraphFromStream(input_stream,
|
||||
edge_list,
|
||||
bollard_node_IDs_vector,
|
||||
traffic_light_node_IDs_vector,
|
||||
&internal_to_external_node_map,
|
||||
bollard_ID_list,
|
||||
trafficlight_ID_list,
|
||||
&coordinate_list,
|
||||
restrictions_vector);
|
||||
input_stream.close();
|
||||
|
||||
@ -107,23 +103,21 @@ int main(int argc, char *argv[])
|
||||
"size of restrictions_vector changed");
|
||||
|
||||
SimpleLogger().Write() << restrictions_vector.size() << " restrictions, "
|
||||
<< bollard_node_IDs_vector.size() << " bollard nodes, "
|
||||
<< traffic_light_node_IDs_vector.size() << " traffic lights";
|
||||
|
||||
/***
|
||||
* Building an edge-expanded graph from node-based input an turn
|
||||
* restrictions
|
||||
*/
|
||||
<< bollard_ID_list.size() << " bollard nodes, "
|
||||
<< trafficlight_ID_list.size() << " traffic lights";
|
||||
|
||||
// Building an edge-expanded graph from node-based input an turn
|
||||
// restrictions
|
||||
SimpleLogger().Write() << "Starting SCC graph traversal";
|
||||
std::shared_ptr<TarjanSCC> tarjan =
|
||||
std::make_shared<TarjanSCC>(number_of_nodes,
|
||||
edge_list,
|
||||
bollard_node_IDs_vector,
|
||||
traffic_light_node_IDs_vector,
|
||||
bollard_ID_list,
|
||||
trafficlight_ID_list,
|
||||
restrictions_vector,
|
||||
internal_to_external_node_map);
|
||||
std::vector<ImportEdge>().swap(edge_list);
|
||||
coordinate_list);
|
||||
edge_list.clear();
|
||||
edge_list.shrink_to_fit();
|
||||
|
||||
tarjan->Run();
|
||||
SimpleLogger().Write() << "finished component analysis";
|
||||
|
Loading…
Reference in New Issue
Block a user