22 lines
2.1 KiB
JavaScript
22 lines
2.1 KiB
JavaScript
"use strict";
|
|
const fs = require("fs");
|
|
const moveSrc = fs.readFileSync("js/tarinai_social_move_life.js", "utf8");
|
|
const needSrc = fs.readFileSync("js/tarinai_needs_items.js", "utf8");
|
|
const actionSrc = fs.readFileSync("js/tarinai_action_definitions.js", "utf8");
|
|
const colonySrc = fs.readFileSync("js/colony_situation_system.js", "utf8");
|
|
function ok(cond, msg) { if (!cond) { console.error(`[FAIL] ${msg}`); process.exitCode = 1; } else console.log(`[OK] ${msg}`); }
|
|
ok(!moveSrc.includes('this.socialCrowdSample = {'), "contact scan no longer records crowd density");
|
|
ok(!needSrc.includes('const crowdSample = tarinai.socialCrowdSample'), "relation need no longer consumes crowd pressure");
|
|
ok(!actionSrc.includes('createCrowdEscapeActionSpec(),'), "crowd retreat action is not registered");
|
|
ok(!colonySrc.includes('nearestAverage('), "colony status no longer performs O(N^2) crowd distance scans");
|
|
ok(!colonySrc.includes('add("overcrowded"'), "overcrowded colony status is no longer selected");
|
|
ok(!moveSrc.includes('const candidateBudget = Math.max(20, scanLimit + 8)'), "contact candidates are no longer truncated by spatial bucket order");
|
|
ok(!moveSrc.includes('if (inspected >= candidateBudget) break'), "contact scans do not stop before considering nearer later candidates");
|
|
ok(moveSrc.includes('if (pos < scanLimit)'), "contact scan keeps a bounded nearest-candidate list");
|
|
ok(moveSrc.includes('if (detailed.length > scanLimit) detailed.pop()'), "nearest-candidate list remains bounded under dense populations");
|
|
ok(moveSrc.includes('const pairLeader = String(this.id) < String(o.id)'), "symmetric pair work has one deterministic leader");
|
|
ok(moveSrc.includes('const d2 = dx * dx + dy * dy'), "distance-squared prefilter is used");
|
|
ok(moveSrc.includes('const selfProfile = this.personalityProfile()'), "self personality profile is cached per scan");
|
|
ok(!moveSrc.includes('open.sort('), "social interaction does not introduce full sorting");
|
|
ok(moveSrc.includes('const combinedStartChance = 1 - (1 - oneDirectionChance) * (1 - oneDirectionChance)'), "single-pass pair processing preserves old start probability");
|
|
if (process.exitCode) process.exit(process.exitCode);
|