maestro refacto to grrom, getpositions actions transfered to Observer, changed to frustum, with subscription

This commit is contained in:
STEINNI
2026-06-14 10:16:56 +00:00
parent f3102d5fbc
commit c399f9ddb4
21 changed files with 760 additions and 185 deletions
+6 -6
View File
@@ -1,22 +1,22 @@
export class ArenaGroom {
constructor(arenaCnx, storage, debug = false) {
constructor(arenaCnx, arenaStorage, debug = false) {
this.cnx = arenaCnx
this.storage = storage
this.arenaStorage = arenaStorage
this.debug = debug
}
agentHashKey(agentId) {
return(this.storage.agentHashKey.replace(/\[UID\]/g, agentId))
return(this.arenaStorage.agentHashKey.replace(/\[UID\]/g, agentId))
}
async clearArena() {
const ids = await this.cnx.redisSmembers(this.storage.agentsIndexKey)
const ids = await this.cnx.redisSmembers(this.arenaStorage.agentsIndexKey)
for(const id of ids) {
await this.cnx.redisDel(this.agentHashKey(id))
}
await this.cnx.redisDel(this.storage.agentsIndexKey)
await this.cnx.redisDel(this.arenaStorage.agentsIndexKey)
if(this.debug) console.log(`[Maestro] Cleared arena store (${ids.length} agent(s))`)
}
@@ -25,7 +25,7 @@ export class ArenaGroom {
const key = this.agentHashKey(agent.id)
await this.cnx.redisHset(key, 'position', agent.position)
await this.cnx.redisHset(key, 'vector', agent.vector)
await this.cnx.redisSadd(this.storage.agentsIndexKey, agent.id)
await this.cnx.redisSadd(this.arenaStorage.agentsIndexKey, agent.id)
}
if(this.debug) console.log(`[Maestro] Groomed ${agents.length} agent(s) into arena store`)
}