PARACOSM AGENTOS | API Reference v0.9.1035
Home Simulation API Docs GitHub npm
Home Simulation API Docs GitHub npm AgentOS Discord
paracosm - v0.9.1035
    Preparing search index...

    Function deathCount

    • Number of dead agents at snapshot time. Counts every agent ever present in the run, not just deaths-this-turn (use swarm.deaths for the per-turn delta).

      Parameters

      • swarm: {
            agents: {
                age?: number;
                agentId: string;
                alive: boolean;
                childrenIds?: string[];
                department: string;
                featured?: boolean;
                generation?: number;
                marsborn?: boolean;
                mood?: string;
                name: string;
                partnerId?: string;
                psychScore?: number;
                rank?: "junior" | "senior" | "lead" | "chief";
                role: string;
                shortTermMemory?: string[];
            }[];
            births?: number;
            deaths?: number;
            morale?: number;
            population: number;
            scenarioExtensions?: Record<string, unknown>;
            time: number;
            turn: number;
        }
        • agents: {
              age?: number;
              agentId: string;
              alive: boolean;
              childrenIds?: string[];
              department: string;
              featured?: boolean;
              generation?: number;
              marsborn?: boolean;
              mood?: string;
              name: string;
              partnerId?: string;
              psychScore?: number;
              rank?: "junior" | "senior" | "lead" | "chief";
              role: string;
              shortTermMemory?: string[];
          }[]

          Every agent in the swarm at snapshot time, alive or dead.

        • Optionalbirths?: number

          Number of births this turn.

        • Optionaldeaths?: number

          Number of deaths this turn.

        • Optionalmorale?: number

          Aggregate morale 0..1 (population-weighted).

        • population: number

          Aggregate counts derived from agents.

        • OptionalscenarioExtensions?: Record<string, unknown>
        • time: number

          Scenario time at snapshot (years/quarters/ticks per scenario).

        • turn: number

          Turn number this snapshot was taken at (0-indexed).

      Returns number