Telenav / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
18 stars 7 forks source link

Multi-metric or dynamic weight calculation support #372

Open wangyoucao577 opened 4 years ago

wangyoucao577 commented 4 years ago

Some important references/discussion

wangyoucao577 commented 4 years ago

https://github.com/Telenav/osrm-backend/blob/d21e5dd286a3f296ae529c0c3a2166939af895e3/src/storage/storage.cpp#L327-L334 lists all the metric related files.
https://github.com/Telenav/osrm-backend/blob/d21e5dd286a3f296ae529c0c3a2166939af895e3/src/storage/storage.cpp#L509 shows operation on these updatable files.

CodeBear801 commented 4 years ago

Another place need to pay attention to is here: https://github.com/Telenav/osrm-backend/blob/6900e30070a4ed3f1ca59004d57010a344cc7c9b/include/engine/datafacade/contiguous_internalmem_datafacade.hpp#L176

template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
{

    void InitializeInternalPointers(const storage::SharedDataIndex &index,
                                    const std::string &metric_name,
                                    const std::size_t exclude_index)
    {
        mld_partition = make_partition_view(index, "/mld/multilevelpartition");
        mld_cell_metric =
            make_filtered_cell_metric_view(index, "/mld/metrics/" + metric_name, exclude_index);
        mld_cell_storage = make_cell_storage_view(index, "/mld/cellstorage");
        query_graph = make_multi_level_graph_view(index, "/mld/multilevelgraph");
    }

    void InitializeInternalPointers(const storage::SharedDataIndex &index,
                                    const std::string &metric_name,
                                    const std::size_t exclude_index)
    {
        // TODO: For multi-metric support we need to have separate exclude classes per metric