OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
LinkRefresher::Hop Struct Reference

A hop the refresh algorithm might evaluate. More...

`#include <refresh.h>`

## Public Member Functions
| Hop ()
| Default constructor should not be called but has to be visible for usage in std::set.
| Hop (OrderID from, OrderID to, CargoID cargo)
| Real constructor, only use this one.
bool | operator< (const Hop &other) const
| Comparison operator to allow hops to be used in a std::set.

## Data Fields
OrderID | from
| Last order where vehicle could interact with cargo or absolute first order.
OrderID | to
| Next order to be processed.
CargoID | cargo
| Cargo the consist is probably carrying or CT_INVALID if unknown.

## Detailed Description

A hop the refresh algorithm might evaluate.

If the same hop is seen again the evaluation is stopped. This of course is a fairly simple heuristic. Sequences of refit orders can produce vehicles with all kinds of different cargoes and remembering only one can lead to early termination of the algorithm. However, as the order language is Turing complete, we are facing the halting problem here. At some point we have to draw the line.

Definition at line 61 of file refresh.h.

## Constructor & Destructor Documentation

LinkRefresher::Hop::Hop | ( | OrderID | from,
|  | OrderID | to,
|  | CargoID | cargo
| ) |  |
| inline

Real constructor, only use this one.

Parameters

  from | First order of the hop.
  to | Second order of the hop.
  cargo | Cargo the consist is probably carrying when passing the hop.

Definition at line 78 of file refresh.h.

## Member Function Documentation

bool LinkRefresher::Hop::operator< | ( | const Hop & | other | ) | const

Comparison operator to allow hops to be used in a std::set.

Parameters

  other | Other hop to be compared with.

Returns
  If this hop is "smaller" than the other (defined by from, to and cargo in this order).

Definition at line 48 of file refresh.cpp.

References cargo, from, and to.

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

- src/linkgraph/refresh.h
- src/linkgraph/refresh.cpp