chc.research.meanfield¶
Stability tier: research.
Sequential mean-field control: steer a distribution of agents over a zone graph toward a target.
The "recommend a zone, agents migrate, new distribution" loop: agents adjust gradually toward the
softmax response to the per-tick incentives, so an action plays out over several ticks -- a planner
that anticipates the migration lag beats a myopic controller that only reacts to the mismatch.
Builds on the game response in chc.games.
MeanFieldControl
dataclass
¶
Agents migrate gradually toward incentivised zones; the platform steers them to a target.
rollout_cost(u_seq)
¶
Cumulative cost of a plan u_seq: distance-to-target + control effort.
plan(steps=400, lr=0.05, init=None)
¶
Projected-gradient MPC on u_seq through the rollout (warm-start from init).
regrets(steps=400)
¶
Regret vs the best plan found for no-control / myopic / planned mean-field control.
The planner warm-starts from the myopic open-loop plan, so it refines (never worsens) it. The oracle is the least cost among the myopic and planned plans, the planner run three times as long, SLSQP's refinements of the myopic and the long plan, and plain projected gradient from the myopic, planned and long plans at the fixed steps 1, 0.1 and 0.01, 2000 steps each, with SLSQP's refinement of the best: the best of local searches, not a proved optimum, and never above a plan it is compared with. The cost is not convex, and each search ends in the basin its start and step lead to. The planner run longer alone stalls: at the defaults, in float64, it costs 67.94; SLSQP from the myopic plan reaches 45.69, and projected gradient from it at the step 0.1 reaches 42.81, so against SLSQP alone every regret read 2.88 low.