Remove unused memebers and rename to currrent style convention
This commit is contained in:
parent
fd30e82836
commit
faa880d60a
@ -96,18 +96,18 @@ void GraphCompressor::Compress(const std::unordered_set<NodeID>& barrier_nodes,
|
||||
}
|
||||
|
||||
// this case can happen if two ways with different names overlap
|
||||
if (fwd_edge_data1.nameID != rev_edge_data1.nameID ||
|
||||
fwd_edge_data2.nameID != rev_edge_data2.nameID)
|
||||
if (fwd_edge_data1.name_id != rev_edge_data1.name_id ||
|
||||
fwd_edge_data2.name_id != rev_edge_data2.name_id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fwd_edge_data1.IsCompatibleTo(fwd_edge_data2) && rev_edge_data1.IsCompatibleTo(rev_edge_data2))
|
||||
{
|
||||
BOOST_ASSERT(graph.GetEdgeData(forward_e1).nameID ==
|
||||
graph.GetEdgeData(reverse_e1).nameID);
|
||||
BOOST_ASSERT(graph.GetEdgeData(forward_e2).nameID ==
|
||||
graph.GetEdgeData(reverse_e2).nameID);
|
||||
BOOST_ASSERT(graph.GetEdgeData(forward_e1).name_id ==
|
||||
graph.GetEdgeData(reverse_e1).name_id);
|
||||
BOOST_ASSERT(graph.GetEdgeData(forward_e2).name_id ==
|
||||
graph.GetEdgeData(reverse_e2).name_id);
|
||||
|
||||
// Get distances before graph is modified
|
||||
const int forward_weight1 = graph.GetEdgeData(forward_e1).distance;
|
||||
|
@ -97,8 +97,8 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u,
|
||||
|
||||
const EdgeData &reverse_data = m_node_based_graph->GetEdgeData(edge_id_2);
|
||||
|
||||
if (forward_data.edgeBasedNodeID == SPECIAL_NODEID &&
|
||||
reverse_data.edgeBasedNodeID == SPECIAL_NODEID)
|
||||
if (forward_data.edge_id == SPECIAL_NODEID &&
|
||||
reverse_data.edge_id == SPECIAL_NODEID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -154,9 +154,9 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u,
|
||||
|
||||
// build edges
|
||||
m_edge_based_node_list.emplace_back(
|
||||
forward_data.edgeBasedNodeID, reverse_data.edgeBasedNodeID,
|
||||
forward_data.edge_id, reverse_data.edge_id,
|
||||
current_edge_source_coordinate_id, current_edge_target_coordinate_id,
|
||||
forward_data.nameID, forward_geometry[i].second,
|
||||
forward_data.name_id, forward_geometry[i].second,
|
||||
reverse_geometry[geometry_size - 1 - i].second, forward_dist_prefix_sum[i],
|
||||
reverse_dist_prefix_sum[i], m_compressed_edge_container.GetPositionForID(edge_id_1),
|
||||
component_id, i, forward_data.travel_mode, reverse_data.travel_mode);
|
||||
@ -178,7 +178,7 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u,
|
||||
{
|
||||
BOOST_ASSERT(!m_compressed_edge_container.HasEntryForID(edge_id_2));
|
||||
|
||||
if (forward_data.edgeBasedNodeID != SPECIAL_NODEID)
|
||||
if (forward_data.edge_id != SPECIAL_NODEID)
|
||||
{
|
||||
BOOST_ASSERT(forward_data.forward);
|
||||
}
|
||||
@ -187,7 +187,7 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u,
|
||||
BOOST_ASSERT(!forward_data.forward);
|
||||
}
|
||||
|
||||
if (reverse_data.edgeBasedNodeID != SPECIAL_NODEID)
|
||||
if (reverse_data.edge_id != SPECIAL_NODEID)
|
||||
{
|
||||
BOOST_ASSERT(reverse_data.forward);
|
||||
}
|
||||
@ -196,12 +196,12 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u,
|
||||
BOOST_ASSERT(!reverse_data.forward);
|
||||
}
|
||||
|
||||
BOOST_ASSERT(forward_data.edgeBasedNodeID != SPECIAL_NODEID ||
|
||||
reverse_data.edgeBasedNodeID != SPECIAL_NODEID);
|
||||
BOOST_ASSERT(forward_data.edge_id != SPECIAL_NODEID ||
|
||||
reverse_data.edge_id != SPECIAL_NODEID);
|
||||
|
||||
m_edge_based_node_list.emplace_back(
|
||||
forward_data.edgeBasedNodeID, reverse_data.edgeBasedNodeID, node_u, node_v,
|
||||
forward_data.nameID, forward_data.distance, reverse_data.distance, 0, 0, SPECIAL_EDGEID,
|
||||
forward_data.edge_id, reverse_data.edge_id, node_u, node_v,
|
||||
forward_data.name_id, forward_data.distance, reverse_data.distance, 0, 0, SPECIAL_EDGEID,
|
||||
component_id, 0, forward_data.travel_mode, reverse_data.travel_mode);
|
||||
BOOST_ASSERT(!m_edge_based_node_list.back().IsCompressed());
|
||||
}
|
||||
@ -241,7 +241,7 @@ void EdgeBasedGraphFactory::Run(const std::string &original_edge_data_filename,
|
||||
}
|
||||
|
||||
|
||||
/// Renumbers all _forward_ edges and sets the edgeBasedNodeID.
|
||||
/// Renumbers all _forward_ edges and sets the edge_id.
|
||||
/// A specific numbering is not important. Any unique ID will do.
|
||||
void EdgeBasedGraphFactory::RenumberEdges()
|
||||
{
|
||||
@ -260,10 +260,10 @@ void EdgeBasedGraphFactory::RenumberEdges()
|
||||
}
|
||||
|
||||
BOOST_ASSERT(numbered_edges_count < m_node_based_graph->GetNumberOfEdges());
|
||||
edge_data.edgeBasedNodeID = numbered_edges_count;
|
||||
edge_data.edge_id = numbered_edges_count;
|
||||
++numbered_edges_count;
|
||||
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data.edgeBasedNodeID);
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data.edge_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -329,8 +329,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes()
|
||||
|
||||
const bool component_is_tiny = size_of_component < 1000;
|
||||
|
||||
// we only set edgeBasedNodeID for forward edges
|
||||
if (edge_data.edgeBasedNodeID == SPECIAL_NODEID)
|
||||
// we only set edge_id for forward edges
|
||||
if (edge_data.edge_id == SPECIAL_NODEID)
|
||||
{
|
||||
InsertEdgeBasedNode(node_v, node_u,
|
||||
(component_is_tiny ? id_of_smaller_component + 1 : 0));
|
||||
@ -438,7 +438,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
|
||||
const EdgeData &edge_data1 = m_node_based_graph->GetEdgeData(e1);
|
||||
const EdgeData &edge_data2 = m_node_based_graph->GetEdgeData(e2);
|
||||
|
||||
BOOST_ASSERT(edge_data1.edgeBasedNodeID != edge_data2.edgeBasedNodeID);
|
||||
BOOST_ASSERT(edge_data1.edge_id != edge_data2.edge_id);
|
||||
BOOST_ASSERT(edge_data1.forward);
|
||||
BOOST_ASSERT(edge_data2.forward);
|
||||
|
||||
@ -481,7 +481,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
|
||||
|
||||
original_edge_data_vector.emplace_back(
|
||||
(edge_is_compressed ? m_compressed_edge_container.GetPositionForID(e1) : node_v),
|
||||
edge_data1.nameID, turn_instruction, edge_is_compressed,
|
||||
edge_data1.name_id, turn_instruction, edge_is_compressed,
|
||||
edge_data2.travel_mode);
|
||||
|
||||
++original_edges_counter;
|
||||
@ -491,12 +491,11 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
|
||||
FlushVectorToStream(edge_data_file, original_edge_data_vector);
|
||||
}
|
||||
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data1.edgeBasedNodeID);
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data2.edgeBasedNodeID);
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data1.edge_id);
|
||||
BOOST_ASSERT(SPECIAL_NODEID != edge_data2.edge_id);
|
||||
|
||||
m_edge_based_edge_list.emplace_back(
|
||||
EdgeBasedEdge(edge_data1.edgeBasedNodeID, edge_data2.edgeBasedNodeID,
|
||||
m_edge_based_edge_list.size(), distance, true, false));
|
||||
m_edge_based_edge_list.emplace_back(edge_data1.edge_id, edge_data2.edge_id,
|
||||
m_edge_based_edge_list.size(), distance, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -579,11 +578,11 @@ TurnInstruction EdgeBasedGraphFactory::AnalyzeTurn(const NodeID node_u,
|
||||
|
||||
// If street names stay the same and if we are certain that it is not a
|
||||
// a segment of a roundabout, we skip it.
|
||||
if (data1.nameID == data2.nameID)
|
||||
if (data1.name_id == data2.name_id)
|
||||
{
|
||||
// TODO: Here we should also do a small graph exploration to check for
|
||||
// more complex situations
|
||||
if (0 != data1.nameID || m_node_based_graph->GetOutDegree(node_v) <= 2)
|
||||
if (0 != data1.name_id || m_node_based_graph->GetOutDegree(node_v) <= 2)
|
||||
{
|
||||
return TurnInstruction::NoTurn;
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <limits>
|
||||
|
||||
/// This is what StaticRTree serialized and stores on disk
|
||||
/// It is generated in EdgeBasedGraphFactory.
|
||||
struct EdgeBasedNode
|
||||
{
|
||||
EdgeBasedNode()
|
||||
|
@ -49,7 +49,7 @@ bool NodeBasedEdge::operator<(const NodeBasedEdge &other) const
|
||||
|
||||
NodeBasedEdge::NodeBasedEdge()
|
||||
: source(SPECIAL_NODEID), target(SPECIAL_NODEID), name_id(0), weight(0), forward(false),
|
||||
backward(false), roundabout(false), in_tiny_cc(false),
|
||||
backward(false), roundabout(false),
|
||||
access_restricted(false), is_split(false), travel_mode(false)
|
||||
{
|
||||
}
|
||||
@ -61,12 +61,11 @@ NodeBasedEdge::NodeBasedEdge(NodeID source,
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool in_tiny_cc,
|
||||
bool access_restricted,
|
||||
TravelMode travel_mode,
|
||||
bool is_split)
|
||||
: source(source), target(target), name_id(name_id), weight(weight), forward(forward),
|
||||
backward(backward), roundabout(roundabout), in_tiny_cc(in_tiny_cc),
|
||||
backward(backward), roundabout(roundabout),
|
||||
access_restricted(access_restricted), is_split(is_split), travel_mode(travel_mode)
|
||||
{
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ struct NodeBasedEdge
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool in_tiny_cc,
|
||||
bool access_restricted,
|
||||
TravelMode travel_mode,
|
||||
bool is_split);
|
||||
@ -55,7 +54,6 @@ struct NodeBasedEdge
|
||||
bool forward : 1;
|
||||
bool backward : 1;
|
||||
bool roundabout : 1;
|
||||
bool in_tiny_cc : 1;
|
||||
bool access_restricted : 1;
|
||||
bool is_split : 1;
|
||||
TravelMode travel_mode : 4;
|
||||
|
@ -39,32 +39,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
struct NodeBasedEdgeData
|
||||
{
|
||||
NodeBasedEdgeData()
|
||||
: distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID),
|
||||
nameID(std::numeric_limits<unsigned>::max()), isAccessRestricted(false), shortcut(false),
|
||||
forward(false), backward(false), roundabout(false), ignore_in_grid(false),
|
||||
travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
||||
: distance(INVALID_EDGE_WEIGHT), edge_id(SPECIAL_NODEID),
|
||||
name_id(std::numeric_limits<unsigned>::max()), access_restricted(false),
|
||||
forward(false), backward(false), roundabout(false), travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
||||
{
|
||||
}
|
||||
|
||||
NodeBasedEdgeData(int distance, unsigned edgeBasedNodeID, unsigned nameID,
|
||||
bool isAccessRestricted, bool shortcut, bool forward, bool backward,
|
||||
bool roundabout, bool ignore_in_grid, TravelMode travel_mode)
|
||||
: distance(distance), edgeBasedNodeID(edgeBasedNodeID),
|
||||
nameID(nameID), isAccessRestricted(isAccessRestricted), shortcut(shortcut),
|
||||
forward(forward), backward(backward), roundabout(roundabout), ignore_in_grid(ignore_in_grid),
|
||||
travel_mode(travel_mode)
|
||||
NodeBasedEdgeData(int distance, unsigned edge_id, unsigned name_id,
|
||||
bool access_restricted, bool forward, bool backward,
|
||||
bool roundabout, TravelMode travel_mode)
|
||||
: distance(distance), edge_id(edge_id),
|
||||
name_id(name_id), access_restricted(access_restricted),
|
||||
forward(forward), backward(backward), roundabout(roundabout), travel_mode(travel_mode)
|
||||
{
|
||||
}
|
||||
|
||||
int distance;
|
||||
unsigned edgeBasedNodeID;
|
||||
unsigned nameID;
|
||||
bool isAccessRestricted : 1;
|
||||
bool shortcut : 1;
|
||||
unsigned edge_id;
|
||||
unsigned name_id;
|
||||
bool access_restricted : 1;
|
||||
bool forward : 1;
|
||||
bool backward : 1;
|
||||
bool roundabout : 1;
|
||||
bool ignore_in_grid : 1;
|
||||
TravelMode travel_mode : 4;
|
||||
|
||||
void SwapDirectionFlags()
|
||||
@ -77,8 +73,7 @@ struct NodeBasedEdgeData
|
||||
bool IsCompatibleTo(const NodeBasedEdgeData &other) const
|
||||
{
|
||||
return (forward == other.forward) && (backward == other.backward) &&
|
||||
(nameID == other.nameID) && (ignore_in_grid == other.ignore_in_grid) &&
|
||||
(travel_mode == other.travel_mode);
|
||||
(name_id == other.name_id) && (travel_mode == other.travel_mode);
|
||||
}
|
||||
};
|
||||
|
||||
@ -211,11 +206,9 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector<NodeBasedE
|
||||
|
||||
edge.data.distance = static_cast<int>(import_edge.weight);
|
||||
BOOST_ASSERT(edge.data.distance > 0);
|
||||
edge.data.shortcut = false;
|
||||
edge.data.roundabout = import_edge.roundabout;
|
||||
edge.data.ignore_in_grid = import_edge.in_tiny_cc;
|
||||
edge.data.nameID = import_edge.name_id;
|
||||
edge.data.isAccessRestricted = import_edge.access_restricted;
|
||||
edge.data.name_id = import_edge.name_id;
|
||||
edge.data.access_restricted = import_edge.access_restricted;
|
||||
edge.data.travel_mode = import_edge.travel_mode;
|
||||
|
||||
edges_list.push_back(edge);
|
||||
|
@ -51,7 +51,6 @@ struct ExtractionWay
|
||||
duration = -1;
|
||||
roundabout = false;
|
||||
is_access_restricted = false;
|
||||
ignore_in_grid = false;
|
||||
name.clear();
|
||||
forward_travel_mode = TRAVEL_MODE_DEFAULT;
|
||||
backward_travel_mode = TRAVEL_MODE_DEFAULT;
|
||||
@ -121,7 +120,6 @@ struct ExtractionWay
|
||||
std::string name;
|
||||
bool roundabout;
|
||||
bool is_access_restricted;
|
||||
bool ignore_in_grid;
|
||||
TravelMode forward_travel_mode : 4;
|
||||
TravelMode backward_travel_mode : 4;
|
||||
};
|
||||
|
@ -183,8 +183,8 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
|
||||
{
|
||||
external_memory.all_edges_list.push_back(InternalExtractorEdge(
|
||||
first_node.ref(), last_node.ref(), name_id, backward_weight_data,
|
||||
true, false, parsed_way.roundabout, parsed_way.ignore_in_grid,
|
||||
parsed_way.is_access_restricted, parsed_way.backward_travel_mode, false));
|
||||
true, false, parsed_way.roundabout, parsed_way.is_access_restricted,
|
||||
parsed_way.backward_travel_mode, false));
|
||||
});
|
||||
|
||||
external_memory.way_start_end_id_list.push_back(
|
||||
@ -205,8 +205,8 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
|
||||
{
|
||||
external_memory.all_edges_list.push_back(InternalExtractorEdge(
|
||||
first_node.ref(), last_node.ref(), name_id, forward_weight_data,
|
||||
true, !forward_only, parsed_way.roundabout, parsed_way.ignore_in_grid,
|
||||
parsed_way.is_access_restricted, parsed_way.forward_travel_mode, split_edge));
|
||||
true, !forward_only, parsed_way.roundabout, parsed_way.is_access_restricted,
|
||||
parsed_way.forward_travel_mode, split_edge));
|
||||
});
|
||||
if (split_edge)
|
||||
{
|
||||
@ -216,8 +216,8 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
|
||||
{
|
||||
external_memory.all_edges_list.push_back(InternalExtractorEdge(
|
||||
first_node.ref(), last_node.ref(), name_id, backward_weight_data,
|
||||
false, true, parsed_way.roundabout, parsed_way.ignore_in_grid,
|
||||
parsed_way.is_access_restricted, parsed_way.backward_travel_mode, true));
|
||||
false, true, parsed_way.roundabout, parsed_way.is_access_restricted,
|
||||
parsed_way.backward_travel_mode, true));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ struct InternalExtractorEdge
|
||||
};
|
||||
|
||||
explicit InternalExtractorEdge()
|
||||
: result(0, 0, 0, 0, false, false, false, false, false,
|
||||
: result(0, 0, 0, 0, false, false, false, false,
|
||||
TRAVEL_MODE_INACCESSIBLE, false)
|
||||
{
|
||||
}
|
||||
@ -74,12 +74,11 @@ struct InternalExtractorEdge
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool in_tiny_cc,
|
||||
bool access_restricted,
|
||||
TravelMode travel_mode,
|
||||
bool is_split)
|
||||
: result(source, target, name_id, 0, forward, backward, roundabout,
|
||||
in_tiny_cc, access_restricted, travel_mode, is_split),
|
||||
access_restricted, travel_mode, is_split),
|
||||
weight_data(weight_data)
|
||||
{
|
||||
}
|
||||
@ -96,11 +95,11 @@ struct InternalExtractorEdge
|
||||
static InternalExtractorEdge min_value()
|
||||
{
|
||||
return InternalExtractorEdge(0, 0, 0, WeightData(), false, false, false,
|
||||
false, false, TRAVEL_MODE_INACCESSIBLE, false);
|
||||
false, TRAVEL_MODE_INACCESSIBLE, false);
|
||||
}
|
||||
static InternalExtractorEdge max_value()
|
||||
{
|
||||
return InternalExtractorEdge(SPECIAL_NODEID, SPECIAL_NODEID, 0, WeightData(), false, false,
|
||||
return InternalExtractorEdge(SPECIAL_NODEID, SPECIAL_NODEID, 0, WeightData(), false,
|
||||
false, false, false, TRAVEL_MODE_INACCESSIBLE, false);
|
||||
}
|
||||
};
|
||||
|
@ -107,7 +107,6 @@ void ScriptingEnvironment::init_lua_state(lua_State *lua_state)
|
||||
.def_readwrite("name", &ExtractionWay::name)
|
||||
.def_readwrite("roundabout", &ExtractionWay::roundabout)
|
||||
.def_readwrite("is_access_restricted", &ExtractionWay::is_access_restricted)
|
||||
.def_readwrite("ignore_in_index", &ExtractionWay::ignore_in_grid)
|
||||
.def_readwrite("duration", &ExtractionWay::duration)
|
||||
.property("forward_mode", &ExtractionWay::get_forward_mode,
|
||||
&ExtractionWay::set_forward_mode)
|
||||
|
@ -10,7 +10,6 @@ access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
|
||||
access_tags = { "motorcar", "motor_vehicle", "vehicle" }
|
||||
access_tags_hierachy = { "motorcar", "motor_vehicle", "vehicle", "access" }
|
||||
service_tag_restricted = { ["parking_aisle"] = true }
|
||||
ignore_in_grid = { ["ferry"] = true }
|
||||
restriction_exception_tags = { "motorcar", "motor_vehicle", "vehicle" }
|
||||
|
||||
speed_profile = {
|
||||
@ -393,11 +392,6 @@ function way_function (way, result)
|
||||
result.backward_speed = maxspeed_backward
|
||||
end
|
||||
|
||||
-- Override general direction settings of there is a specific one for our mode of travel
|
||||
if ignore_in_grid[highway] then
|
||||
result.ignore_in_grid = true
|
||||
end
|
||||
|
||||
local width = math.huge
|
||||
local lanes = math.huge
|
||||
if result.forward_speed > 0 or result.backward_speed > 0 then
|
||||
|
@ -46,15 +46,15 @@ BOOST_AUTO_TEST_CASE(long_road_test)
|
||||
|
||||
using InputEdge = NodeBasedDynamicGraph::InputEdge;
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edgeBasedNodeID, nameID, isAccessRestricted, shortcut, forward, backward, roundabout, ignore_in_grid, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT}
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT}
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[2].data));
|
||||
@ -88,19 +88,19 @@ BOOST_AUTO_TEST_CASE(loop_test)
|
||||
|
||||
using InputEdge = NodeBasedDynamicGraph::InputEdge;
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edgeBasedNodeID, nameID, isAccessRestricted, shortcut, forward, backward, roundabout, ignore_in_grid, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{0, 5, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 5, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{5, 0, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{5, 4, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{0, 5, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{4, 5, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{5, 0, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{5, 4, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges.size() == 12);
|
||||
@ -145,13 +145,13 @@ BOOST_AUTO_TEST_CASE(t_intersection)
|
||||
|
||||
using InputEdge = NodeBasedDynamicGraph::InputEdge;
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edgeBasedNodeID, nameID, isAccessRestricted, shortcut, forward, backward, roundabout, ignore_in_grid, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 3, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 3, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{3, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[1].data));
|
||||
@ -183,11 +183,11 @@ BOOST_AUTO_TEST_CASE(street_name_changes)
|
||||
|
||||
using InputEdge = NodeBasedDynamicGraph::InputEdge;
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edgeBasedNodeID, nameID, isAccessRestricted, shortcut, forward, backward, roundabout, ignore_in_grid, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 1, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 1, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 1, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 1, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[1].data));
|
||||
@ -215,11 +215,11 @@ BOOST_AUTO_TEST_CASE(direction_changes)
|
||||
|
||||
using InputEdge = NodeBasedDynamicGraph::InputEdge;
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edgeBasedNodeID, nameID, isAccessRestricted, shortcut, forward, backward, roundabout, ignore_in_grid, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, true, false, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, true, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, true, false, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, true, true, false, TRAVEL_MODE_DEFAULT},
|
||||
};
|
||||
|
||||
NodeBasedDynamicGraph graph(5, edges);
|
||||
|
Loading…
Reference in New Issue
Block a user