File diff r21350:0c85f6f7d752 → r21351:95eabab86f13
src/linkgraph/flowmapper.cpp
Show inline comments
 
@@ -46,14 +46,16 @@ void FlowMapper::Run(LinkGraphJob &job) 
 
	for (NodeID node_id = 0; node_id < job.Size(); ++node_id) {
 
		/* Remove local consumption shares marked as invalid. */
 
		Node node = job[node_id];
 
		FlowStatMap &flows = node.Flows();
 
		flows.FinalizeLocalConsumption(node.Station());
 
		if (this->scale) {
 
			/* Scale by time the graph has been running without being compressed. */
 
			uint runtime = job.JoinDate() - job.Settings().recalc_time - job.LastCompression();
 
			/* Scale by time the graph has been running without being compressed. Add 1 to avoid
 
			 * division by 0 if spawn date == last compression date. This matches
 
			 * LinkGraph::Monthly(). */
 
			uint runtime = job.JoinDate() - job.Settings().recalc_time - job.LastCompression() + 1;
 
			for (FlowStatMap::iterator i = flows.begin(); i != flows.end(); ++i) {
 
				i->second.ScaleToMonthly(runtime);
 
			}
 
		}
 
		/* Clear paths. */
 
		PathList &paths = node.Paths();