diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -41,22 +41,6 @@ class LinkGraph : public LinkGraphPool:: public: /** - * Special modes for updating links. 'Restricted' means that vehicles with - * 'no loading' orders are serving the link. If a link is only served by - * such vehicles it's 'fully restricted'. This means the link can be used - * by cargo arriving in such vehicles, but not by cargo generated or - * transferring at the source station of the link. In order to find out - * about this condition we keep two update timestamps in each link, one for - * the restricted and one for the unrestricted part of it. If either one - * times out while the other is still valid the link becomes fully - * restricted or fully unrestricted, respectively. - */ - enum UpdateMode { - REFRESH_RESTRICTED = UINT_MAX - 1, ///< Refresh restricted link. - REFRESH_UNRESTRICTED = UINT_MAX ///< Refresh unrestricted link. - }; - - /** * Node of the link graph. contains all relevant information from the associated * station. It's copied so that the link graph job can work on its own data set * in a separate thread. @@ -313,7 +297,7 @@ public: * @param edge Edge to be wrapped. */ Edge(BaseEdge &edge) : EdgeWrapper(edge) {} - void Update(uint capacity, uint usage); + void Update(uint capacity, uint usage, EdgeUpdateMode mode); void Restrict() { this->edge.last_unrestricted_update = INVALID_DATE; } void Release() { this->edge.last_restricted_update = INVALID_DATE; } }; @@ -437,8 +421,8 @@ public: this->node.demand = demand; } - void AddEdge(NodeID to, uint capacity, uint usage = 0); - void UpdateEdge(NodeID to, uint capacity, uint usage = 0); + void AddEdge(NodeID to, uint capacity, uint usage, EdgeUpdateMode mode); + void UpdateEdge(NodeID to, uint capacity, uint usage, EdgeUpdateMode mode); void RemoveEdge(NodeID to); };