StationPlacementTests: the bodyless-node rule runs on a wide light sample of the production generator that holds standing binaries under bodies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-18 04:22:31 +02:00
commit 49c6e3f837

View file

@ -133,17 +133,25 @@ public sealed class StationPlacementTests : IDisposable
Assert.True(ahead > 0 && behind > 0, $"the seeds put stations on one side only (ahead {ahead}, behind {behind})");
}
// A rosette or binary is a bodyless node, a root included; the station's source is never such a node, however many there are.
// A binary under a body is a bodyless node; the station's source is never such a node, however many there are. The authored
// settings leave none standing (every binary's ring folds into its node), so the zones are wide and light enough for rings to stand,
// with every satellite a binary: that is the sample in which the candidate rule's exclusion of a bodyless node does any work.
[Fact]
public void AStationNeverSitsOnABinarysBodylessNode()
{
var binaries = 0;
var stations = 0;
foreach (var built in GeneratedZones(null, 0, 4))
foreach (var built in GeneratedZones(null, 0, 4, int.MaxValue, z =>
{
z.SatelliteCreationProbability = 1;
z.BinaryCreationProbability = 1;
z.ZoneRadius.Minimum *= 3; z.ZoneRadius.Maximum *= 3;
z.ZoneMass.Minimum *= .1f; z.ZoneMass.Maximum *= .1f;
}))
{
var zone = built.Zone;
var bodyOrbits = zone.Planets.Values.Select(b => b.Orbit.Key).ToHashSet();
binaries += zone.Orbits.Count(o => !bodyOrbits.Contains(o.Key) && zone.Wells.Reach(o.Key) > 0f);
binaries += zone.Orbits.Count(o => o.Value.Data.Parent.IsSet() && !bodyOrbits.Contains(o.Key) && zone.Wells.Reach(o.Key) > 0f);
var ridden = zone.Entities.OfType<OrbitalEntity>().Select(e => e.OrbitData).ToHashSet();
foreach (var station in Orbitals(built).Where(e => TypeOf(built.Items, e) == HullType.Station))
{