Print the edge distortions

This commit is contained in:
Aaron Fenyes 2025-09-19 14:32:50 -07:00
parent b74cbf10c1
commit cc2da3406b
3 changed files with 73 additions and 5 deletions

View file

@ -367,6 +367,9 @@ pub trait Regulator: Serial + ProblemPoser + OutlineItem {
fn subjects(&self) -> Vec<Rc<dyn Element>>;
fn measurement(&self) -> ReadSignal<f64>;
fn set_point(&self) -> Signal<SpecifiedValue>;
fn soft(&self) -> Option<Signal<bool>> {
None
}
fn distortion(&self) -> Option<ReadSignal<f64>> { /* KLUDGE */
None
}
@ -426,8 +429,8 @@ impl InversiveDistanceRegulator {
match set_point_opt {
None => 0.0,
Some(set_point_val) => SQRT_2 * (
(-set_point_val).sqrt() - (-measurement_val).sqrt()
).abs(),
(-measurement_val).sqrt() - (-set_point_val).sqrt()
),
}
}))
} else {
@ -453,6 +456,10 @@ impl Regulator for InversiveDistanceRegulator {
self.set_point
}
fn soft(&self) -> Option<Signal<bool>> {
Some(self.soft)
}
fn distortion(&self) -> Option<ReadSignal<f64>> {
self.distortion
}