summaryrefslogtreecommitdiff
path: root/rules/naive_prober.pl
diff options
context:
space:
mode:
Diffstat (limited to 'rules/naive_prober.pl')
-rw-r--r--rules/naive_prober.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/rules/naive_prober.pl b/rules/naive_prober.pl
new file mode 100644
index 0000000..df2bcf5
--- /dev/null
+++ b/rules/naive_prober.pl
@@ -0,0 +1,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,_,_).