AssignmentPlanner
Runs an IAssignmentPolicy as a dry run against a hypothetical worker count.
Nebula · Packages/com.1by3.nebula/Runtime/Orchestrator/AssignmentPlanner.cspublic static class AssignmentPlannerRuns an IAssignmentPolicy as a dry run against a hypothetical worker count. Unity's Mono has no default interface methods, so this is an extension rather than a member of IAssignmentPolicy: every policy a game already wrote gains Predict without changing.
Fields
SyntheticPrefix
public const string SyntheticPrefix = "sim-";Prefix of the made-up worker ids a dry run deals to. They never reach the control plane.
Methods
SyntheticWorker
public static string SyntheticWorker(int index);The id of the nth synthetic worker of a dry run.
Predict
public static AssignmentPlan Predict(this IAssignmentPolicy policy, AssignmentInput input, int workerCount);Deal input's containers across workerCount empty workers and add up what each would carry. The dry run has no leases, so every container is an orphan the policy must place; the result is the layout the policy would converge on with that many workers, not the cost of getting there. Per-container load comes from AssignmentInput.Utilization.
UtilizationOf
public static float UtilizationOf(AssignmentInput input, string containerId);Attributed utilization of one container as the planner weighs it: what was measured, scaled by ContainerHint.CostMultiplier. 0 when nothing was reported for it. Every place that adds up predicted load goes through here, so a hinted container is as heavy in a dry run as it is in a deal.
AssignmentPlan
What a policy would do with a hypothetical number of workers: which containers each of them would hold, and how loaded that would leave them.
BakedAssignmentPolicy
The original policy: baked containers are dealt as evenly as possible by count, sticky to their owner, in wire order when that order is spatial (NebulaOrchestrator.ComputeAssignment).