You are not logged in. login register
Game transit
name transit
creator stephan
number of roles 2
stylesheet generic/generic.xsl
GDL v2
enabled
matches show matches
statistics show game statistics
description The game includes two players and it is played on 4x8 grid with few blocked fields. The "transit" player starts in row 1 of the grid and its goal is to move to row 8 of the grid (i.e., cross the region). The goal of the "patrol" player is to intercept the "transit" (i.e., be positioned at the same position). If the "transit" reaches row 8 without being intercepted within the time limit of 30 moves, it wins. Otherwise, the patrol wins. The players do not learn any information until the last move of the game!
Created by: Viliam Lisy (viliam.lisy@agents.felk.cvut.cz)
Czech Technical University in Prague
Faculty of Electrical Engineering, Department of Cybernetics.

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; transit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(role transit)
(role patrol)

(blocked 1 5)
(blocked 1 4)
(blocked 5 1)
(blocked 5 2)
(blocked 5 3)
(blocked 5 4)
(blocked 5 5)
(blocked 5 6)
(blocked 5 7)
(blocked 5 8)

(init (control patrol))
(init (location patrol 3 8))
(init (location transit 2 1))
(init (step 1))

(<= (legal patrol (move ?dir))
    (true (control patrol))
    (true (location patrol ?x ?y))
    (plegalstep ?dir ?x ?y))
(<= (legal patrol (move nowhere))
    (not (true (control patrol))))
(<= (legal transit (move ?dir))
    (true (control transit))
    (true (location transit ?x ?y))
    (tlegalstep ?dir ?x ?y))
(<= (legal transit (move nowhere))
    (not (true (control transit))))

(<= (next (control patrol))
    (true (control transit)))
(<= (next (control transit))
    (true (control patrol)))
(<= (next (location ?char ?x2 ?y2))
    (true (location ?char ?x1 ?y1))
    (does ?char (move ?dir))
    (nextcell ?dir ?x1 ?y1 ?x2 ?y2))
(<= (next (step ?n++))
    (true (step ?n))
    (succ ?n ?n++)) 

(<= terminal crossed)
(<= terminal timeout)
(<= terminal captured)

(<= (goal patrol 100) timeout)
(<= (goal transit 0) timeout)
(<= (goal patrol 100) captured)
(<= (goal transit 0) captured)
(<= (goal transit 100) crossed)
(<= (goal patrol 0) crossed)

(<= crossed 
    (true (location transit ?x 8))
    (not captured))
(<= timeout 
    (true (step 30))
    (not crossed)
    (not captured))
(<= captured 
    (true (location transit ?x ?y))
    (true (location patrol ?x ?y)))

(<= (plegalstep north ?x ?y)
    (++ ?y ?ynew)
    (index ?x)
    (not (blocked ?x ?ynew)))
(<= (plegalstep south ?x ?y)
    (++ ?ynew ?y)
    (index ?x)
    (not (blocked ?x ?ynew)))
(<= (plegalstep east ?x ?y)
    (++ ?x ?xnew)
    (index ?y)
    (not (blocked ?xnew ?y)))
(<= (plegalstep west ?x ?y)
    (++ ?xnew ?x)
    (index ?y)
    (not (blocked ?xnew ?y)))

(<= (tlegalstep north ?x ?y)
    (++ ?y ?ynew)
    (index ?x)
    (not (blocked ?x ?ynew)))
(<= (tlegalstep deast ?x ?y)
    (++ ?x ?xnew)
    (++ ?y ?ynew)
    (not (blocked ?xnew ?ynew)))
(<= (tlegalstep dwest ?x ?y)
    (++ ?xnew ?x)
    (++ ?y ?ynew)
    (not (blocked ?xnew ?ynew)))

(<= (tlegalstep nowhere ?x ?y)
    (index ?x)
    (index ?y))
(<= (plegalstep nowhere ?x ?y)
    (index ?x)
    (index ?y))

(<= (nextcell north ?x ?y ?x ?ynew) 
    (++ ?y ?ynew)
    (index ?x))
(<= (nextcell south ?x ?y ?x ?ynew)
    (index ?x)
    (++ ?ynew ?y))
(<= (nextcell east ?x ?y ?xnew ?y)
    (++ ?x ?xnew)
    (index ?y))
(<= (nextcell west ?x ?y ?xnew ?y)
    (++ ?xnew ?x)
    (index ?y))
(<= (nextcell deast ?x ?y ?xnew ?ynew)
    (++ ?y ?ynew)
    (++ ?x ?xnew))
(<= (nextcell dwest ?x ?y ?xnew ?ynew)
    (++ ?y ?ynew)
    (++ ?xnew ?x))
(<= (nextcell nowhere ?x ?y ?x ?y)
    (index ?x)
    (index ?y))

(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)
(index 8)

(++ 1 2)
(++ 2 3)
(++ 3 4)
(++ 4 5)
(++ 5 6)
(++ 6 7)
(++ 7 8)

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

(<= (sees ?r1 (location ?r2 ?x ?y))
    (role ?r2)
    (next (location ?r2 ?x ?y))
    (next (location ?r1 ?x ?y))
    (distinct ?r1 ?r2))
(<= (sees patrol (location transit ?x 8))
    (next (location transit ?x 8)))
(<= (sees ?r (move ?dir))
    (legal ?r (move ?dir)))

sees_XML(...) rules

(<= (sees_xml ?r (location ?r ?x ?y))
    (true (location ?r ?x ?y))
)
(<= (sees_xml ?r1 (location ?r2 ?x ?y))
    (role ?r2)
    (true (location ?r2 ?x ?y))
    (true (location ?r1 ?x ?y))
    (distinct ?r1 ?r2))
(<= (sees_xml patrol (location transit ?x 8))
    (true (location transit ?x 8)))
(<= (sees_xml ?r (control ?r2))
    (role ?r)
    (true (control ?r2))
)
(<= (sees_xml ?r (step ?s))
    (role ?r)
    (true (step ?s))
)