refactoring
This commit is contained in:
parent
04e87c1d9c
commit
64b83f569c
24 changed files with 186 additions and 310 deletions
|
|
@ -76,24 +76,27 @@ void EdgePL::setCost(const router::EdgeCost& c) { _cost = c; }
|
|||
|
||||
|
||||
// _____________________________________________________________________________
|
||||
void EdgePL::getAttrs(std::map<std::string, std::string>* obj) const {
|
||||
(*obj)["cost"] = std::to_string(_cost.getValue());
|
||||
(*obj)["from_edge"] = util::toString(_startE);
|
||||
(*obj)["to_edge"] = util::toString(_endE);
|
||||
(*obj)["cost_m_lvl1"] = std::to_string(_cost.meterDistLvl1);
|
||||
(*obj)["cost_m_lvl0"] = std::to_string(_cost.meterDist);
|
||||
(*obj)["cost_m_lvl1"] = std::to_string(_cost.meterDistLvl1);
|
||||
(*obj)["cost_m_lvl2"] = std::to_string(_cost.meterDistLvl2);
|
||||
(*obj)["cost_m_lvl3"] = std::to_string(_cost.meterDistLvl3);
|
||||
(*obj)["cost_m_lvl4"] = std::to_string(_cost.meterDistLvl4);
|
||||
(*obj)["cost_m_lvl5"] = std::to_string(_cost.meterDistLvl5);
|
||||
(*obj)["cost_m_lvl6"] = std::to_string(_cost.meterDistLvl6);
|
||||
(*obj)["cost_m_lvl7"] = std::to_string(_cost.meterDistLvl7);
|
||||
(*obj)["cost_fullturn"] = std::to_string(_cost.fullTurns);
|
||||
(*obj)["cost_st_passthru"] = std::to_string(_cost.passThruStations);
|
||||
(*obj)["cost_m_oneway"] = std::to_string(_cost.oneWayMeters);
|
||||
(*obj)["cost_m_lineunmatch"] = std::to_string(_cost.lineUnmatchedMeters);
|
||||
(*obj)["cost_reach_node_pen"] = std::to_string(_cost.reachPen);
|
||||
(*obj)["cost_oneway_event"] = std::to_string(_cost.oneWayEdges);
|
||||
(*obj)["dummy"] = _edges.size() ? "no" : "yes";
|
||||
util::json::Dict EdgePL::getAttrs() const {
|
||||
util::json::Dict obj;
|
||||
obj["cost"] = std::to_string(_cost.getValue());
|
||||
obj["from_edge"] = util::toString(_startE);
|
||||
obj["to_edge"] = util::toString(_endE);
|
||||
obj["cost_m_lvl1"] = std::to_string(_cost.meterDistLvl1);
|
||||
obj["cost_m_lvl0"] = std::to_string(_cost.meterDist);
|
||||
obj["cost_m_lvl1"] = std::to_string(_cost.meterDistLvl1);
|
||||
obj["cost_m_lvl2"] = std::to_string(_cost.meterDistLvl2);
|
||||
obj["cost_m_lvl3"] = std::to_string(_cost.meterDistLvl3);
|
||||
obj["cost_m_lvl4"] = std::to_string(_cost.meterDistLvl4);
|
||||
obj["cost_m_lvl5"] = std::to_string(_cost.meterDistLvl5);
|
||||
obj["cost_m_lvl6"] = std::to_string(_cost.meterDistLvl6);
|
||||
obj["cost_m_lvl7"] = std::to_string(_cost.meterDistLvl7);
|
||||
obj["cost_fullturn"] = std::to_string(_cost.fullTurns);
|
||||
obj["cost_st_passthru"] = std::to_string(_cost.passThruStations);
|
||||
obj["cost_m_oneway"] = std::to_string(_cost.oneWayMeters);
|
||||
obj["cost_m_lineunmatch"] = std::to_string(_cost.lineUnmatchedMeters);
|
||||
obj["cost_reach_node_pen"] = std::to_string(_cost.reachPen);
|
||||
obj["cost_oneway_event"] = std::to_string(_cost.oneWayEdges);
|
||||
obj["dummy"] = _edges.size() ? "no" : "yes";
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue