-
Notifications
You must be signed in to change notification settings - Fork 13
brain_widget.py
Vicious Squid edited this page Apr 3, 2026
·
12 revisions
View source file: brain_widget.py (version 2.6.2.0)
Main neural network visualization and coordination hub. It serves as the central controller that owns the authoritative brain state, coordinates background worker threads, and integrates all the subsystems that make the neural network function. Everything flows through this widget—stat updates from the game, rendering requests, learning signals, and neurogenesis events all converge here before being dispatched to the appropriate handlers.
- Maintains the authoritative
statedictionary with all neuron activations (hunger, happiness, anxiety, etc.) - Manages
weightsdictionary for connection strengths between neurons - Tracks
neuron_positionsfor visualization layout
- Receives an external
BrainWorkerviaset_brain_worker()(avoids duplicate thread creation) - Owns a
BrainRenderWorkerfor offscreen rendering - Coordinates signal/slot connections between workers and UI
-
EnhancedNeurogenesisfor dynamic neuron creation -
ExperienceBufferfor tracking learning experiences -
EnhancedBrainTooltipsfor hover information - Theming with animation styles (Vibrant, Subtle, etc.)
- Brain state bridge for designer synchronization
-
update_brain_state(stats_dict)— main entry point for stat updates from the game -
set_brain_worker()— accepts external worker instance -
export_brain_state_for_designer()— syncs state with the Brain Designer tool
🦑 Raise digital squids whose brains grow & rewire themselves through Hebbian learning and Neurogenesis