add examples

This commit is contained in:
Joeri Exelmans 2024-11-13 10:07:16 +01:00
parent 8504ba52f6
commit 42757ddc4f
35 changed files with 1104 additions and 609 deletions

View file

@ -0,0 +1,13 @@
The names of the files in this directory are important.
A rule must always be named:
r_<rule_name>_<lhs|rhs|nac>.od
It is allowed to have more than one NAC. In this case, the NACs must be named:
r_<rule_name>_nac.od
r_<rule_name>_nac2.od
r_<rule_name>_nac3.od
...
For the assignment, you can delete the existing rules (they are nonsense) and start fresh.

View file

@ -0,0 +1,4 @@
berthState:RAM_BerthState {
RAM_numShips = `get_value(this) == 0`;
RAM_status = `get_value(this) == "empty"`;
}

View file

@ -0,0 +1,4 @@
berthState:RAM_BerthState {
RAM_numShips = `1`;
RAM_status = `"served"`;
}

View file

@ -0,0 +1,5 @@
# Find any place that has at least one ship:
placeState:RAM_PlaceState {
RAM_numShips = `get_value(this) > 0`;
}

View file

@ -0,0 +1,4 @@
placeState:RAM_PlaceState {
# Decrement number of ships:
RAM_numShips = `get_value(this) - 1`;
}