UNPKG

agentjs-core

Version:

A comprehensive agent-based modeling framework with built-in p5.js visualization

67 lines 1.93 kB
/** * RandomScheduler - Random activation order scheduler */ import { Scheduler } from './Scheduler'; import type { Agent } from '../agents/Agent'; /** * RandomScheduler - Activates agents in random order each step * * Features: * - True randomization with configurable seed * - Fisher-Yates shuffle algorithm for unbiased ordering * - Performance optimized for large agent populations * - Reproducible results when seed is set * * Educational Context: Simulates unpredictable real-world * activation patterns where community members act in * random order, reducing systematic biases in simulations. */ export declare class RandomScheduler extends Scheduler { /** Random number generator seed */ private seed; /** Current RNG state for reproducible randomness */ private rngState; constructor(seed?: number); /** * Get agent activation order (implementing abstract method) */ protected getActivationOrder(): ReadonlyArray<Agent>; /** * Get scheduler type (implementing abstract method) */ protected getSchedulerType(): string; /** * Schedule agents in random order */ schedule(agents: ReadonlyArray<Agent>): ReadonlyArray<Agent>; /** * Set random seed for reproducible results */ setSeed(seed: number): void; /** * Get current seed */ getSeed(): number | undefined; /** * Reset RNG state to original seed */ resetSeed(): void; /** * Get scheduler type */ getType(): string; /** * Get scheduler configuration */ getConfiguration(): Record<string, any>; /** * Shuffle array using Fisher-Yates algorithm with seeded RNG */ private shuffleArray; /** * Seeded random number generator (Linear Congruential Generator) * Returns value between 0 and 1 */ private seededRandom; } //# sourceMappingURL=RandomScheduler.d.ts.map