liquid_feedback_core

changeset 407:92cdb3af0b54

lf_update_issue_order.c: Replaced occurences of "suggestion" with "issue"
author jbe
date Mon Oct 14 00:20:52 2013 +0200 (2013-10-14)
parents 1821e7aee87f
children f7b4457cf1a6
files lf_update_issue_order.c
line diff
     1.1 --- a/lf_update_issue_order.c	Mon Oct 14 00:19:38 2013 +0200
     1.2 +++ b/lf_update_issue_order.c	Mon Oct 14 00:20:52 2013 +0200
     1.3 @@ -32,9 +32,9 @@
     1.4  #define COL_WEIGHT    1
     1.5  #define COL_ISSUE_ID  2
     1.6  
     1.7 -// data structure for a candidate (in this case a suggestion) to the proportional runoff system:
     1.8 +// data structure for a candidate (in this case an issue) to the proportional runoff system:
     1.9  struct candidate {
    1.10 -  char *key;              // identifier of the candidate, which is the "suggestion_id" string
    1.11 +  char *key;              // identifier of the candidate, which is the "issue_id" string
    1.12    double score_per_step;  // added score per step
    1.13    double score;           // current score of candidate; a score of 1.0 is needed to survive a round
    1.14    int seat;               // equals 0 for unseated candidates, or contains rank number
    1.15 @@ -64,11 +64,11 @@
    1.16      candidate = candidates + (candidate_count++);
    1.17      candidate->key  = *candidate_key;
    1.18      candidate->seat = 0;
    1.19 -    if (logging) printf("Candidate #%i is suggestion #%s.\n", candidate_count, candidate->key);
    1.20 +    if (logging) printf("Candidate #%i is issue #%s.\n", candidate_count, candidate->key);
    1.21    }
    1.22  }
    1.23  
    1.24 -// performs a binary search in candidates[] array to lookup a candidate by its key (which is the suggestion_id):
    1.25 +// performs a binary search in candidates[] array to lookup a candidate by its key (which is the issue_id):
    1.26  static struct candidate *candidate_by_key(char *candidate_key) {
    1.27    struct candidate *candidate;
    1.28    struct candidate compare;
    1.29 @@ -141,7 +141,7 @@
    1.30      for (i=0; i<candidate_count; i++) {
    1.31        int log_candidate = 0;
    1.32        if (logging && candidates[i].score < 1.0 && !candidates[i].seat) log_candidate = 1;
    1.33 -      if (log_candidate) printf("Score for suggestion #%s = %.4f+%.4f*%.4f", candidates[i].key, candidates[i].score, scale, candidates[i].score_per_step);
    1.34 +      if (log_candidate) printf("Score for issue #%s = %.4f+%.4f*%.4f", candidates[i].key, candidates[i].score, scale, candidates[i].score_per_step);
    1.35        if (candidates[i].score_per_step > 0.0) {
    1.36          double max_scale;
    1.37          max_scale = (1.0-candidates[i].score) / candidates[i].score_per_step;
    1.38 @@ -269,7 +269,7 @@
    1.39        if (logging) printf("Done.\n");
    1.40        return 0;
    1.41      }
    1.42 -    // calculate ballot_count and generate set of candidate keys (suggestion_id is used as key):
    1.43 +    // calculate ballot_count and generate set of candidate keys (issue_id is used as key):
    1.44      for (i=0; i<tuple_count; i++) {
    1.45        char *member_id, *issue_id;
    1.46        member_id = PQgetvalue(res, i, COL_MEMBER_ID);

Impressum / About Us