Add scoring pseudo-code for fast deliberation.

This was entertaining, but it's perhaps wrong,
although we can't find any reason why so far.
We contacted the world's top specialist on the matter.
…

Three gods, A, B, and C are called,
in no particular order, True, False, and Random.

True always speaks truly, False always speaks falsely,
but whether Random speaks truly or falsely is a
completely random matter.

Your task is to determine the identities of A, B, and C
by asking three yes-no questions; each question
must be put to exactly one god. The gods understand
English, but will answer all questions in
their own language, in which the words for yes
and no are da and ja, in some order.

You do not know which word means which.
mj-v1.12
domi41 4 years ago
parent 03b6354fc1
commit c878c0e9d4

@ -35,3 +35,34 @@ func (deli *PollNaiveDeliberator) Deliberate(poll *Poll) (_ *PollResult, err err
return result, nil
}
/*
// Assume that each candidate has the same amount of judgments = MAX_JUDGES.
// (best fill with 0=REJECT to allow posterior candidate addition, cf. <paper>)
for each Candidate
ct = CandidateTally(Candidate) // sums of judgments, per grade, basically
score = "" // score is a string but could be raw bits
// When we append integers to score below,
// consider that we concatenate the string representation including leading zeroes
// up to the amount of digits we need to store 2 * MAX_JUDGES,
// or the raw bits (unsigned and led as well) in case of a byte array.
for i in range(MAX_GRADES)
grade = ct.median()
score.append(grade) // three digits will suffice for int8
// Collect biggest of the two groups outside of the median.
// Group Grade is the group"s grade adjacent to the median group
// Group Sign is:
// - +1 if the group promotes higher grades (adhesion)
// - -1 if the group promotes lower grades (contestation)
// - ±0 if there is no spoon
group_size, group_sign, group_grade = ct.get_biggest_group()
// MAX_JUDGES is to deal with negative values lexicographically
score.append(MAX_JUDGES + groups_sign * group_size)
// Move the median grades into the group grades
ct.regrade_judgments(grade, groups_grade)
// Use it later in a bubble sort or whatever
Candidate.score = score
*/

Loading…
Cancel
Save