Skip to content

Commit

Permalink
window.model no longer
Browse files Browse the repository at this point in the history
  • Loading branch information
paretoman committed Mar 3, 2019
1 parent a47ee75 commit 9fb08f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion play/js/Election.js
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ Election.rbvote = function(model, options){ // Use the RBVote from Rob Legrand
var ballots = model.getBallots();

rbvote.setreturnstring() // tell rbvote that we might want return strings (unless we're not doing the sidebar)
rbvote.readballots(ballots)
rbvote.readballots(ballots,model)
resultRB = model.rbelection(options.sidebar) // e.g. result = rbvote.calctide() // having a sidebar display means we want to construct explanation strings


Expand Down
4 changes: 2 additions & 2 deletions play/js/Voters.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ function utility_function(utility_shape) {
}

function inverse_utility_function(utility_shape) {
if (model.utility_shape == "quadratic") {
if (utility_shape == "quadratic") {
var finv = x => Math.sqrt(x)
} else if (model.utility_shape == "log") {
} else if (utility_shape == "log") {
var finv = x => Math.exp(x) - .1
} else { // "linear"
var finv = x => x
Expand Down
1 change: 1 addition & 0 deletions play/js/main_sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function Sandbox() {
var maxVoters = 10 // workaround // there is a bug where the real max is one less than this

// CREATE
var model = new Model();
var ui = {}
var config
var initialConfig
Expand Down
2 changes: 1 addition & 1 deletion rbvote/rbvote.js
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ function readvotes()
}


function readballots(ballots)
function readballots(ballots,model)
{
var absent, beat = new Array(), i, ignoreinput, j, k, l, nextcand, rating = new Array(), regexp = new RegExp(), rvotecomment, rvoteinput,
rvoteline = new Array(), tiebreakinput;
Expand Down

0 comments on commit 9fb08f8

Please sign in to comment.