You are not logged in. login register
Game logistics
name logistics
creator stephan
number of roles 2
stylesheet logistics/logistics.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description A two-player logistics game. Boxes are distributed over several cities throughout Europe and the goal is to move as many of these as possible to their destination by driving to the box, loading it, driving to the destination and unloading the box there. Each delivered box brings one point, with the exception of a special "golden box", which brings two points. The reward at the end depends on the points earned during the game (25 for each point, with a maximum of 100).
GDL by Tim Federholzner (TZI, University of Bremen)

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;                                                           ;;;;;;;
;;;;;    Logistik-Spiel. Zwei Trucks transportieren Pakete      ;;;;;;;
;;;;;                                                           ;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(role truck1)
(role truck2)

(place madrid)
(place barcelona)
(place cadiz)
(place lissabon)
(place bordeaux)
(place dijon)
(place paris)
(place lyon)
(place verona)
(place rom)
(place napoli)
(place wien)
(place luxemburg)
(place amsterdam)
(place muenchen)
(place hamburg)
(place berlin)
(place warschau)
(place prag)
(place budapest)
(place minsk)
(place belgrad)
(place bukarest)
(place istanbul)
(place athen)
(place ankara)
(place kiew)
(place moskau)
(place petersburg)
(place helsinki)

(road1 lissabon cadiz)
(road1 lissabon madrid)
(road1 madrid cadiz)
(road1 madrid barcelona)
(road1 madrid bordeaux)
(road1 bordeaux dijon)
(road1 barcelona dijon)
(road1 dijon lyon)
(road1 lyon paris)
(road1 dijon verona)
(road1 verona rom)
(road1 rom napoli)
(road1 verona muenchen)
(road1 lyon muenchen)
(road1 muenchen wien)
(road1 verona wien)
(road1 wien prag)
(road1 prag berlin)
(road1 muenchen berlin)
(road1 berlin hamburg)
(road1 hamburg amsterdam)
(road1 amsterdam paris)
(road1 amsterdam luxemburg)
(road1 luxemburg paris)
(road1 wien budapest)
(road1 budapest warschau)
(road1 warschau berlin)
(road1 prag warschau)
(road1 warschau minsk)
(road1 minsk kiew)
(road1 kiew bukarest)
(road1 bukarest belgrad)
(road1 belgrad athen)
(road1 budapest belgrad)
(road1 bukarest istanbul)
(road1 istanbul ankara)
(road1 minsk moskau)
(road1 moskau petersburg)
(road1 petersburg minsk)
(road1 petersburg helsinki)

(<= (road ?x ?y)
	(road1 ?y ?x)
)

(<= (road ?x ?y)
	(road1 ?x ?y)
)

(init (at truck1 cadiz))
(init (at truck2 helsinki))

(init (at box1 moskau))
(init (at box2 barcelona))
(init (at box3 ankara))
(init (at box4 luxemburg))
(init (at box5 warschau))
(init (at box6 budapest))
(init (at box7 bordeaux))
(init (at goldenbox wien))

(init (move truck1 sleeping))
(init (move truck2 sleeping))

(<= (next (move ?r sleeping))
	(does ?r sleep)
)

(<= (next (move ?r driving))
	(does ?r (driveTo ?d))
)

(<= (next (move ?r loading))
	(does ?r (load ?b))
)

(<= (next (move ?r unloading))
	(does ?r unload)
)

(box box1)
(box box2)
(box box3)
(box box4)
(box box5)
(box box6)
(box box7)
(box goldenbox)

(dest box1 kiew)
(dest box2 paris)
(dest box3 wien)
(dest box4 wien)
(dest box5 belgrad)
(dest box6 berlin)
(dest box7 napoli)
(dest goldenbox helsinki)
(dest goldenbox cadiz)

(init (points truck1 0))
(init (points truck2 0))

(init (turn truck1))
(<= (next (turn truck2))
	(true (turn truck1))
)
(<= (next (turn truck1))
	(true (turn truck2))
)

(<= (legal ?r (driveTo ?x))
	(true (turn ?r))
	(true (at ?r ?p))
	(road ?p ?x)
)

(<= (legal ?r sleep)
	(role ?r)
)

(<= (legal ?r (load ?b))
	(box ?b)
	(true (turn ?r))
	(true (at ?r ?p))
	(true (at ?b ?p))
	(not (full ?r))
)

(<= (full ?r)
	(role ?r)
	(box ?b)
	(true (at ?b ?r))
)

(<= (legal ?r unload)
	(true (turn ?r))
	(box ?b)
	(true (at ?b ?r))
)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(not (drivesAnywhere ?r))
)

(<= (drivesAnywhere ?r)
	(does ?r (driveTo ?p))
)

(<= (next (at ?r ?p))
	(does ?r (driveTo ?p))
)

(<= (next (at ?b ?p))
	(box ?b)
	(true (at ?b ?p))
	(place ?p)
	(not (loadByAnyone ?b))
)

(<= (loadByAnyone ?b)
	(does ?r (load ?b))
)

(<= (next (at ?b ?p))
	(box ?b)
	(role ?r)
	(true (at ?b ?r))
	(true (at ?r ?p))
	(place ?p)
	(not (dest ?b ?p))
	(does ?r unload)
)

(<= (next (at ?b ?r))
	(does ?r (load ?b))
)

(<= (next (at ?b ?r))
	(box ?b)
	(true (at ?b ?r))
	(role ?r)
	(not (does ?r unload))
)

(<= (next (points ?r ?n))
	(true (points ?r ?n))
	(not (does ?r unload))
)

(<= (next (points ?r ?n))
	(true (points ?r ?n))
	(true (at ?b ?r))
	(true (at ?r ?p))
	(box ?b)
	(place ?p)
	(not (dest ?b ?p))
	(does ?r unload)
)

(<= (next (points ?r ?n2))
	(true (points ?r ?n))
	(does ?r unload)
	(true (at ?b ?r))
	(distinct ?b goldenbox)
	(true (at ?r ?p))
	(box ?b)
	(place ?p)
	(dest ?b ?p)
	(succ ?n ?n2)
)

(<= (next (points ?r ?n2))
	(true (points ?r ?n))
	(does ?r unload)
	(true (at goldenbox ?r))
	(true (at ?r ?p))
	(dest goldenbox ?p)
	(place ?p)
	(succ ?n ?t)
	(succ ?t ?n2)
)

;;;;;;;;;;;; only for visualization

(<= (next (destination ?r ?p))
	(role ?r)
	(box ?b)
	(true (at ?b ?r))
	(dest ?b ?p)
	(place ?p)
)

;;;;;;;;;;;;

(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)

(init (step 0))
(<= (next (step ?n))
	(true (step ?n0))
	(succ ?n0 ?n)
)

(<= terminal
	(true (step 50))
)

(<= anybox
	(box ?b)
	(true (at ?b ?p))
)

(<= terminal
	(not anybox)
)

(<= (goal ?r ?n)
	(true (points ?r ?m))
	(goalmap ?n ?m)
)

(goalmap 0 0)
(goalmap 25 1)
(goalmap 50 2)
(goalmap 75 3)
(goalmap 100 4)
(goalmap 100 5)
(goalmap 100 6)
(goalmap 100 7)
(goalmap 100 8)
(goalmap 100 9)
(goalmap 100 10)

sees_XML(...) rules

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