pub struct PreferenceEngineConfig {
pub participants: Vec<AgentId>,
pub neighbors: Vec<Vec<usize>>,
pub preferences: Vec<f64>,
pub beta: f64,
pub z_star: Vec<f64>,
}Expand description
Line (or general graph) quadratic-preference instance.
Fields§
§participants: Vec<AgentId>§neighbors: Vec<Vec<usize>>§preferences: Vec<f64>§beta: f64§z_star: Vec<f64>Implementations§
Source§impl PreferenceEngineConfig
impl PreferenceEngineConfig
Sourcepub fn new(
participants: Vec<AgentId>,
neighbors: Vec<Vec<usize>>,
preferences: Vec<f64>,
beta: f64,
) -> Result<PreferenceEngineConfig, String>
pub fn new( participants: Vec<AgentId>, neighbors: Vec<Vec<usize>>, preferences: Vec<f64>, beta: f64, ) -> Result<PreferenceEngineConfig, String>
Build a config. z* is (I + 2β L)^{-1} c.
Sourcepub fn line(
n: usize,
c_span: f64,
beta: f64,
) -> Result<PreferenceEngineConfig, String>
pub fn line( n: usize, c_span: f64, beta: f64, ) -> Result<PreferenceEngineConfig, String>
Path graph with uniformly spaced preferences, paper β = 0.75.
Sourcepub fn line_with_participants(
participants: Vec<AgentId>,
c_span: f64,
beta: f64,
) -> Result<PreferenceEngineConfig, String>
pub fn line_with_participants( participants: Vec<AgentId>, c_span: f64, beta: f64, ) -> Result<PreferenceEngineConfig, String>
Path graph with caller-supplied participant ids.
pub fn index_of(&self, id: &AgentId) -> Option<usize>
pub fn degree(&self, i: usize) -> usize
Sourcepub fn jacobi(
&self,
node: usize,
inbox: &BTreeMap<usize, f64>,
) -> Result<f64, String>
pub fn jacobi( &self, node: usize, inbox: &BTreeMap<usize, f64>, ) -> Result<f64, String>
Local Jacobi step from a neighbor inbox (values at the previous iterate).
pub fn corollary_bound(&self, victim: usize, neighbor_delta: f64) -> f64
Trait Implementations§
Source§impl Clone for PreferenceEngineConfig
impl Clone for PreferenceEngineConfig
Source§fn clone(&self) -> PreferenceEngineConfig
fn clone(&self) -> PreferenceEngineConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PreferenceEngineConfig
impl Debug for PreferenceEngineConfig
Source§impl PartialEq for PreferenceEngineConfig
impl PartialEq for PreferenceEngineConfig
impl StructuralPartialEq for PreferenceEngineConfig
Auto Trait Implementations§
impl Freeze for PreferenceEngineConfig
impl RefUnwindSafe for PreferenceEngineConfig
impl Send for PreferenceEngineConfig
impl Sync for PreferenceEngineConfig
impl Unpin for PreferenceEngineConfig
impl UnsafeUnpin for PreferenceEngineConfig
impl UnwindSafe for PreferenceEngineConfig
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more