pub struct NetworkCodingParams {
pub ph: f64,
pub k: usize,
pub n: usize,
pub q: f64,
pub peer_count: usize,
pub mu: f64,
pub sigma: f64,
}Expand description
Coding parameters computed for a specific network state and target Ph.
Stored in the FileManifest
at upload time and used by the daemon to determine how many fragments to
generate and distribute per chunk.
Fields§
§ph: f64Target recovery probability requested at computation time.
k: usizeRecovery threshold: the minimum fragments needed to reconstruct a chunk.
n: usizeTotal fragments to generate per chunk (= k + redundancy).
q: f64Effective redundancy overhead: (n − k) / k.
peer_count: usizeNumber of Pouch peers considered in this computation.
mu: f64Poisson-Binomial mean μ = Σ p_i.
sigma: f64Poisson-Binomial std-dev σ = sqrt(Σ p_i·(1−p_i)).
Implementations§
Source§impl NetworkCodingParams
impl NetworkCodingParams
Sourcepub fn effective_probability(&self) -> f64
pub fn effective_probability(&self) -> f64
Effective recovery probability given the same set of stability scores.
Useful for re-evaluating pe with updated QoS data after upload.
Trait Implementations§
Source§impl Clone for NetworkCodingParams
impl Clone for NetworkCodingParams
Source§fn clone(&self) -> NetworkCodingParams
fn clone(&self) -> NetworkCodingParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NetworkCodingParams
impl RefUnwindSafe for NetworkCodingParams
impl Send for NetworkCodingParams
impl Sync for NetworkCodingParams
impl Unpin for NetworkCodingParams
impl UnwindSafe for NetworkCodingParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more