CPU pilots for binary, geometric, and budgeted search¶
Use the tutorial to configure each method. The pilot tasks share evaluation budgets within each comparison. Seeds are 11, 23, and 47. Tables give means across seeds unless stated otherwise. Per-seed JSONL
Run the complete comparisons with the optional rl extra. The
first three tasks also run with the base package.
python examples/swarm_packing.py swarm lucie thief gene --output build/swarm-packing.jsonl
python examples/swarm_packing.py gene --timing
Binary sensor placement¶
Choose among ten sensors. The objective counts the targets visible to at least one deployed sensor. The two axes count selections from the first and last five sensor sites. All 1,024 subsets give an exact reference for 36 reachable cells. Both searches start from the same seeded bit vectors and spend 360 measurements, excluding enumeration.
Method |
Occupied cells |
Cell optima found |
Mean regret in occupied cells |
|---|---|---|---|
Binary novelty PSO |
31.3 |
11.0 |
3.74 |
Bit-flip MAP-Elites |
35.7 |
22.3 |
1.14 |
Regret is the difference from the exact coverage for the cell. Here the bit-flip control covered more cells and found better placements within occupied cells.
Bounded noisy fitness¶
Each rollout draws a Bernoulli reward. Its known mean depends on two
coordinates. The first coordinate determines the cell. Both methods
spend 512 raw observations and use the same mutation scales. The
fixed control measures each candidate four times and compares its
mean against the incumbent’s stored mean. The adaptive run uses
epsilon=0.35 and up to seven extra pairs per race.
Method |
Proposals |
Occupied cells |
QD score from observed means |
QD score from true means |
|---|---|---|---|---|
LUCIE-style |
35.3 |
5.7 |
5.37 |
4.96 |
Four repeats |
128.0 |
8.0 |
8.00 |
6.71 |
The LUCIE-style run spent 202–205 calls on incumbent observations. All 89 races ended unresolved across the three seeds. Its occupied cells had higher true fitness on average, while fixed sampling delivered the larger sum by filling all eight cells. The raw records separate occupancy, observed fitness, and true fitness to expose this trade-off.
Traveling Thief¶
Both searches solve the same packing problem on each of 40 tours. A reference enumerates all 120 depot-anchored tours of the six-city instance. Their exact best packings reach 11 cells. A separate unit test checks the dynamic program against exhaustive feasible packings and independently computed loaded travel times.
Method |
Occupied cells |
Cell optima found |
Mean regret in occupied cells |
Item-addition transitions |
|---|---|---|---|---|
2-opt MAP-Elites |
9.3 |
2.7 |
1.30 |
1,061 |
Random tours |
9.3 |
3.0 |
1.61 |
1,059 |
2-opt slightly reduced mean regret and the random control found one more exact cell optimum in total. The two methods used comparable inner work. Early random sampling and the small instance size matter when interpreting the differences.
Indirect policy encoding¶
The Gymnasium tracking task uses a two-observation, one-action MLP with two hidden layers of width 32. Both methods spend 720 environment steps, completing 60 policies with the same reset-seed schedule. The archive tracks mean action and final position. The QD score sums the stored training returns.
Method |
Genome values |
Occupied cells |
Archive QD score |
Best return |
|---|---|---|---|---|
GENE with two coordinates per neuron |
199 |
12.0 |
115.51 |
11.66 |
Dense neural MAP-Elites |
1,185 |
9.0 |
94.15 |
11.84 |
The geometric genome was about six times smaller and occupied more cells across all three seeds. Best returns were close. The comparison uses training observations.
On a Linux Xeon E5-2630 v4 with CPython 3.12, NumPy 2.5.5, Gymnasium 1.4, and CPU PyTorch 2.15, decoding a GENE genome took about 0.24–0.27 ms per call, versus about 1 µs for copying an already dense genome. End-to-end training for either method took about 0.19–0.22 s per seed. Timings are measured separately, exclude actor export, and vary with load and CPU. The JSONL records reproducible search measurements.