-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Current StickSequence looks like this:
pub struct _Inner {
#[cfg_attr(feature = "serde1", serde(skip, default = "default_rng"))]
rng: Xoshiro256Plus,
ccdf: Vec<f64>,
}
pub struct StickSequence {
breaker: UnitPowerLaw,
inner: Arc<RwLock<_Inner>>,
}Here the ccdf is extended on demand. This is deterministic, so in principle there's no need for writing the nth value to affect another thread trying to read some k < nth value. But the current implementation doesn't encode this independence, and we're forced to choose between one writer or multiple readers.
One possibility for improving this is to switch to lazy_list. Let's try this. If it's not an exact fit we may need to implement something custom, but it would be better to just plug in an existing crate.
Metadata
Metadata
Assignees
Labels
No labels