summaryrefslogtreecommitdiff
path: root/rules/naive_prober.pl
blob: df2bcf5695fd8ec8bb0b4d4c5e7f887e596b70bf (plain)
1
2
3
4
5
6
7
8
9
% Naive Prober:
% Like Tit for Tat, but sometimes, after the opponent has cooperated, it
% defects (e.g. at random, in one of ten rounds in average).

naive_prober([d|_],d,_,_).
% but only for for 90% if coorporated
naive_prober([c|_],Choice,_,_):-random(Number), (Number < 0.1 -> Choice=d; Choice=c).
% Fallback to coorporate if history is empty.
naive_prober([],c,_,_).