Skip to content

Formalization

Ryan Kepler Murphy edited this page Mar 6, 2025 · 2 revisions

Here, we provide a precise formalization of the Flatland scenario.

Properties of the Environment

The properties described in this section are constant across all Flatland environments and can be henceforth assumed throughout the formalization.

Consider a fixed set $T$ of track types, and a fixed set $D = {n,s,w,e}$ of directions.

Directions

We define the following operations on directions:

  • $\overline{n} = s$, $\overline{s} = n$, $\overline{w} = e$, $\overline{e} = w$
  • $n^r = e$, $s^r = w$, $w^r = n$, $e^r = s$
  • $n^l = w$, $s^l = e$, $w^l = s$, $e^l = n$

Transitions

We introduce the concept of a transition:

  • Each track type $t \in T$ provides a set of transitions, captured by the relation $H_t \subseteq D \times D$
  • A transition is a pair of directions $(d,d')$, such that $d, d' \in D$
  • Within each set, transitions exist in pairs: for every $H_t, \ t \in T$, for each transition $(d,d')$, there is a corresponding transition $(\overline{d'},\overline{d})$

The Grid World

Cells

A Flatland grid is composed of cells $C$, which have:

  • a position within the grid
  • a track type $t \in T$

We express these with the following functions:

  • $p: \ C \to \mathbb{N} \times \mathbb{N}$
  • $t: \ C \to T$

These functions are implicit to $C$.

A cell $c \in C$ is trivial whenever $H_{t(c)} = \emptyset$

Transitions between cells

Trains

Actions

Collisions

Solution

Clone this wiki locally