You are not logged in. login register
Game DoubleAuctionDJ
name DoubleAuctionDJ
creator admin
number of roles 3
stylesheet generic/generic.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description

Game Description

(role broker)
(role trader1)
(role trader2)

(init (control trader))
(init (time 0))

(<= (legal trader1 (ask 1 ?p))
	(true (control trader))
	(num ?p))
	
(<= (legal trader2 (bid 1 ?p))
	(true (control trader))
	(num ?p))

(<= (legal trader1 noop)
	(true (control broker)))
	
(<= (legal trader2 noop)
	(true (control broker)))
			
(<= (legal broker (match (ask ?a1 ?a ?p1) (bid ?a2 ?q ?p2) ?q ?p))
	(true (control broker))
	(true (ask ?a1 ?q1 ?p1))
	(true (bid ?q2 ?q2 ?p2))
	(ls_or_eq ?p1 ?p2)
	(price ?p1 ?p2 ?p))
	
(<= (legal broker noop) 
	(true (control broker))
	(true (ask ?a1 ?q1 ?p1))
	(true (bid ?a2 ?q2 ?p2))
	(not (ls_or_eq ?p1 ?p2)))
	
(<= (legal broker noop)
	(true (control trader)))

(<= (price ?p ?p ?p) 
	(num ?p))
	
(<= (price ?p1 ?p2 ?p1)
	(succ ?p1 ?p2))
	
(<= (price ?p1 ?p2 ?p)
	(succ ?p1 ?p3)
	(succ ?p4 ?p2)
	(price ?p3 ?p4 ?p))
	
(<= (ls_or_eq ?p ?p)
	(num ?p))
	
(<= (ls_or_eq ?p1 ?p2)
	(succ ?p1 ?p3)
	(ls_or_eq ?p3 ?p2))
	
(<= (next (control broker))
	(true (control trader)))
	
(<= (next (control trader))
	(true (control broker)))

(<= (next (time ?n))
	(true (time ?c))
	(succ ?c ?n))
	
(<= (next (ask ?t ?q ?p))
	(does ?t (ask ?q ?p)))
	
(<= (next (ask ?t ?q ?p))
	(does ?t (bid ?q ?p)))
	
(<= (next stop)
	(does broker (match (ask ?a1 ?q1 ?p1) (bid ?a2 ?q2 ?p2) ?q ?p)))
	
(<= (next (value ?a1 ?q ?p ask))
	(does broker (match (ask ?a1 ?q1 ?p1) (bid ?a2 ?q2 ?p2) ?q ?p)))
	
(<= (next (value ?a2 ?q ?p bid))
	(does broker (match (ask ?a1 ?q1 ?p1) (bid ?a2 ?q2 ?p2) ?q ?p)))
	
; (<= (next (ask ?a ?q ?p))
	; (true (ask ?a ?q ?p))
	; (does broker noop))
	
; (<= (next (bid ?a ?q ?p))
	; (true (bid ?a ?q ?p))
	; (does broker noop))

(<= (goal broker 100)
	(true stop))

(<= (goal ?a 0)
	(role ?a)
	(not (true stop)))

(<= (goal ?a ?p)
	(true (value ?a ?q ?p ask)))

(<= (goal ?a ?v)
	(true (value ?a ?q ?p bid))
	(save ?p ?v))

(<= (save ?p ?v) 
	(subtract 100 ?p 0 ?v))
	
(<= (subtract ?p ?p ?v ?v)
	(num ?p)
	(num ?v))

(<= (subtract ?m ?p ?v1 ?v)
	(succ ?n ?m)
	(succ ?v1 ?v2)
	(subtract ?n ?p ?v2 ?v))

(<= terminal
	(true stop))
	
(<= terminal
	(true (time 10)))

(num 0)
(num 1)
(num 2)
(num 3)
(num 4)
(num 5)
(num 6)
(num 7)
(num 8)
(num 9)
(num 10)
(num 11)
(num 12)
(num 13)
(num 14)
(num 15)
(num 16)
(num 17)
(num 18)
(num 19)
(num 20)
(num 21)
(num 22)
(num 23)
(num 24)
(num 25)
(num 26)
(num 27)
(num 28)
(num 29)
(num 30)
(num 31)
(num 32)
(num 33)
(num 34)
(num 35)
(num 36)
(num 37)
(num 38)
(num 39)
(num 40)
(num 41)
(num 42)
(num 43)
(num 44)
(num 45)
(num 46)
(num 47)
(num 48)
(num 49)
(num 50)
(num 51)
(num 52)
(num 53)
(num 54)
(num 55)
(num 56)
(num 57)
(num 58)
(num 59)
(num 60)
(num 61)
(num 62)
(num 63)
(num 64)
(num 65)
(num 66)
(num 67)
(num 68)
(num 69)
(num 70)
(num 71)
(num 72)
(num 73)
(num 74)
(num 75)
(num 76)
(num 77)
(num 78)
(num 79)
(num 80)
(num 81)
(num 82)
(num 83)
(num 84)
(num 85)
(num 86)
(num 87)
(num 88)
(num 89)
(num 90)
(num 91)
(num 92)
(num 93)
(num 94)
(num 95)
(num 96)
(num 97)
(num 98)
(num 99)
(num 100)

(succ   0   1)
(succ   1   2)
(succ   2   3)
(succ   3   4)
(succ   4   5)
(succ   5   6)
(succ   6   7)
(succ   7   8)
(succ   8   9)
(succ   9  10)
(succ  10  11)
(succ  11  12)
(succ  12  13)
(succ  13  14)
(succ  14  15)
(succ  15  16)
(succ  16  17)
(succ  17  18)
(succ  18  19)
(succ  19  20)
(succ  20  21)
(succ  21  22)
(succ  22  23)
(succ  23  24)
(succ  24  25)
(succ  25  26)
(succ  26  27)
(succ  27  28)
(succ  28  29)
(succ  29  30)
(succ  30  31)
(succ  31  32)
(succ  32  33)
(succ  33  34)
(succ  34  35)
(succ  35  36)
(succ  36  37)
(succ  37  38)
(succ  38  39)
(succ  39  40)
(succ  40  41)
(succ  41  42)
(succ  42  43)
(succ  43  44)
(succ  44  45)
(succ  45  46)
(succ  46  47)
(succ  47  48)
(succ  48  49)
(succ  49  50)
(succ  50  51)
(succ  51  52)
(succ  52  53)
(succ  53  54)
(succ  54  55)
(succ  55  56)
(succ  56  57)
(succ  57  58)
(succ  58  59)
(succ  59  60)
(succ  60  61)
(succ  61  62)
(succ  62  63)
(succ  63  64)
(succ  64  65)
(succ  65  66)
(succ  66  67)
(succ  67  68)
(succ  68  69)
(succ  69  70)
(succ  70  71)
(succ  71  72)
(succ  72  73)
(succ  73  74)
(succ  74  75)
(succ  75  76)
(succ  76  77)
(succ  77  78)
(succ  78  79)
(succ  79  80)
(succ  80  81)
(succ  81  82)
(succ  82  83)
(succ  83  84)
(succ  84  85)
(succ  85  86)
(succ  86  87)
(succ  87  88)
(succ  88  89)
(succ  89  90)
(succ  90  91)
(succ  91  92)
(succ  92  93)
(succ  93  94)
(succ  94  95)
(succ  95  96)
(succ  96  97)
(succ  97  98)
(succ  98  99)
(succ  99  100)

sees_XML(...) rules

(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))