MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetNode

Method SetNode

src/linkgraph/mcf.cpp:166–177  ·  view source on GitHub ↗

* Setup the node to retrieve edges from. * @param source Root of the current path tree. * @param node Current node to be checked for outgoing flows. */

Source from the content-addressed store, hash-verified

164 * @param node Current node to be checked for outgoing flows.
165 */
166 void SetNode(NodeID source, NodeID node)
167 {
168 const FlowStatMap &flows = this->job[node].flows;
169 FlowStatMap::const_iterator it = flows.find(this->job[source].base.station);
170 if (it != flows.end()) {
171 this->it = it->second.GetShares()->begin();
172 this->end = it->second.GetShares()->end();
173 } else {
174 this->it = FlowStat::empty_sharesmap.begin();
175 this->end = FlowStat::empty_sharesmap.end();
176 }
177 }
178
179 /**
180 * Get the next node for which a flow exists.

Callers 1

DijkstraMethod · 0.45

Calls 4

GetSharesMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected