Flocc
    Preparing search index...

    Interface RecorderOptions

    Configuration options for the Recorder.

    interface RecorderOptions {
        agent?: Record<string, AgentMetric>;
        agentFilter?: (agent: Agent) => boolean;
        interval?: number | "tick" | "manual";
        model?: Record<string, ModelMetric>;
    }
    Index

    Properties

    agent?: Record<string, AgentMetric>

    Agent-level metrics to record. Each key is a metric name, and the value is a function that computes the metric from each agent. Disabled by default since it can generate large datasets.

    agent: {
    id: (agent) => agent.id,
    x: (agent) => agent.get('x'),
    energy: (agent) => agent.get('energy'),
    }
    agentFilter?: (agent: Agent) => boolean

    Optional filter for which agents to record (only applies if agent metrics defined).

    agentFilter: (agent) => agent.get('type') === 'prey'
    
    interval?: number | "tick" | "manual"

    When to collect data:

    • 'tick': every tick (default)
    • 'manual': only when recorder.record() is called
    • number: every N ticks
    model?: Record<string, ModelMetric>

    Model-level metrics to record. Each key is a metric name, and the value is a function that computes the metric from the environment.

    model: {
    population: (env) => env.getAgents().length,
    avgEnergy: (env) => utils.mean(env.stat('energy')),
    }