tscizzle / IPD_Morality

Run Iterated Prisoner's Dilemma tournaments, Judge the bots according to various morality metrics
MIT License
79 stars 5 forks source link

Division by zero in some corner cases #2

Closed darobin closed 10 years ago

darobin commented 10 years ago

Hi,

if you run a rather degenerate tournament (ALL_C vs ALL_D on their own) you can get into a situation in which at https://github.com/tscizzle/IPD_Morality/blob/master/morality_calculator.py#L164 total_val is 0, which causes a division by zero error.

tscizzle commented 10 years ago

Thank you so much! It brings up an interesting case, where ALL_C and ALL_D are actually judged equally by Eigenmoses when they are the only ones in the arena. ALL_D is mean, so ALL_C is judged poorly for cooperating, and ALL_D gets to look "good" by defecting against ALL_C. Or perhaps it doesn't look "good", but it looks equally as "good" as ALL_C.

darobin commented 10 years ago

Yes, I thought it made an amusing and unexpected interaction. If you throw RANDOM 0.5 into the mix you can also get fun results whereby the slightest deviation from 0.5 causes the eigenmoses ratings of ALL_C and ALL_D to fluctuate madly.

Anyway, I'm having fun with this, thanks for sharing the code. I'm toying with an interactive port for the fun of it: http://darobin.github.io/ipd-morality/.

tscizzle commented 10 years ago

Oh wow, that is awesome! I'm really glad you're finding this so interesting. Do you mind if I distribute that link to show people?

darobin commented 10 years ago

Not at all! Glad you like :) It's just a fun project on the side. Note: it's not finished, but it works for the basic tournament stuff.