consensus

consensus

Who agrees, weighted by who listens to whom.

DeGroot and Friedkin-Johnsen settles over ballots and a trust graph.

Discrete model Seldon export JSON in, JSON out

A tally counts ballots. A settle weighs them: each voter listens to the voters it trusts and moves toward their opinion. Where that iteration stops is the group’s position. ljos-consensus is the discrete model as one binary: ballots and trust rows in, shares and rounds out. It can also write the inputs for the Seldon opinion-dynamics engine and read its output.

Install#

$ cargo binstall --locked ljos-consensus
$ ljos-consensus settle --ballots '[{"agent":"a","choice":"ship"},{"agent":"b","choice":"hold"}]'

First minute#

$ cargo binstall --locked ljos-consensus
$ ljos-consensus settle --ballots '[{"agent":"alice","choice":"ship"},{"agent":"bob","choice":"hold"}]' | jq -c
{"options":["hold","ship"],"shares":[0.5,0.5],"rounds":1,"settled":true,"residual":0.0,"engine":"degroot-fj","polarization":0.0,"disagreement":0.0,"agents":["alice","bob"],"influence":[0.5,0.5],"effective_voters":2.0,"margin":0.0,"tie":true}

The tutorial adds trust, then an anchor. The seat verb is ljos consensus.