diff --git a/app.js b/app.js index 0141002e..d6311039 100644 --- a/app.js +++ b/app.js @@ -650,11 +650,17 @@ function setupGOFAI() { symbolicPlanner.addAction('Stabilize Matrix', { energy: 50 }, { stability: 1.0 }); } +function deriveGOFAIState(elapsed) { + const activeBars = powerMeterBars.reduce((n, _, i) => n + ((((Math.sin(elapsed * 2 + i * 0.5) * 0.5) + 0.5) > (i / Math.max(powerMeterBars.length, 1))) ? 1 : 0), 0); + const energy = Math.round((activeBars / Math.max(powerMeterBars.length, 1)) * 100); + const stability = Math.max(0.1, Math.min(1, (wsConnected ? 0.55 : 0.2) + (agents.length * 0.05) - (portals.length * 0.03) - (activePortal ? 0.1 : 0) - (portalOverlayActive ? 0.05 : 0))); + return { stability, energy, activePortals: activePortal ? 1 : 0 }; +} + function updateGOFAI(delta, elapsed) { const startTime = performance.now(); - // Simulate perception - neuroBridge.perceive({ stability: 0.3, energy: 80, activePortals: 1 }); + neuroBridge.perceive(deriveGOFAIState(elapsed)); agentFSMs['timmy']?.update(symbolicEngine.facts); // Run reasoning