use semirings::Semiring;
use Label;
use StateId;
#[derive(Debug, Clone, PartialEq)]
pub struct Arc<W: Semiring> {
pub ilabel: Label,
pub olabel: Label,
pub weight: W,
pub nextstate: StateId,
}
impl<W: Semiring> Arc<W> {
pub fn new(ilabel: Label, olabel: Label, weight: W, nextstate: StateId) -> Self {
Arc {
ilabel,
olabel,
weight,
nextstate,
}
}
pub fn set_value(&mut self, arc: &Arc<W>) {
self.ilabel = arc.ilabel;
self.olabel = arc.olabel;
self.weight = arc.weight.clone();
self.nextstate = arc.nextstate;
}
}