Module type S.VIEW
Gossip view
val empty : temptyis the empty view.
val length : t -> intlengh treturns the number of nodes in viewt
val is_empty : t -> boolis_empty treturns true if there are no nodes in viewt
val oldest : t -> node optionoldest treturns the oldest node in view. In case there are multiple oldest nodes, picks a random one of those.
val uniform_sample : int -> t -> tuniform_sample n treturns a uniform random sample of viewtof lengthn.
val weighted_sample : int -> t -> tweighted_sample n treturns a weighted random sample of viewtof lengthn, weighted by their trust values.
val adjust_trust : float -> t -> tadjust_trust r tadjust the trust value of all nodes intby multiplying each withr.
val filter_trust : float -> t -> tfilter_trust min_trust tremove nodes with trust value less thanmin_trust
val min_trust : t -> floatmin_trust treturns the minimum trust value int
val max_trust : t -> floatmax_trust treturns the maximum trust value int
val sum_trust : t -> floatsum_trust treturns the sum of trust values int
val filter : (nid -> node -> bool) -> t -> tval fold : (nid -> node -> 'a -> 'a) -> t -> 'a -> 'aval iter : (nid -> node -> unit) -> t -> unitval map : (nid -> node -> node) -> t -> tval to_list : t -> node listval of_list : node list -> tval pp : Stdlib.Format.formatter -> t -> unitpp ppf tpretty-prints viewt