Commit aaee3a92 authored by Dan Sheppard's avatar Dan Sheppard
Browse files

Fix random dropoff bug.

parent 22c6774a
......@@ -19,6 +19,14 @@ impl Leaf {
pub fn get_scale(&self) -> &Scale { &self.scale }
pub fn total_bp(&self) -> f64 { self.scale.total_bp() }
pub fn get_start(&self) -> f64 {
(self.get_index() as f64 * self.total_bp()).floor()
}
pub fn get_end(&self) -> f64 {
((self.get_index()+1) as f64 * self.total_bp()).ceil()
}
}
impl fmt::Debug for Leaf {
......
......@@ -26,4 +26,8 @@ impl StaleCarriages {
pub fn not_stale(&mut self, leaf: &Leaf) {
self.done_seen.insert(leaf.clone(),self.done_now);
}
pub fn set_stale(&mut self, leaf: &Leaf) {
self.done_seen.remove(&leaf.clone());
}
}
......@@ -111,6 +111,7 @@ impl Train {
for d in doomed {
debug!("trains","removing {}",d.get_index());
self.carriages.remove_leaf(&d);
self.stale.set_stale(&d);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment