OpenTTD Source: MCF2ndPass Class Reference

OpenTTD Source 12.2

Public Member Functions
MCF2ndPass Class Reference

Second pass of the MCF calculation. More...

`#include <mcf.h>`

Inheritance diagram for MCF2ndPass:

## Public Member Functions
| MCF2ndPass (LinkGraphJob &job)
| Run the second pass of the MCF calculation which assigns all remaining demands to existing paths. More...

## Additional Inherited Members
Protected Member Functions inherited from MultiCommodityFlow
| MultiCommodityFlow (LinkGraphJob &job)
| Constructor. More...
template<class Tannotation , class Tedge_iterator >
void | Dijkstra (NodeID from, PathVector &paths)
| A slightly modified Dijkstra algorithm. More...
uint | PushFlow (Edge &edge, Path *path, uint accuracy, uint max_saturation)
| Push flow along a path and update the unsatisfied_demand of the associated edge. More...
void | CleanupPaths (NodeID source, PathVector &paths)
| Clean up paths that lead nowhere and the root path. More...
Protected Attributes inherited from MultiCommodityFlow
LinkGraphJob & | job
| Job we're working with.
uint | max_saturation
| Maximum saturation for edges.

## Detailed Description

Second pass of the MCF calculation.

Saturates paths with most capacity left first and doesn't create any paths along edges that haven't been visited in the first pass. This is why it doesn't have to do any cycle detection and elimination. As cycle detection is the most intense problem in the first pass this pass is cheaper. The accuracy is used here, too.

Definition at line 67 of file mcf.h.

## Constructor & Destructor Documentation

## ◆ MCF2ndPass()

MCF2ndPass::MCF2ndPass | ( | LinkGraphJob & | job | ) |

Run the second pass of the MCF calculation which assigns all remaining demands to existing paths.

Parameters

  job | Link graph job to calculate.

Definition at line 548 of file mcf.cpp.

References LinkGraphSettings::accuracy, MultiCommodityFlow::CleanupPaths(), Path::GetFreeCapacity(), LinkGraphJob::IsJobAborted(), MultiCommodityFlow::job, MultiCommodityFlow::max_saturation, MultiCommodityFlow::PushFlow(), LinkGraphJob::Settings(), and LinkGraphJob::Size().

The documentation for this class was generated from the following files:

- src/linkgraph/mcf.h
- src/linkgraph/mcf.cpp