Replace fixed input/output paths in platz.cfg with --indir switch

Tischedatei, XMLdatei_Bestellung, AusgabeTischePersonen and
AusgabePersonTisch are no longer configured in platz.cfg. Instead,
platz.py now requires a --indir <dir> command-line switch pointing
at a directory that must contain tische.ini and bestellung.xml, and
into which TischePersonen.txt/PersonenTische.csv are written - e.g.
work/test1 or work/test2. This makes it trivial to run against
different guest lists without editing platz.cfg. platz.bat/platz.sh
forward extra arguments so --indir can be passed through.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Michael Stangl
2026-07-09 12:13:17 +02:00
parent e8911df7e9
commit 1e2eedc62b
7 changed files with 79 additions and 56 deletions
+18 -20
View File
@@ -51,18 +51,18 @@ required) by calling `setenv.bat`/`setenv.sh` first.
```bat
:: Windows
bin\activate_venv.bat
bin\platz.bat
bin\platz.bat --indir work\test1
```
```bash
# Linux/macOS
source bin/activate_venv.sh
bin/platz.sh
bin/platz.sh --indir work/test1
```
`bin/platz.bat` / `bin/platz.sh` call `setenv` to set `PLATZ`, `PLATZ_CFG`, `PLATZ_LIBS`,
`PLATZ_WORK`, `PLATZ_IN`, `PLATZ_OUT`, add `PLATZ_LIBS` to `PYTHONPATH`, and then run
`libs/platz.py`.
`libs/platz.py`, forwarding any extra arguments (like `--indir`) to it.
Other helper scripts (`bin/setenv.*`, `bin/get_cmd.*`) follow the same environment
convention:
@@ -74,22 +74,8 @@ convention:
### Configuring a run
`cfg/platz.cfg` selects which cycle/penalty config and which working directory
(`work/<name>/`) to use for a given run:
```ini
[Config]
Zyklusdatei=$PLATZ_CFG/zyklus.cfg
Zyklusart=Easy
Strafendatei=$PLATZ_CFG/strafen.cfg
Tischedatei=$PLATZ_WORK/test1/tische.ini
XMLdatei_Bestellung=$PLATZ_WORK/test1/bestellung.xml
AusgabeTischePersonen=$PLATZ_WORK/test1/TischePersonen.txt
AusgabePersonTisch=$PLATZ_WORK/test1/PersonenTische.csv
```
To run against a different dataset, point the `Tischedatei`/`XMLdatei_Bestellung`/output
entries at another `work/<name>/` folder, or add a new one following the same layout:
`--indir <dir>` is required and points at a directory containing the input files and
receiving the output files for one run — e.g. `work/test1/` or `work/test2/`:
- `tische.ini` — one section per table: `Nummer`, `Hof` (venue/court), `Plaetze` (seat
count), `Nachbarliste` (neighboring table ids), `Koordinaten`.
@@ -98,6 +84,18 @@ entries at another `work/<name>/` folder, or add a new one following the same la
that template into). A `<Gruppe>` containing a `<Tisch>` tag is treated as a VIP group
pinned to that table instead of being placed by the GA.
To run against a different dataset, create a new folder with a `tische.ini` and
`bestellung.xml` following the same layout and pass it via `--indir`.
`cfg/platz.cfg` still selects the GA cycle/penalty config (independent of `--indir`):
```ini
[Config]
Zyklusdatei=$PLATZ_CFG/zyklus.cfg
Zyklusart=Easy
Strafendatei=$PLATZ_CFG/strafen.cfg
```
`cfg/zyklus.cfg` defines the GA run schedule ("Zyklus") as an `Abfolge` (sequence of
actions) and matching `Anzahl` (counts): `e` create, `s` select best, `S` select randomly,
`m` mutate, `j` keep parents, `z` advance generation.
@@ -108,7 +106,7 @@ a neighboring table, and per-table seat-utilization penalties.
### Output
A run writes two files into the configured working directory:
A run writes two files into the `--indir` directory:
- `TischePersonen.txt` — table → seated people, with venue/table/seat numbers.
- `PersonenTische.csv` — person → table, sorted alphabetically by name.