Global

Members

(constant) ACTIVATION_FUNCTIONS :Object.<string, ActivationFunction>

Description:
  • Registry aller verfügbaren Aktivierungsfunktionen. Zugriff über ACTIVATION_FUNCTIONS[name].

Source:

Registry aller verfügbaren Aktivierungsfunktionen. Zugriff über ACTIVATION_FUNCTIONS[name].

Type:

(constant) AI_CONSTANTS :Object

Description:
  • AI und Algorithmus-Parameter

Source:

AI und Algorithmus-Parameter

Type:
  • Object

(constant) BRIDGE_TARGET_ORIGIN :string

Description:
  • IframeBridge targetOrigin — Security-Default für postMessage. Für lokale Entwicklung (file://): '*' ist notwendig, da file://-Iframes origin 'null' haben. Für Production: window.location.origin einsetzen um Cross-Origin-Angriffe zu verhindern.

    Hinweis: window.location.origin liefert bei file:// je nach Browser 'null' (Firefox) oder 'file://' (Chrome) — beides funktioniert NICHT als postMessage targetOrigin. Daher prüfen wir direkt auf das Protokoll.

Source:

IframeBridge targetOrigin — Security-Default für postMessage. Für lokale Entwicklung (file://): '*' ist notwendig, da file://-Iframes origin 'null' haben. Für Production: window.location.origin einsetzen um Cross-Origin-Angriffe zu verhindern.

Hinweis: window.location.origin liefert bei file:// je nach Browser 'null' (Firefox) oder 'file://' (Chrome) — beides funktioniert NICHT als postMessage targetOrigin. Daher prüfen wir direkt auf das Protokoll.

Type:
  • string

(constant) CONNECT4_HEURISTICS_CONFIGS :Object.<string, Object.<string, Object>>

Description:
  • Zentrales Konfigurations-Verzeichnis aller Connect4-Profile.

Source:

Zentrales Konfigurations-Verzeichnis aller Connect4-Profile.

Type:
  • Object.<string, Object.<string, Object>>

(constant) DEBUG_CONSTANTS :Object

Description:
  • Debug-Flags für Fehlerdiagnose

Source:

Debug-Flags für Fehlerdiagnose

Type:
  • Object

(constant) DEFAULT_SPEED_DELAY :number

Description:
  • Default-Delay (ms)

Source:

Default-Delay (ms)

Type:
  • number

(constant) DEFAULT_STATUS_CONFIG

Description:
  • CONSOLIDATED DEFAULT CONFIGURATION Combines priority, visual styling, and rendering flags in one place.

    Base Status Types (11): ACTIVE, SOLUTION, WIN, LOSS, DEAD_END, DRAW, DUPLICATE, PRUNED, NONE, ACTIVE_DEAD_END, ACTIVE_WIN

    Special Status Types (5): BEST, PREVIEW_NODE, BOARD_WON, BOARD_NORMAL, DEFAULT

Source:

CONSOLIDATED DEFAULT CONFIGURATION Combines priority, visual styling, and rendering flags in one place.

Base Status Types (11): ACTIVE, SOLUTION, WIN, LOSS, DEAD_END, DRAW, DUPLICATE, PRUNED, NONE, ACTIVE_DEAD_END, ACTIVE_WIN

Special Status Types (5): BEST, PREVIEW_NODE, BOARD_WON, BOARD_NORMAL, DEFAULT

(constant) EMPTY :number

Description:
  • Feldwert für ein leeres Feld

Source:

Feldwert für ein leeres Feld

Type:
  • number

(constant) GAME_CONSTANTS :Object

Description:
  • Globale Spiel-Konstanten, die alle Spiele nutzen

Source:

Globale Spiel-Konstanten, die alle Spiele nutzen

Type:
  • Object

(constant) GameFactories

Description:
  • Vorkonfigurierte Spiel-Factory-Funktionen für Arena. Wird vom Arena-UI verwendet.

Source:

Vorkonfigurierte Spiel-Factory-Funktionen für Arena. Wird vom Arena-UI verwendet.

(constant) LEER :number

Description:
  • Feldtyp: Leeres Feld

Source:

Feldtyp: Leeres Feld

Type:
  • number

(constant) LOSS_FUNCTIONS :Object.<string, LossFunction>

Description:
  • Registry aller verfügbaren Verlustfunktionen.

Source:

Registry aller verfügbaren Verlustfunktionen.

Type:

(constant) MINIMAX_VIZ_CONSTANTS :Object

Description:
  • Konfiguration für Minimax-/Alpha-Beta-Visualisierung.

    Enthält bewusst zentrale Schalter für boolesche Features, damit Adapter und UI konsistent konfiguriert werden.

Source:

Konfiguration für Minimax-/Alpha-Beta-Visualisierung.

Enthält bewusst zentrale Schalter für boolesche Features, damit Adapter und UI konsistent konfiguriert werden.

Type:
  • Object

(constant) MIN_DEPTH :number

Description:
  • Minimale Suchtiefe

Source:

Minimale Suchtiefe

Type:
  • number

(constant) NN_CONSTANTS :Object

Description:
  • Konstanten für das Neuronale Netz Modul.

Source:

Konstanten für das Neuronale Netz Modul.

Type:
  • Object

(constant) NUMERIC_VIZ_CONSTANTS :Object

Description:
  • Konfiguration für numerische Knoten-Darstellung (Diagramm-Modus). Verwendet für Lehrbuch-artige Minimax-/Alpha-Beta-Bäume ohne Spielfeld.

Source:

Konfiguration für numerische Knoten-Darstellung (Diagramm-Modus). Verwendet für Lehrbuch-artige Minimax-/Alpha-Beta-Bäume ohne Spielfeld.

Type:
  • Object

(constant) NodeStatusManager

Description:
  • NodeStatusManager - Zentrale Utility für Status-Management in Tree-Adapters

    Verwendung in Adapters:

    const adapter = new MinimaxTreeAdapter(iframe);
    // Später im Adapter:
    NodeStatusManager.setNodeStatus(nodeId, 'ACTIVE', [], myTreeStructure, adapter.commands);
    

    API:

    • setNodeStatus(nodeId, primaryStatus, additionalStatuses, treeStructure, commands) Updates both internal model and generates UPDATE_NODE command
Source:

NodeStatusManager - Zentrale Utility für Status-Management in Tree-Adapters

Verwendung in Adapters:

const adapter = new MinimaxTreeAdapter(iframe);
// Später im Adapter:
NodeStatusManager.setNodeStatus(nodeId, 'ACTIVE', [], myTreeStructure, adapter.commands);

API:

  • setNodeStatus(nodeId, primaryStatus, additionalStatuses, treeStructure, commands) Updates both internal model and generates UPDATE_NODE command

(constant) PROFILE_DEPTH_EASY :number

Description:
  • Suchtiefe für einfaches Profil

Source:

Suchtiefe für einfaches Profil

Type:
  • number

(constant) PROFILE_DEPTH_HARD :number

Description:
  • Suchtiefe für schweres Profil

Source:

Suchtiefe für schweres Profil

Type:
  • number

(constant) PROFILE_DEPTH_MEDIUM :number

Description:
  • Suchtiefe für mittleres Profil

Source:

Suchtiefe für mittleres Profil

Type:
  • number

(constant) SNAPSHOT_INTERVAL_MS :number

Description:
  • Adaptiver Snapshot-Intervall (ms). Target: ~60fps für die Visualisierung.

Source:

Adaptiver Snapshot-Intervall (ms). Target: ~60fps für die Visualisierung.

Type:
  • number

(constant) SPEED_DELAYS :Array.<number>

Description:
  • Delay-Stufen für Animationen (ms)

Source:

Delay-Stufen für Animationen (ms)

Type:
  • Array.<number>

(constant) SPEED_SLIDER_MANUAL :number

Description:
  • Wert für manuellen Modus

Source:

Wert für manuellen Modus

Type:
  • number

(constant) SPEED_SLIDER_MAX :number

Description:
  • Maximaler Wert für den Speed-Slider

Source:

Maximaler Wert für den Speed-Slider

Type:
  • number

(constant) SPEED_SLIDER_MIN :number

Description:
  • Minimaler Wert für den Speed-Slider

Source:

Minimaler Wert für den Speed-Slider

Type:
  • number

(constant) STEP_ACTIVATION

Description:
  • Heaviside Step Function: f(x) = 1 wenn x ≥ 0, sonst 0. Klassische Perzeptron-Aktivierung (nicht-differenzierbar bei x=0). Für das Perzeptron-Training wird stattdessen die Delta-Regel verwendet.

Source:

Heaviside Step Function: f(x) = 1 wenn x ≥ 0, sonst 0. Klassische Perzeptron-Aktivierung (nicht-differenzierbar bei x=0). Für das Perzeptron-Training wird stattdessen die Delta-Regel verwendet.

(constant) StatusConfig

Description:
  • StatusConfig Manager Object

    API Methods:

    • getStatusTypes() : object - Get current status types with only priority + visual properties
    • getStyleConfig() : object - Get current style config with all properties including rendering flags
    • setConfigDefaults(overrides) : void - NEW: Unified override method (replaces setStatusDefaults + setStyleDefaults)
    • setStatusDefaults(overrides) : void - DEPRECATED: Use setConfigDefaults() instead
    • setStyleDefaults(overrides) : void - DEPRECATED: Use setConfigDefaults() instead
    • setStatusProperty(statusName, property, value) : void - Set single status property
    • setStyleProperty(statusName, property, value) : void - Set single style property
    • resetToDefaults() : void - Clear all overrides and reset to defaults
    • getConfigSummary() : string - Get JSON summary of current configuration
Source:

StatusConfig Manager Object

API Methods:

  • getStatusTypes() : object - Get current status types with only priority + visual properties
  • getStyleConfig() : object - Get current style config with all properties including rendering flags
  • setConfigDefaults(overrides) : void - NEW: Unified override method (replaces setStatusDefaults + setStyleDefaults)
  • setStatusDefaults(overrides) : void - DEPRECATED: Use setConfigDefaults() instead
  • setStyleDefaults(overrides) : void - DEPRECATED: Use setConfigDefaults() instead
  • setStatusProperty(statusName, property, value) : void - Set single status property
  • setStyleProperty(statusName, property, value) : void - Set single style property
  • resetToDefaults() : void - Clear all overrides and reset to defaults
  • getConfigSummary() : string - Get JSON summary of current configuration

(constant) TTTGameFactory

Description:
  • Factory für verschiedene TTT-Varianten.

Source:

Factory für verschiedene TTT-Varianten.

(constant) TTT_HEURISTICS_CONFIGS :Object.<string, Object.<string, Object>>

Description:
  • Zentrales Konfigurations-Verzeichnis aller TTT-Profile. Schlüssel: variant → profile → config.

Source:

Zentrales Konfigurations-Verzeichnis aller TTT-Profile. Schlüssel: variant → profile → config.

Type:
  • Object.<string, Object.<string, Object>>

(constant) UI_CONSTANTS :Object

Description:
  • UI-Constants für Rendering und Darstellung

Source:

UI-Constants für Rendering und Darstellung

Type:
  • Object

(constant) VisualizationUtils

Description:
  • visualization-utils.js - Gemeinsame Utilities für alle Visualizer

    Funktionen für:

    • Farb-Management (Status → RGB)
    • Geometrie-Berechnungen
    • State Helpers
    • Performance Optimierungen
Source:
Version:
  • 1.0
Author:
  • Alexander Wolf

visualization-utils.js - Gemeinsame Utilities für alle Visualizer

Funktionen für:

  • Farb-Management (Status → RGB)
  • Geometrie-Berechnungen
  • State Helpers
  • Performance Optimierungen

(constant) WAND :number

Description:
  • Feldtyp: Wand (nicht begehbar)

Source:

Feldtyp: Wand (nicht begehbar)

Type:
  • number

(constant) ZIEL :number

Description:
  • Feldtyp: Ziel (Endpunkt)

Source:

Feldtyp: Ziel (Endpunkt)

Type:
  • number

isTraining :boolean

Description:
  • Flag: Ist das Training aktiv?

Source:

Flag: Ist das Training aktiv?

Type:
  • boolean

network :NeuralNetwork|null

Description:
  • Das aktuelle Netzwerk (wird bei START_TRAINING erstellt).

Source:

Das aktuelle Netzwerk (wird bei START_TRAINING erstellt).

Type:

stopRequested :boolean

Description:
  • Flag: Wurde ein Stopp angefordert?

Source:

Flag: Wurde ein Stopp angefordert?

Type:
  • boolean

Methods

_connect4ValidateConfig(config) → {Object}

Description:
  • Validiert Config falls Schema-Validator verfügbar ist (Load-Order-sicher).

Source:
Parameters:
Name Type Description
config Object

Rohkonfiguration.

Returns:

Validierte oder unveränderte Konfiguration.

Type
Object

_convertStyleToRenderFormat(style, config) → {Object}

Description:
  • Konvertiert STYLE_CONFIG Format zu Renderer-Format Mit Unterstützung für enableGlow und enableDash Schalter Nutzt zentrale STYLE_CONFIG_GLOBAL Effekt-Schalter

Source:
Parameters:
Name Type Description
style Object

STYLE_CONFIG object

config Object

Renderer config (kompatibilität, wird nicht mehr genutzt)

Returns:
  • Renderer-kompatibles Format
Type
Object

_tttValidateConfig(config) → {Object}

Description:
  • Validiert Config falls Schema-Validator verfügbar ist (Load-Order-sicher).

Source:
Parameters:
Name Type Description
config Object

Rohkonfiguration.

Returns:

Validierte oder unveränderte Konfiguration.

Type
Object

(async) animateRelax(board, canvas, ctx, speed, renderCallback) → {Promise.<void>}

Description:
  • Animiert das Fallen der Blöcke.

Source:
Parameters:
Name Type Description
board RotateBoard
canvas HTMLCanvasElement
ctx CanvasRenderingContext2D
speed number

Dummy parameter, Geschwindigkeit ist hardcoded.

renderCallback function

Callback zum Neuzeichnen nach jedem Frame.

Returns:
Type
Promise.<void>

checkAndMarkDeadEnd(nodeId, nodes)

Description:
  • Identifies whether a node is a dead end and applies the corresponding status.

Source:
Parameters:
Name Type Description
nodeId string

The ID of the node to check

nodes Object

Map of all nodes in the tree

checkSmallWin()

Description:
  • Hilfsfunktion für lokalen Sieg

Source:

createAgentFromProfile(profileKey, customConfigopt) → {Agent|null}

Description:
  • Factory-Funktion zum Erstellen von Agenten aus Profilen.

Source:
Parameters:
Name Type Attributes Default Description
profileKey string

Schlüssel aus AgentProfiles

customConfig boolean <optional>
false

Ob benutzerdefinierte Konfiguration erlaubt ist

Returns:

Der erstellte Agent oder null

Type
Agent | null

createGame(gameName) → {TTTGameAdapter|null}

Description:
  • Erstellt eine neue Spielinstanz nach Name.

Source:
Parameters:
Name Type Description
gameName string
Returns:
Type
TTTGameAdapter | null

createStrategyTree(type, levelopt) → {DecisionTree}

Description:
  • Factory: Erstellt Entscheidungsbaum nach Spieltyp und Schwierigkeitsstufe.

Source:
Parameters:
Name Type Attributes Default Description
type string regular

'regular' | '3d' | 'ultimate'

level string <optional>
'advanced'

'elementary' | 'advanced'

  • elementary: Einfache Prioritätsliste (Win → Block → Positional → Random)
  • advanced: Echte Verzweigungen mit ConditionNodes
Returns:
Type
DecisionTree

debugLog(domain, level, …args)

Description:
  • Schreibt einen Debug-Logeintrag gemäß globaler Debug-Konfiguration. Gibt in console aus UND optional in Datei (/log/debug-*.log wenn OUTPUT_FILE=true)

Source:
Parameters:
Name Type Attributes Description
domain string

Domain aus DEBUG_DOMAINS

level DebugLevel

Log-Level ('debug', 'warn', 'error', 'critical')

args any <repeatable>

Log-Argumente (formatiert wie console.log)

debugShouldLog(domain, levelopt) → {boolean}

Description:
  • Entscheidet, ob ein Logeintrag geschrieben werden soll. Hierarchisch: Global > Critical > Domain-spezifisch > Parent-Domain

Source:
Parameters:
Name Type Attributes Default Description
domain string

Domain aus DEBUG_DOMAINS

level DebugLevel <optional>
'debug'

Log-Level

Returns:
Type
boolean

drawRotateBoard(board, canvas, ctx)

Description:
  • Zeichnet das Board auf den Canvas.

Source:
Parameters:
Name Type Description
board RotateBoard

Das Spielbrett.

canvas HTMLCanvasElement

Das Canvas-Element.

ctx CanvasRenderingContext2D

Der Kontext.

findLowestCommonAncestor(nodeA, nodeB, nodeParentMap) → {object}

Description:
  • Finds the Lowest Common Ancestor (LCA) of two nodes.

Source:
Parameters:
Name Type Description
nodeA number

First node

nodeB number

Second node

nodeParentMap Map

Tree structure map

Returns:

{ lca: nodeId, stepsFromA: number, stepsFromB: number }

Type
object

findPathToRoot(nodeId, nodeParentMap) → {Array.<number>}

Description:
  • Finds the path from any node to the root node.

Source:
Parameters:
Name Type Description
nodeId number

Starting node

nodeParentMap Map

Map where key=childId, value=parentId

Returns:

Path from nodeId to root: [nodeId, parent, grandparent, ..., root]

Type
Array.<number>

getAvailableGames() → {Array.<string>}

Description:
  • Gibt alle verfügbaren Spiele als Liste zurück.

Source:
Returns:
Type
Array.<string>

getAvailableProfiles() → {Array.<Object>}

Description:
  • Gibt alle verfügbaren Profile als Array zurück.

Source:
Returns:
Type
Array.<Object>

getConnect4HeuristicsConfig(variantopt, profileopt) → {Object}

Description:
  • Factory-Funktion: Lädt die Konfiguration für eine Connect4-Variante und ein Profil.

Source:
Parameters:
Name Type Attributes Default Description
variant string <optional>
'regular'

'regular' oder '3d'.

profile string <optional>
'v1_baseline'

'v1_baseline', 'v2_positional' oder 'v3_aggressive'.

Returns:

Validierte Heuristik-Konfiguration.

Type
Object

getConnect4ProfileList(variantopt) → {Array.<{id: string, name: string, description: string}>}

Description:
  • Gibt alle verfügbaren Profile für eine Connect4-Variante zurück.

Source:
Parameters:
Name Type Attributes Default Description
variant string <optional>
'regular'

Spielvariante.

Returns:
Type
Array.<{id: string, name: string, description: string}>

getNodeStyle(node, statusTypes, config) → {Object}

Description:
  • Gibt Style-Objekt für einen Knoten basierend auf Status Kombiniert Status (z.B. ACTIVE + DEAD_END) zu konsistentem Styling

Source:
Parameters:
Name Type Description
node Object
statusTypes Object

Status-Definitionen

config Object

Engine config with enableStatusGlow

Returns:

{ glowColor, borderColor, borderWidth, borderDash, fillColor }

Type
Object

getProfilesByType(type) → {Array.<Object>}

Description:
  • Filtert Profile nach Typ.

Source:
Parameters:
Name Type Description
type string

"minimax", "ruleBased", "random"

Returns:
Type
Array.<Object>

getTTTHeuristicsConfig(variantopt, profileopt) → {Object}

Description:
  • Factory-Funktion: Lädt die Konfiguration für eine TTT-Variante und ein Profil.

Source:
Parameters:
Name Type Attributes Default Description
variant string <optional>
'regular'

'regular', '3d' oder 'ultimate'.

profile string <optional>
'v1_baseline'

'v1_baseline', 'v2_positional' oder 'v3_aggressive'.

Returns:

Validierte Heuristik-Konfiguration.

Type
Object

getTTTProfileList(variantopt) → {Array.<{id: string, name: string, description: string}>}

Description:
  • Gibt alle verfügbaren Profile für eine TTT-Variante zurück.

Source:
Parameters:
Name Type Attributes Default Description
variant string <optional>
'regular'

Spielvariante.

Returns:
Type
Array.<{id: string, name: string, description: string}>

handleCreateNetwork(topology)

Description:
  • Erstellt ein neues Netzwerk mit der gegebenen Topologie.

Source:
Parameters:
Name Type Description
topology NetworkTopology

handleForwardPass(payload)

Description:
  • Einzelner Forward-Pass für Prediction.

Source:
Parameters:
Name Type Description
payload Object
Properties
Name Type Attributes Description
input Array.<number>

Eingabedaten

legalMask Array.<number> <optional>

Maske für legale Züge

handleSetBias(payload)

Description:
  • Setzt einen Bias.

Source:
Parameters:
Name Type Description
payload Object

handleSetWeight(payload)

Description:
  • Setzt ein einzelnes Gewicht.

Source:
Parameters:
Name Type Description
payload Object

handleStartTraining(config)

Description:
  • Startet den Trainings-Loop. Sendet adaptiv Snapshots (~60fps-Target) an den Main-Thread.

Source:
Parameters:
Name Type Description
config Object
Properties
Name Type Attributes Default Description
dataset Array.<TrainingSample>

Trainingsdaten

epochs number

Anzahl der Epochen

snapshotInterval number <optional>
16

Snapshot-Intervall in ms

maskedSoftmax(rawOutput, mask) → {Float64Array}

Description:
  • Maskiert illegale Züge und wendet Softmax an. Besetzte Felder erhalten -∞ vor dem Softmax, damit ihre Wahrscheinlichkeit ≈ 0 wird.

Source:
Parameters:
Name Type Description
rawOutput Float64Array | Array.<number>

Rohe Netzwerk-Ausgabe

mask Array.<number>

Maske: 1 = erlaubt, 0 = blockiert

Returns:

Wahrscheinlichkeitsverteilung über legale Aktionen

Type
Float64Array

reconstructTreePath(fromNodeId, toNodeId, nodeParentMap, treeStructure) → {object}

Description:
  • HIGH-LEVEL: Reconstructs complete navigation path between two nodes. Combines LCA finding and move extraction into a single call.

Source:
Parameters:
Name Type Description
fromNodeId number

Current node

toNodeId number

Target node

nodeParentMap Map

Parent map

treeStructure Map

Node structure with children Map

Returns:

{ backwardSteps: number, // How many times to backtrack forwardMoves: [{ r, c }, ...], // Board coordinates to move to lca: number, // Lowest common ancestor isValid: boolean // Whether path is complete }

Type
object

runTrainingLoop(dataset, totalEpochs, snapshotInterval)

Description:
  • Trainings-Loop mit adaptiver Snapshot-Frequenz. Verwendet setTimeout(0) nach jedem Batch, um dem Message-Handler die Chance zu geben, STOP-Befehle zu verarbeiten.

Source:
Parameters:
Name Type Description
dataset Array.<TrainingSample>
totalEpochs number
snapshotInterval number

setActiveNode(nodeId, nodes, activeNodeTracking)

Description:
  • Setzt den Active Node (exclusive - entfernt ACTIVE von allen anderen)

Source:
Parameters:
Name Type Description
nodeId number
nodes Map
activeNodeTracking Object

softmax(values) → {Float64Array}

Description:
  • Softmax-Funktion für Vektoren (gesamter Layer). Wird separat behandelt, da sie über alle Neuronen eines Layers operiert und nicht pro Neuron angewendet werden kann.

Source:
Parameters:
Name Type Description
values Float64Array | Array.<number>

Rohwerte (logits) des Output-Layers

Returns:

Wahrscheinlichkeitsverteilung (Summe = 1)

Type
Float64Array

(async) solveBFS() → {Promise.<({path: Array.<string>, nodes: number, duplicates: number}|null)>}

Description:
  • Findet den kürzesten Weg mittels Breitensuche (BFS). Wrapper für SearchEngine, der asynchron läuft um das UI nicht zu blockieren.

    • @param {RotateBoard} startBoard - Der Startzustand.
Source:
Returns:

Das Ergebnisobjekt oder null.

Type
Promise.<({path: Array.<string>, nodes: number, duplicates: number}|null)>

updateActiveNodePosition(activeNodeTracking, nodes, viewport, canvas, config)

Description:
  • Aktualisiert Active Node Tracking Zentriert View auf aktiven Node mit optionaler Animation (Pausiert während Pan/Zoom-Interaktionen)

Source:
Parameters:
Name Type Description
activeNodeTracking Object

{ nodeId, paused, targetX, targetY, animating, ... }

nodes Map
viewport Object

{ offsetX, offsetY, scale }

canvas Object

{ width, height }

config Object

{ activeNodeTrackingSmooth, activeNodeTrackingDuration }

updateNodeStatus(node, status, active)

Description:
  • Aktualisiert Node-Status (addStatus, removeStatus, setStatus)

Source:
Parameters:
Name Type Description
node Object
status string
active boolean

true = add, false = remove

validateHeuristicConfig(config) → {Object}

Description:
  • Validiert eine Heuristik-Konfiguration gegen das zentrale Schema. Unterstützt optionales profile-Feld und description-Feld.

Source:
Parameters:
Name Type Description
config Object

Rohkonfiguration.

Returns:

Validierte Konfiguration mit normalisierten Gewichten.

Type
Object

Type Definitions

ActivationFunction

Source:
Properties:
Name Type Description
name string

Name der Funktion

fn function

Vorwärtsberechnung (Skalar)

derivative function

Ableitung; erwartet Output und optional preActivation (z.B. ReLU)

Type:
  • Object

DebugLevel

Description:
  • Zentrale Debug-Konfiguration für WolfsWorld

    Zweck: Hierarchisches, strukturiertes Logging-System für alle Module des Projekts. Erlaubt gezieltes Debugging von Spiellogik, KI-Algorithmen und Visualisierungen ohne Code-Änderungen - nur durch Config-Flags an/aus.

    ============================================================================ LOGGING KONVENTIONEN (MUSS eingehalten werden!)

    1. KEIN direktes console.log/console.warn/console.error in Feature-Code! ❌ FALSCH: console.log('Debug message:', obj); ✅ RICHTIG: DebugConfig.log(DEBUG_DOMAINS.MY_DOMAIN, 'debug', 'Message:', obj);

    2. Jedes Log MUSS einer Domain zugeordnet sein → Ermöglicht gezieltes Debugging (nur MY_DOMAIN, nicht alles) → Siehe DEBUG_DOMAINS unten für verfügbare Domains → Nicht sicher? Nutz ähnliche oder parent-Domain

    3. Strukturierte Payloads nutzen (Objekte, keine String-Konkatenation) ❌ console.log('Agent: ' + name + ', Depth: ' + depth); ✅ DebugConfig.log(domain, 'debug', 'Agent info:', { name, depth }); Vorteil: Browser DevTools können Objects expandieren, nicht nur unformatiert Text

    4. Korrekte Levels verwenden:

      • 'debug': Normale Operationen, State-Changes, Flow-Info → Nur sichtbar wenn Domain-Flag = true
      • 'warn': Unerwartetes aber recoverable (z.B. invalid input, fallback) → IMMER sichtbar wenn DEBUG_CRITICAL = true (auch ohne Domain)
      • 'error': Fehler der abgefangen werden (~errors, wie null-checks) → IMMER sichtbar wenn DEBUG_CRITICAL = true
      • 'critical': Kritische Systemfehler (sollte nicht passieren!) → IMMER sichtbar wenn DEBUG_CRITICAL = true
    5. Globale Overrides nutzen für schnelles Debugging: DEBUG_ALL = true → Alle Logs sichtbar (maximale Verbosität) DEBUG_CRITICAL = true → Nur Fehler/Warnings/Critical (default) DEBUG_GAMES = true → Alle Spiele (aber nicht AI/VIZ)

    ============================================================================ QUICK START - Die häufigsten Use Cases

    // Use Case 1: Nur TTT debuggen DEBUG_CONFIG.DEBUG_GAMES_TICTACTOE = true; // Zeigt alle TTT Logs (regular, 3D, Ultimate) // DebugConfig.log(DEBUG_DOMAINS.GAMES_TTT_REGULAR, 'debug', ...) sichtbar

    // Use Case 2: Nur MinimaxAgent Fehler sehen DEBUG_CONFIG.DEBUG_CRITICAL = true; // ← Default, error/warn/critical immer // Zeigt alle Errors/Warnings/Critical, unabhängig von Domains

    // Use Case 3: Komplettes Debugging (alles sehen) DEBUG_CONFIG.DEBUG_ALL = true; // Zeigt ALLES - aber sehr verbose!

    // Use Case 4: AI Heuristiken debuggen DEBUG_CONFIG.DEBUG_AI_HEURISTICS_TTT = true; // Zeigt nur TTT Heuristic Logs

    // Use Case 5: Logs in Datei speichern DEBUG_CONFIG.OUTPUT_FILE = true; // Logs werden in /log/debug-DATUM.log geschrieben (zusätzlich zu console)

    ============================================================================ HIERARCHIE & LOOKUP LOGIK

    Domains sind hierarchisch strukturiert:

    GAMES ├─ GAMES_TICTACTOE │ ├─ GAMES_TTT_REGULAR │ ├─ GAMES_TTT_3D │ └─ GAMES_TTT_ULTIMATE ├─ GAMES_ROTATEBOX ├─ GAMES_NIM └─ GAMES_CONNECT4

    AI ├─ AI_MINIMAX ├─ AI_ABPRUNING ├─ AI_HEURISTICS │ ├─ AI_HEURISTICS_TTT │ └─ AI_HEURISTICS_CONNECT4 ├─ AI_RULES │ ├─ AI_RULES_TTT │ └─ AI_RULES_CONNECT4 ├─ AI_AGENTS │ ├─ AI_AGENT_MINIMAX │ ├─ AI_AGENT_RULES │ └─ AI_AGENT_RANDOM └─ AI_SEARCH_ALGORITHMS

    Lookup funktioniert so:

    1. DebugConfig.log(DEBUG_DOMAINS.GAMES_TTT_REGULAR, 'debug', msg) aufgerufen
    2. debugShouldLog() prüft: DEBUG_GAMES_TTT_REGULAR? → true? → sichtbar
    3. Wenn nein, prüft parent: DEBUG_GAMES? → true? → sichtbar
    4. Wenn nein, alle false → unsichtbar

    Vorteil: DEBUG_GAMES=true zeigt ALLE Spiele, aber nicht AI/VIZ

    ============================================================================ FLAG NAMING CONVENTION

    DEBUG_: Parent Flag (z.B. DEBUG_GAMES) DEBUG_: Sub-Module (z.B. DEBUG_GAMES_TTT_REGULAR) DEBUG<>_: Spiel-Spezifisch (z.B. DEBUG_HEURISTICS_TTT) DEBUG_CRITICAL: Globales Critical Level Flag DEBUG_ALL: Globales Override Flag OUTPUT_FILE: Logs in Datei schreiben

    ============================================================================ DEBUGGING TIP: OUTPUT_FILE Feature

    Wenn OUTPUT_FILE = true:

    • Alle Logs werden AUCH in /log/debug-DATUM-ZEIT.log geschrieben
    • Format: [LEVEL] [DOMAIN] [TIMESTAMP] Nachricht
    • Perfekt für Performance-Profiling oder Post-Session Analyse
    • /log Verzeichnis ist in .gitignore (nicht committet)

    Beispiel .log Datei: [debug] [GAMES_TTT_REGULAR] 15:32:04.123 Move executed: {"move":[0,1],"player":1} [warn] [AI_MINIMAX] 15:32:05.456 Depth limit exceeded [error] [CORE_GAME_CONTROLLER] 15:32:06.789 Canvas not found

    ============================================================================ WEITERE RESSOURCEN

    Vollständige Dokumentation:

    • STRUKTUR_AUDIT_ALLE_JS_DATEIEN.md - Alle 65 JS Dateien, ihre Domains
    • CONSOLE_LOG_STANDARDISIERUNG.md - Konvention & Rationale
    • BESTANDSERFASSUNG_CONSOLE_LOGS.md - Vorhandene Logs
    • PHASE2_MIGRATIONS_CHECKLISTE.md - Wie man Code migriert
    • INDEX_CONSOLE_LOG_STANDARDISIERUNG.md - Einstiegspunkt für alles
Source:

Zentrale Debug-Konfiguration für WolfsWorld

Zweck: Hierarchisches, strukturiertes Logging-System für alle Module des Projekts. Erlaubt gezieltes Debugging von Spiellogik, KI-Algorithmen und Visualisierungen ohne Code-Änderungen - nur durch Config-Flags an/aus.

============================================================================ LOGGING KONVENTIONEN (MUSS eingehalten werden!)

  1. KEIN direktes console.log/console.warn/console.error in Feature-Code! ❌ FALSCH: console.log('Debug message:', obj); ✅ RICHTIG: DebugConfig.log(DEBUG_DOMAINS.MY_DOMAIN, 'debug', 'Message:', obj);

  2. Jedes Log MUSS einer Domain zugeordnet sein → Ermöglicht gezieltes Debugging (nur MY_DOMAIN, nicht alles) → Siehe DEBUG_DOMAINS unten für verfügbare Domains → Nicht sicher? Nutz ähnliche oder parent-Domain

  3. Strukturierte Payloads nutzen (Objekte, keine String-Konkatenation) ❌ console.log('Agent: ' + name + ', Depth: ' + depth); ✅ DebugConfig.log(domain, 'debug', 'Agent info:', { name, depth }); Vorteil: Browser DevTools können Objects expandieren, nicht nur unformatiert Text

  4. Korrekte Levels verwenden:

    • 'debug': Normale Operationen, State-Changes, Flow-Info → Nur sichtbar wenn Domain-Flag = true
    • 'warn': Unerwartetes aber recoverable (z.B. invalid input, fallback) → IMMER sichtbar wenn DEBUG_CRITICAL = true (auch ohne Domain)
    • 'error': Fehler der abgefangen werden (~errors, wie null-checks) → IMMER sichtbar wenn DEBUG_CRITICAL = true
    • 'critical': Kritische Systemfehler (sollte nicht passieren!) → IMMER sichtbar wenn DEBUG_CRITICAL = true
  5. Globale Overrides nutzen für schnelles Debugging: DEBUG_ALL = true → Alle Logs sichtbar (maximale Verbosität) DEBUG_CRITICAL = true → Nur Fehler/Warnings/Critical (default) DEBUG_GAMES = true → Alle Spiele (aber nicht AI/VIZ)

============================================================================ QUICK START - Die häufigsten Use Cases

// Use Case 1: Nur TTT debuggen DEBUG_CONFIG.DEBUG_GAMES_TICTACTOE = true; // Zeigt alle TTT Logs (regular, 3D, Ultimate) // DebugConfig.log(DEBUG_DOMAINS.GAMES_TTT_REGULAR, 'debug', ...) sichtbar

// Use Case 2: Nur MinimaxAgent Fehler sehen DEBUG_CONFIG.DEBUG_CRITICAL = true; // ← Default, error/warn/critical immer // Zeigt alle Errors/Warnings/Critical, unabhängig von Domains

// Use Case 3: Komplettes Debugging (alles sehen) DEBUG_CONFIG.DEBUG_ALL = true; // Zeigt ALLES - aber sehr verbose!

// Use Case 4: AI Heuristiken debuggen DEBUG_CONFIG.DEBUG_AI_HEURISTICS_TTT = true; // Zeigt nur TTT Heuristic Logs

// Use Case 5: Logs in Datei speichern DEBUG_CONFIG.OUTPUT_FILE = true; // Logs werden in /log/debug-DATUM.log geschrieben (zusätzlich zu console)

============================================================================ HIERARCHIE & LOOKUP LOGIK

Domains sind hierarchisch strukturiert:

GAMES ├─ GAMES_TICTACTOE │ ├─ GAMES_TTT_REGULAR │ ├─ GAMES_TTT_3D │ └─ GAMES_TTT_ULTIMATE ├─ GAMES_ROTATEBOX ├─ GAMES_NIM └─ GAMES_CONNECT4

AI ├─ AI_MINIMAX ├─ AI_ABPRUNING ├─ AI_HEURISTICS │ ├─ AI_HEURISTICS_TTT │ └─ AI_HEURISTICS_CONNECT4 ├─ AI_RULES │ ├─ AI_RULES_TTT │ └─ AI_RULES_CONNECT4 ├─ AI_AGENTS │ ├─ AI_AGENT_MINIMAX │ ├─ AI_AGENT_RULES │ └─ AI_AGENT_RANDOM └─ AI_SEARCH_ALGORITHMS

Lookup funktioniert so:

  1. DebugConfig.log(DEBUG_DOMAINS.GAMES_TTT_REGULAR, 'debug', msg) aufgerufen
  2. debugShouldLog() prüft: DEBUG_GAMES_TTT_REGULAR? → true? → sichtbar
  3. Wenn nein, prüft parent: DEBUG_GAMES? → true? → sichtbar
  4. Wenn nein, alle false → unsichtbar

Vorteil: DEBUG_GAMES=true zeigt ALLE Spiele, aber nicht AI/VIZ

============================================================================ FLAG NAMING CONVENTION

DEBUG_: Parent Flag (z.B. DEBUG_GAMES) DEBUG_: Sub-Module (z.B. DEBUG_GAMES_TTT_REGULAR) DEBUG<>_: Spiel-Spezifisch (z.B. DEBUG_HEURISTICS_TTT) DEBUG_CRITICAL: Globales Critical Level Flag DEBUG_ALL: Globales Override Flag OUTPUT_FILE: Logs in Datei schreiben

============================================================================ DEBUGGING TIP: OUTPUT_FILE Feature

Wenn OUTPUT_FILE = true:

  • Alle Logs werden AUCH in /log/debug-DATUM-ZEIT.log geschrieben
  • Format: [LEVEL] [DOMAIN] [TIMESTAMP] Nachricht
  • Perfekt für Performance-Profiling oder Post-Session Analyse
  • /log Verzeichnis ist in .gitignore (nicht committet)

Beispiel .log Datei: [debug] [GAMES_TTT_REGULAR] 15:32:04.123 Move executed: {"move":[0,1],"player":1} [warn] [AI_MINIMAX] 15:32:05.456 Depth limit exceeded [error] [CORE_GAME_CONTROLLER] 15:32:06.789 Canvas not found

============================================================================ WEITERE RESSOURCEN

Vollständige Dokumentation:

  • STRUKTUR_AUDIT_ALLE_JS_DATEIEN.md - Alle 65 JS Dateien, ihre Domains
  • CONSOLE_LOG_STANDARDISIERUNG.md - Konvention & Rationale
  • BESTANDSERFASSUNG_CONSOLE_LOGS.md - Vorhandene Logs
  • PHASE2_MIGRATIONS_CHECKLISTE.md - Wie man Code migriert
  • INDEX_CONSOLE_LOG_STANDARDISIERUNG.md - Einstiegspunkt für alles
Type:
  • 'debug' | 'warn' | 'error' | 'critical'

LayerConfig

Source:
Properties:
Name Type Attributes Default Description
neuronCount number

Anzahl der Neuronen in diesem Layer

inputCount number

Anzahl der Eingänge pro Neuron (= Neuronen des vorherigen Layers)

activation string <optional>
'relu'

Name der Aktivierungsfunktion

initMethod string <optional>
'xavier'

Gewichts-Initialisierungsmethode

useSoftmax boolean <optional>
false

Softmax als Vektor-Aktivierung (nur Output-Layer)

Type:
  • Object

LayerSnapshot

Source:
Properties:
Name Type Description
index number

Index des Layers im Netzwerk

neuronCount number

Anzahl der Neuronen

activation string

Name der Aktivierungsfunktion

useSoftmax boolean

Ob Softmax aktiv ist

outputs Float64Array

Output-Werte aller Neuronen

neurons Array.<NeuronSnapshot>

Snapshots aller Neuronen

Type:
  • Object

LossFunction

Source:
Properties:
Name Type Description
name string

Name der Verlustfunktion

compute function

Berechnet den Gesamtverlust

derivative function

Gradient bzgl. predicted

Type:
  • Object

NetworkSnapshot

Source:
Properties:
Name Type Description
topology Array.<number>

Layer-Größen [input, h1, ..., output]

activations Array.<string>

Aktivierungsfunktionen pro Layer

learningRate number

Aktuelle Lernrate

totalParameters number

Gesamtzahl der Parameter

layers Array.<LayerSnapshot>

Snapshots aller Layers (ohne Input-Layer)

epoch number

Aktuelle Epoche (falls im Training)

loss number

Aktueller Verlust

Type:
  • Object

NetworkTopology

Source:
Properties:
Name Type Attributes Default Description
layers Array.<number>

Neuronen pro Layer [inputSize, hidden1, ..., outputSize]

activations Array.<string> <optional>

Aktivierungsfunktion pro Layer (ohne Input-Layer)

outputActivation string <optional>
'softmax'

Aktivierung des Output-Layers

lossFunction string <optional>
'crossEntropy'

Verlustfunktion

learningRate number <optional>
0.01

Lernrate

initMethod string <optional>
'xavier'

Gewichts-Initialisierung

Type:
  • Object

NeuronSnapshot

Source:
Properties:
Name Type Description
index number

Index des Neurons im Layer

weights Float64Array

Aktuelle Gewichte

bias number

Aktueller Bias

output number

Letzter Aktivierungswert

preActivation number

Letzter z-Wert (vor Aktivierung)

gradients Float64Array | null

Letzte Gewichts-Gradienten (nach Backprop)

Type:
  • Object

NodeRenderStyle

Source:
Properties:
Name Type Attributes Description
fillColor string

Füllfarbe aus Status-Config

borderColor string

Randfarbe aus Status-Config (z.B. grün für READY)

borderWidth number

Randbreite aus Status-Config

glowColor string <optional>

Glow-Farbe (optional)

borderDash Array.<number> <optional>

Strichmuster für den Rand

Type:
  • Object

NumericNodeMetadata

Source:
Properties:
Name Type Attributes Description
value number | null

Numerischer Knotenwert (Minimax-Score)

isMaximizing boolean

true = MAX-Knoten, false = MIN-Knoten

isPruned boolean <optional>

Wurde der Knoten durch Pruning abgeschnitten?

alpha number <optional>

Alpha-Schwellenwert (nur bei Alpha-Beta)

beta number <optional>

Beta-Schwellenwert (nur bei Alpha-Beta)

showAlphaBeta boolean <optional>

Explizites Gate: false unterdrückt α/β-Anzeige (Default: true)

depth number <optional>

Tiefe im Baum

isTerminal boolean <optional>

Ist der Knoten ein Blattknoten?

label string <optional>

Optionales Textlabel (z.B. "A", "B1")

Type:
  • Object

OrchestratorConfig

Source:
Properties:
Name Type Attributes Default Description
bridge IframeBridgeHost | IframeBridgeClient

Die IframeBridge-Instanz

workerPath string <optional>
'js/ai/neural/worker/nn-training-worker.js'

Pfad zum Worker

onSnapshot function <optional>

Optional: Lokaler Snapshot-Callback

onTrainingComplete function <optional>

Optional: Training-Ende Callback

onError function <optional>

Optional: Fehler-Callback

Type:
  • Object

SearchConfig

Description:
  • Konfiguration für die Suchmaschine.

Source:
Properties:
Name Type Attributes Default Description
strategy 'BFS' | 'DFS' <optional>
'BFS'

'BFS' (Breitensuche) oder 'DFS' (Tiefensuche).

maxDepth number <optional>
1000

Abbruch bei dieser Tiefe.

checkDuplicates boolean <optional>
true

Verhindert Zyklen durch Hash-Set.

sortSuccessors function <optional>
null

Heuristik zum Sortieren der Nachfolger (z.B. Warnsdorf).

onStep function <optional>
null

Callback für jeden Schritt (Visualisierung). Rückgabe 'STOP' bricht ab.

Konfiguration für die Suchmaschine.

Type:
  • Object

TrainingResult

Source:
Properties:
Name Type Description
epoch number

Epoche

loss number

Durchschnittlicher Verlust

accuracy number

Genauigkeit (für Klassifikation)

Type:
  • Object

TrainingSample

Source:
Properties:
Name Type Description
input Float64Array | Array.<number>

Eingabedaten

target Float64Array | Array.<number>

Zielwerte (One-Hot oder Regression)

Type:
  • Object