use crate::time::{Duration, Epoch};
use crate::linalg::allocator::Allocator;
use crate::linalg::{DefaultAllocator, DimName, OVector};
pub trait State<T, U>
where
T: DimName,
U: DimName,
DefaultAllocator: Allocator<f64, U> + Allocator<f64, T>,
{
fn state(&self) -> &OVector<f64, T> {
unimplemented!()
}
fn set_state(&mut self, _state: OVector<f64, T>) {
unimplemented!()
}
fn epoch(&self) -> Epoch {
unimplemented!()
}
fn set_epoch(&mut self, _epoch: Epoch) {
unimplemented!()
}
fn propagate(
&mut self,
dynamics: &dyn Fn(&OVector<f64, T>, &OVector<f64, U>, Duration) -> OVector<f64, T>,
dt: Duration,
external: OVector<f64, U>,
) {
self.set_state(dynamics(&self.state(), &external, dt));
self.set_epoch(self.epoch() + dt);
}
}