harmonyrose / 3rd-Party-Problem

0 stars 0 forks source link

Double check HP's code in elect() #9

Closed divilian closed 11 months ago

divilian commented 11 months ago

Is there a simpler way to determine theoretical vote totals for candidates' movement choices?

divilian commented 11 months ago

I think the variable bucket_count in Society::elect() is not used. (@harmonyrose speak up if you want me not to delete this.)

divilian commented 11 months ago

Question arising: what should the vote functions (rational_vote(), party_vote()) return in the case where the agent actually won't vote at all?

The way they stand now, I believe they return the candidate that the agent "would have" voted for if the agent were a voting agent. That's okay, but it slightly complicates this issue: instead of just asking each agent how they would vote under an adjusted candidate opinion vector, we do have to figure out whether they're voting first so we don't count them if they actually wouldn't vote for the candidate even if it moved.

My suggestion: let's define some value (say, -1) as "not voting at all." Then, the vote functions can return that value to signal "not voting," and the code in drift() can be made much simpler (it will just call each agent's vote function, and if that agent returns -1, so be it: the -1 is treated just as any other "didn't vote for me" value.)

Lmk if you agree, @harmonyrose, and I'll make this change if so.

harmonyrose commented 11 months ago

@divilian Go ahead and delete bucket_count; it was for previous metrics we're no longer worried about.

That sounds like a great fix to me! Much simpler than what I was attempting to do with the should_vote() method, which I think is safe to just remove altogether.