* Creates an edge if none exists yet or updates an existing edge. * @param to Target node. * @param capacity Capacity of the link. * @param usage Usage to be added. * @param mode Update mode to be used. */
| 184 | * @param mode Update mode to be used. |
| 185 | */ |
| 186 | void LinkGraph::BaseNode::UpdateEdge(NodeID to, uint capacity, uint usage, uint32_t travel_time, EdgeUpdateModes modes) |
| 187 | { |
| 188 | assert(capacity > 0); |
| 189 | assert(usage <= capacity); |
| 190 | if (!this->HasEdgeTo(to)) { |
| 191 | this->AddEdge(to, capacity, usage, travel_time, modes); |
| 192 | } else { |
| 193 | this->GetEdge(to)->Update(capacity, usage, travel_time, modes); |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Remove an outgoing edge from this node. |
no test coverage detected