Compare commits
1 Commits
mimo/code/
...
burn/20260
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
770ed8c27a |
11
app.js
11
app.js
@@ -648,6 +648,7 @@ function setupGOFAI() {
|
||||
|
||||
// Setup Planner
|
||||
symbolicPlanner.addAction('Stabilize Matrix', { energy: 50 }, { stability: 1.0 });
|
||||
symbolicPlanner.addAction('Shed Portal Load', { activePortals: 1 }, { activePortals: 0, stability: 0.8 });
|
||||
}
|
||||
|
||||
function deriveGOFAIState(elapsed) {
|
||||
@@ -657,6 +658,12 @@ function deriveGOFAIState(elapsed) {
|
||||
return { stability, energy, activePortals: activePortal ? 1 : 0 };
|
||||
}
|
||||
|
||||
function deriveGOFAIGoal(facts) {
|
||||
if (facts.get('CRITICAL_DRAIN_PATTERN')) return { activePortals: 0, stability: 0.8 };
|
||||
if (facts.get('UNSTABLE_OSCILLATION')) return { stability: 1.0 };
|
||||
return { stability: Math.max(0.7, facts.get('stability') || 0.7) };
|
||||
}
|
||||
|
||||
function updateGOFAI(delta, elapsed) {
|
||||
const startTime = performance.now();
|
||||
|
||||
@@ -666,8 +673,8 @@ function updateGOFAI(delta, elapsed) {
|
||||
// Run reasoning
|
||||
if (Math.floor(elapsed * 2) > Math.floor((elapsed - delta) * 2)) {
|
||||
symbolicEngine.reason();
|
||||
pseLayer.offloadReasoning(Array.from(symbolicEngine.facts.entries()), symbolicEngine.rules.map((r) => ({ description: r.description, triggerFacts: r.triggerFacts })));
|
||||
pseLayer.offloadPlanning(Object.fromEntries(symbolicEngine.facts), { stability: 1.0 }, symbolicPlanner.actions);
|
||||
pseLayer.offloadReasoning(Array.from(symbolicEngine.facts.entries()), symbolicEngine.rules.map((r) => ({ description: r.description, triggerFacts: r.triggerFacts, workerOutcome: r.action(symbolicEngine.facts), confidence: 0.9 })));
|
||||
pseLayer.offloadPlanning(Object.fromEntries(symbolicEngine.facts), deriveGOFAIGoal(symbolicEngine.facts), symbolicPlanner.actions);
|
||||
document.getElementById("pse-task-count").innerText = parseInt(document.getElementById("pse-task-count").innerText) + 1;
|
||||
metaLayer.reflect();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ self.onmessage = function(e) {
|
||||
const { type, data } = e.data;
|
||||
if (type === 'REASON') {
|
||||
const factMap = new Map(data.facts || []);
|
||||
const results = (data.rules || []).filter((rule) => (rule.triggerFacts || []).every((fact) => factMap.get(fact))).map((rule) => ({ rule: rule.description, outcome: 'OFF-THREAD MATCH' }));
|
||||
const results = (data.rules || []).filter((rule) => (rule.triggerFacts || []).every((fact) => factMap.get(fact))).map((rule) => ({ rule: rule.description, outcome: rule.workerOutcome || 'OFF-THREAD MATCH', triggerFacts: rule.triggerFacts || [], confidence: rule.confidence ?? 0.5 }));
|
||||
self.postMessage({ type: 'REASON_RESULT', results });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user