Files
P42_godDaemons/GPS/simulationState.js
T
2026-06-13 13:47:46 +00:00

24 lines
633 B
JavaScript

export const SimState = {
IDLE: 'idle',
PREPARE: 'prepare',
LIVE: 'live',
}
export function validateAgentSets(expected, found) {
if(!Array.isArray(expected) || !Array.isArray(found)) {
return('agentIds must be arrays')
}
const exp = new Set(expected)
const fnd = new Set(found)
if(exp.size !== fnd.size) {
return(`Agent count mismatch: expected ${exp.size}, found ${fnd.size}`)
}
for(const id of exp) {
if(!fnd.has(id)) return(`Missing agent: ${id}`)
}
for(const id of fnd) {
if(!exp.has(id)) return(`Unexpected agent: ${id}`)
}
return(null)
}