Flocc
    Preparing search index...

    Class Experiment

    Orchestrates multiple simulation runs with parameter variations.

    const experiment = new Experiment({
    model: ({ parameters, seed }) => {
    utils.seed(seed);
    const env = new Environment({ width: 400, height: 400 });
    for (let i = 0; i < parameters.agentCount; i++) {
    env.addAgent(new Agent({ speed: parameters.speed }));
    }
    return env;
    },
    parameters: {
    agentCount: [10, 20, 30],
    speed: { min: 1, max: 2, step: 0.5 },
    },
    replications: 10,
    maxTicks: 500,
    record: {
    model: {
    population: (env) => env.getAgents().length,
    },
    },
    });

    const results = await experiment.run();
    console.log(results.summary());

    0.7.0

    Index

    Constructors

    Methods

    • Get all parameter combinations that will be tested.

      Returns Record<string, any>[]