pub struct Step {
pub advance: u8,
pub cost: f32,
}Expand description
One transition of a Trellis: how far it moves, and what it costs.
Fields§
§advance: u8How many positions it advances. Read into a cell it comes from
position - advance; read out of one it goes to position + advance.
Must not exceed Trellis::REACH.
cost: f32The whole cost of taking it in this frame: a structural penalty and whatever the frame charges for what it reads, already multiplied together. Costs are negative log probabilities, so smaller is better.
Implementations§
Source§impl Step
impl Step
Sourcepub const ABSENT: Self
pub const ABSENT: Self
A transition that is not available at this cell.
A trellis has the same number of transitions everywhere, which is the
meaning of Trellis’s DEGREE, so an edge case is expressed by a
transition costing infinity rather than by returning fewer of them. It
is also the only way to say “this one would run off the start”, which
the solver relies on: a step whose advance exceeds its cell’s position
must be absent.