(svn r26549) -Change: better estimation for link capacities during full load

This commit is contained in:
fonsinchen
2014-05-01 14:50:52 +00:00
parent d5bd72296b
commit b8381b6b25
8 changed files with 98 additions and 74 deletions

View File

@@ -40,22 +40,6 @@ extern LinkGraphPool _link_graph_pool;
class LinkGraph : public LinkGraphPool::PoolItem<&_link_graph_pool> {
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
@@ -313,7 +297,7 @@ public:
* @param edge Edge to be wrapped.
*/
Edge(BaseEdge &edge) : EdgeWrapper<BaseEdge>(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);
};