"""Seed management: one master seed -> named independent streams (common random numbers). Streams: 'fundamentals' (dividend path), 'news', 'slots', 'assign', 'llm_assign', 'agents' (one sub-stream per agent id), 'activation', 'tiebreak'. A treatment that changes only `llm_share` leaves every other stream's draws untouched, so matched pairs share fundamentals, news and endowments.""" from __future__ import annotations import numpy as np STREAMS = ("fundamentals", "news", "slots", "assign", "llm_assign", "activation", "tiebreak", "mock_llm", "shuffle") def make_streams(seed: int) -> dict[str, np.random.Generator]: ss = np.random.SeedSequence(seed) children = ss.spawn(len(STREAMS)) return {name: np.random.Generator(np.random.PCG64(c)) for name, c in zip(STREAMS, children)} def agent_rng(seed: int, agent_id: int) -> np.random.Generator: return np.random.Generator(np.random.PCG64(np.random.SeedSequence([seed, 7_919, agent_id])))