summaryrefslogtreecommitdiff
path: root/prisoners_dilemma.pl
diff options
context:
space:
mode:
Diffstat (limited to 'prisoners_dilemma.pl')
-rw-r--r--prisoners_dilemma.pl4
1 files changed, 1 insertions, 3 deletions
diff --git a/prisoners_dilemma.pl b/prisoners_dilemma.pl
index 535db0d..a77915c 100644
--- a/prisoners_dilemma.pl
+++ b/prisoners_dilemma.pl
@@ -24,14 +24,12 @@ pay(d,c,4).
pay2(A, B, PayA, PayB) :- pay(A, B, PayA), pay(B, A, PayB).
-decide(Module, Hist, Decision, State, NewState) :- call(Module, Hist, Decision, State, NewState).
-
sum([], 0).
sum([H|T], S) :- sum(T, TMP), S is TMP + H.
do(e, _, _, _, _) :- !.
do(Choice, Module, ModuleState, Hist, PayedA, PayedB) :-
- decide(Module, Hist, ModuleDecision, ModuleState, NewModuleState),
+ call(Module, Hist, ModuleDecision, ModuleState, NewModuleState),
pay2(Choice, ModuleDecision, PayA, PayB),
sum([PayA|PayedA], SumA), sum([PayB|PayedB], SumB),