pub struct Outcome {
pub choices: Vec<String>,
pub agents: Vec<AgentLimit>,
pub settling: Settling,
pub consensus: Option<Vec<f64>>,
pub factions: Vec<Vec<String>>,
pub rounds: usize,
pub budget_reached: bool,
pub trust: TrustSource,
pub susceptibility: f64,
pub spread: f64,
}Expand description
The result of running DeGroot over one issue’s ballots.
Fields§
§choices: Vec<String>Distinct choices, sorted, indexing every limit vector.
agents: Vec<AgentLimit>One row per voting agent, sorted by identity.
settling: SettlingWhether the iteration settled, and on what.
consensus: Option<Vec<f64>>The shared limit when the group agreed, aligned with choices.
factions: Vec<Vec<String>>Agents grouped by the opinion they settled on, when they did not agree.
rounds: usizeRounds the iteration took.
budget_reached: boolWhether the iteration stopped because it ran out of rounds rather than because it settled. The shares are then an estimate, not the limit.
trust: TrustSourceWhether any voting agent had a configured trust row.
susceptibility: f64The susceptibility an agent gets when nothing names it. One is DeGroot;
below one is Friedkin and Johnsen. A named agent carries its own on
AgentLimit::susceptibility.
spread: f64The largest gap left between any two agents on any one choice.
Zero within tolerance when they agreed. Under an anchor it is the disagreement the group keeps, which is the quantity worth reading.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn leader(&self) -> Option<(&str, f64)>
pub fn leader(&self) -> Option<(&str, f64)>
The winning choice and its share, when the group agreed and one choice leads.
None on a split, on an oscillation, and on an exact tie inside a
consensus, because reporting the first of two equal options as the
group’s position is how a coin toss gets recorded as agreement.
Source§impl Outcome
impl Outcome
Sourcepub fn settled(&self) -> bool
pub fn settled(&self) -> bool
Whether a gate over this issue should pass.
True only when the group agreed and one choice leads. A plurality, a tie, a split and an oscillation are all cases where acting on the number would be acting on agreement that is not there, which is what the verb exists to make visible.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Outcome
impl<'de> Deserialize<'de> for Outcome
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Outcome
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe for Outcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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