remove type from more structs, remove asserts
This commit is contained in:
parent
1e40cd6f0b
commit
2e3d33dfcd
@ -504,7 +504,6 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(u < v);
|
BOOST_ASSERT(u < v);
|
||||||
BOOST_ASSERT(edge_data.type != SHRT_MAX);
|
|
||||||
|
|
||||||
// Note: edges that end on barrier nodes or on a turn restriction
|
// Note: edges that end on barrier nodes or on a turn restriction
|
||||||
// may actually be in two distinct components. We choose the smallest
|
// may actually be in two distinct components. We choose the smallest
|
||||||
|
@ -52,17 +52,15 @@ NodeBasedEdge::NodeBasedEdge(NodeID source,
|
|||||||
EdgeWeight weight,
|
EdgeWeight weight,
|
||||||
bool forward,
|
bool forward,
|
||||||
bool backward,
|
bool backward,
|
||||||
short type,
|
|
||||||
bool roundabout,
|
bool roundabout,
|
||||||
bool in_tiny_cc,
|
bool in_tiny_cc,
|
||||||
bool access_restricted,
|
bool access_restricted,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
bool is_split)
|
bool is_split)
|
||||||
: source(source), target(target), name_id(name_id), weight(weight), type(type),
|
: source(source), target(target), name_id(name_id), weight(weight),
|
||||||
forward(forward), backward(backward), roundabout(roundabout), in_tiny_cc(in_tiny_cc),
|
forward(forward), backward(backward), roundabout(roundabout), in_tiny_cc(in_tiny_cc),
|
||||||
access_restricted(access_restricted), is_split(is_split), travel_mode(travel_mode)
|
access_restricted(access_restricted), is_split(is_split), travel_mode(travel_mode)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT_MSG(type > 0, "negative edge type");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EdgeBasedEdge::operator<(const EdgeBasedEdge &other) const
|
bool EdgeBasedEdge::operator<(const EdgeBasedEdge &other) const
|
||||||
|
@ -41,7 +41,6 @@ struct NodeBasedEdge
|
|||||||
EdgeWeight weight,
|
EdgeWeight weight,
|
||||||
bool forward,
|
bool forward,
|
||||||
bool backward,
|
bool backward,
|
||||||
short type,
|
|
||||||
bool roundabout,
|
bool roundabout,
|
||||||
bool in_tiny_cc,
|
bool in_tiny_cc,
|
||||||
bool access_restricted,
|
bool access_restricted,
|
||||||
@ -52,7 +51,6 @@ struct NodeBasedEdge
|
|||||||
NodeID target;
|
NodeID target;
|
||||||
NodeID name_id;
|
NodeID name_id;
|
||||||
EdgeWeight weight;
|
EdgeWeight weight;
|
||||||
short type;
|
|
||||||
bool forward : 1;
|
bool forward : 1;
|
||||||
bool backward : 1;
|
bool backward : 1;
|
||||||
bool roundabout : 1;
|
bool roundabout : 1;
|
||||||
|
@ -13,7 +13,7 @@ struct NodeBasedEdgeData
|
|||||||
{
|
{
|
||||||
NodeBasedEdgeData()
|
NodeBasedEdgeData()
|
||||||
: distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID),
|
: distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID),
|
||||||
nameID(std::numeric_limits<unsigned>::max()), type(std::numeric_limits<short>::max()),
|
nameID(std::numeric_limits<unsigned>::max()),
|
||||||
isAccessRestricted(false), shortcut(false), forward(false), backward(false),
|
isAccessRestricted(false), shortcut(false), forward(false), backward(false),
|
||||||
roundabout(false), ignore_in_grid(false), travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
roundabout(false), ignore_in_grid(false), travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
||||||
{
|
{
|
||||||
@ -22,7 +22,6 @@ struct NodeBasedEdgeData
|
|||||||
int distance;
|
int distance;
|
||||||
unsigned edgeBasedNodeID;
|
unsigned edgeBasedNodeID;
|
||||||
unsigned nameID;
|
unsigned nameID;
|
||||||
short type;
|
|
||||||
bool isAccessRestricted : 1;
|
bool isAccessRestricted : 1;
|
||||||
bool shortcut : 1;
|
bool shortcut : 1;
|
||||||
bool forward : 1;
|
bool forward : 1;
|
||||||
@ -91,7 +90,6 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector<ImportEdge
|
|||||||
edge.data.roundabout = import_edge.roundabout;
|
edge.data.roundabout = import_edge.roundabout;
|
||||||
edge.data.ignore_in_grid = import_edge.in_tiny_cc;
|
edge.data.ignore_in_grid = import_edge.in_tiny_cc;
|
||||||
edge.data.nameID = import_edge.name_id;
|
edge.data.nameID = import_edge.name_id;
|
||||||
edge.data.type = import_edge.type;
|
|
||||||
edge.data.isAccessRestricted = import_edge.access_restricted;
|
edge.data.isAccessRestricted = import_edge.access_restricted;
|
||||||
edge.data.travel_mode = import_edge.travel_mode;
|
edge.data.travel_mode = import_edge.travel_mode;
|
||||||
|
|
||||||
|
@ -330,7 +330,6 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name,
|
|||||||
edge_iterator->source_coordinate.lon != std::numeric_limits<int>::min())
|
edge_iterator->source_coordinate.lon != std::numeric_limits<int>::min())
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(edge_iterator->speed != -1);
|
BOOST_ASSERT(edge_iterator->speed != -1);
|
||||||
BOOST_ASSERT(edge_iterator->type >= 0);
|
|
||||||
edge_iterator->target_coordinate.lat = node_iterator->lat;
|
edge_iterator->target_coordinate.lat = node_iterator->lat;
|
||||||
edge_iterator->target_coordinate.lon = node_iterator->lon;
|
edge_iterator->target_coordinate.lon = node_iterator->lon;
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
|
|
||||||
edge_list.reserve(m);
|
edge_list.reserve(m);
|
||||||
EdgeWeight weight;
|
EdgeWeight weight;
|
||||||
short type;
|
|
||||||
NodeID nameID;
|
NodeID nameID;
|
||||||
int length;
|
int length;
|
||||||
bool is_roundabout, ignore_in_grid, is_access_restricted, is_split;
|
bool is_roundabout, ignore_in_grid, is_access_restricted, is_split;
|
||||||
@ -160,8 +159,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
forward = false;
|
forward = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(type >= 0);
|
|
||||||
|
|
||||||
// translate the external NodeIDs to internal IDs
|
// translate the external NodeIDs to internal IDs
|
||||||
auto internal_id_iter = ext_to_int_id_map.find(source);
|
auto internal_id_iter = ext_to_int_id_map.find(source);
|
||||||
if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end())
|
if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end())
|
||||||
@ -195,7 +192,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
weight,
|
weight,
|
||||||
forward,
|
forward,
|
||||||
backward,
|
backward,
|
||||||
type,
|
|
||||||
is_roundabout,
|
is_roundabout,
|
||||||
ignore_in_grid,
|
ignore_in_grid,
|
||||||
is_access_restricted,
|
is_access_restricted,
|
||||||
@ -302,7 +298,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
|
|
||||||
edge_list.reserve(m);
|
edge_list.reserve(m);
|
||||||
EdgeWeight weight;
|
EdgeWeight weight;
|
||||||
short type;
|
|
||||||
NodeID nameID;
|
NodeID nameID;
|
||||||
int length;
|
int length;
|
||||||
bool is_roundabout, ignore_in_grid, is_access_restricted, is_split;
|
bool is_roundabout, ignore_in_grid, is_access_restricted, is_split;
|
||||||
@ -326,8 +321,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
BOOST_ASSERT_MSG(weight > 0, "loaded null weight");
|
BOOST_ASSERT_MSG(weight > 0, "loaded null weight");
|
||||||
BOOST_ASSERT_MSG(0 <= dir && dir <= 2, "loaded bogus direction");
|
BOOST_ASSERT_MSG(0 <= dir && dir <= 2, "loaded bogus direction");
|
||||||
|
|
||||||
BOOST_ASSERT(type >= 0);
|
|
||||||
|
|
||||||
// translate the external NodeIDs to internal IDs
|
// translate the external NodeIDs to internal IDs
|
||||||
auto internal_id_iter = ext_to_int_id_map.find(source);
|
auto internal_id_iter = ext_to_int_id_map.find(source);
|
||||||
if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end())
|
if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end())
|
||||||
|
Loading…
Reference in New Issue
Block a user