Bessere Verteilung: Strafen/Mutation, plus Abstammungsbaum mit Id-Herkunft

Weniger vermeidbare Gruppentrennungen:
- strafen.cfg: Tischbesetzung bestraft jetzt gestaffelt nach freien
  Plaetzen (teilbelegte Tische am teuersten, mit Fallback auf den
  naechstkleineren Eintrag), Trennungsstrafen deutlich erhoeht - so
  werden Gruppen nicht mehr getrennt, obwohl leere Tische danebenstehen
- gibPunkte('Tischbesetzung') mit Naechst-kleiner-Fallback
- mutieren() setzt geraeumte Gruppen groesste-zuerst neu
  (GruppenSetzen(GrosseZuerst=True)), damit grosse Gruppen die frei
  gewordenen ganzen Tische bekommen und wieder zusammenkommen
  (uebrig bleiben nur physisch unvermeidbare Trennungen, Gruppe > Tisch)

Abstammungsbaum (neuer Schalter --show-lineage -> Abstammung.svg):
- neue Klasse ga.Abstammung zeichnet den vollen Mutationsbaum aller
  Loesungen; der Ast der finalen besten Loesung ist hervorgehoben und
  mit ihrer Id beschriftet
- hierarchische Loesungs-Ids (Farm._WurzelId/_KindId): Wurzel '7',
  Mutationskind '7.2', dessen Kind '7.2.1' - die ganze Abstammung ist
  direkt aus der Id ablesbar

Tests (15 gruen), README und CLAUDE.md aktualisiert; Beispiele mit den
neuen Strafen und beiden Grafiken neu berechnet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Michael Stangl
2026-07-11 22:38:43 +02:00
parent 644f61ef6b
commit 6710d4f06a
28 changed files with 3908 additions and 1468 deletions
+45
View File
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="340" viewBox="0 0 1200 340" font-family="sans-serif">
<rect width="100%" height="100%" fill="white"/>
<text x="600" y="30" text-anchor="middle" font-size="16" fill="#333">Abstammung der Loesungen (Mutationsbaum)</text>
<line x1="60.0" y1="60.0" x2="60.0" y2="150.0" stroke="#c04040" stroke-width="2.5"/>
<line x1="420.0" y1="60.0" x2="368.6" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="780.0" y1="60.0" x2="677.1" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="1140.0" y1="60.0" x2="985.7" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="60.0" y1="60.0" x2="214.3" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="420.0" y1="60.0" x2="522.9" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="780.0" y1="60.0" x2="831.4" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="1140.0" y1="60.0" x2="1140.0" y2="150.0" stroke="#bbb" stroke-width="1"/>
<line x1="60.0" y1="150.0" x2="60.0" y2="240.0" stroke="#c04040" stroke-width="2.5"/>
<line x1="368.6" y1="150.0" x2="368.6" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="677.1" y1="150.0" x2="677.1" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="985.7" y1="150.0" x2="985.7" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="60.0" y1="150.0" x2="214.3" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="368.6" y1="150.0" x2="522.9" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="677.1" y1="150.0" x2="831.4" y2="240.0" stroke="#bbb" stroke-width="1"/>
<line x1="985.7" y1="150.0" x2="1140.0" y2="240.0" stroke="#bbb" stroke-width="1"/>
<circle cx="60.0" cy="60.0" r="7" fill="#c83232" stroke="#c04040" stroke-width="2"><title>Id 1, Wert -100.0</title></circle>
<circle cx="420.0" cy="60.0" r="5" fill="#c83232" stroke="#333" stroke-width="0.5"><title>Id 2, Wert -100.0</title></circle>
<circle cx="780.0" cy="60.0" r="5" fill="#c83232" stroke="#333" stroke-width="0.5"><title>Id 3, Wert -100.0</title></circle>
<circle cx="1140.0" cy="60.0" r="5" fill="#c83232" stroke="#333" stroke-width="0.5"><title>Id 4, Wert -100.0</title></circle>
<circle cx="60.0" cy="150.0" r="7" fill="#785f41" stroke="#c04040" stroke-width="2"><title>Id 1.1, Wert -99.0</title></circle>
<circle cx="368.6" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 2.1, Wert -99.0</title></circle>
<circle cx="677.1" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 3.1, Wert -99.0</title></circle>
<circle cx="985.7" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 4.1, Wert -99.0</title></circle>
<circle cx="214.3" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 1.2, Wert -99.0</title></circle>
<circle cx="522.9" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 2.2, Wert -99.0</title></circle>
<circle cx="831.4" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 3.2, Wert -99.0</title></circle>
<circle cx="1140.0" cy="150.0" r="5" fill="#785f41" stroke="#333" stroke-width="0.5"><title>Id 4.2, Wert -99.0</title></circle>
<circle cx="60.0" cy="240.0" r="7" fill="#288c50" stroke="#c04040" stroke-width="2"><title>Id 1.1.1, Wert -98.0</title></circle>
<circle cx="368.6" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 2.1.1, Wert -98.0</title></circle>
<circle cx="677.1" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 3.1.1, Wert -98.0</title></circle>
<circle cx="985.7" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 4.1.1, Wert -98.0</title></circle>
<circle cx="214.3" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 1.1.2, Wert -98.0</title></circle>
<circle cx="522.9" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 2.1.2, Wert -98.0</title></circle>
<circle cx="831.4" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 3.1.2, Wert -98.0</title></circle>
<circle cx="1140.0" cy="240.0" r="5" fill="#288c50" stroke="#333" stroke-width="0.5"><title>Id 4.1.2, Wert -98.0</title></circle>
<text x="60.0" y="262.0" text-anchor="middle" font-size="12" font-weight="bold" fill="#c04040">1.1.1</text>
<text x="48" y="64.0" text-anchor="end" font-size="11" fill="#666">Gen 0</text>
<text x="48" y="154.0" text-anchor="end" font-size="11" fill="#666">Gen 1</text>
<text x="48" y="244.0" text-anchor="end" font-size="11" fill="#666">Gen 2</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB