private double GetNewEccentricity(PlanetSeed the_planet, double e, double a, double mass, double newA) { var newE = the_planet.Mass * Math.Sqrt(the_planet.SemiMajorAxisAU) * Math.Sqrt(1.0 - Math.Pow(the_planet.Eccentricity, 2.0)); newE = newE + (mass * Math.Sqrt(a) * Math.Sqrt(Math.Sqrt(1.0 - Math.Pow(e, 2.0)))); newE = newE / ((the_planet.Mass + mass) * Math.Sqrt(newA)); newE = 1.0 - Math.Pow(newE, 2.0); if (newE < 0.0 || newE >= 1.0) { newE = 0.0; } return(Math.Sqrt(newE)); }
private void SetInitialConditions(double inner_limit_of_dust, double outer_limit_of_dust) { _histHead = new Generation(); _planetHead = null; _dustHead = new DustRecord(); _dustHead.NextBand = null; _dustHead.OuterEdge = outer_limit_of_dust; _dustHead.InnerEdge = inner_limit_of_dust; _dustHead.DustPresent = true; _dustHead.GasPresent = true; _dustLeft = true; _cloudEccentricity = CloudEccentricity; _histHead.Dusts = _dustHead; _histHead.Planets = _planetHead; _histHead.Next = _histHead; }
public PlanetParameters(PlanetSeed planetSeed) { this.planetSeed = planetSeed; Random.seed = planetSeed.seed; gradientMultiplier = Random.Range (1.3f, 2.3f); seaLevel = Random.Range (0.25f, 0.8f); terrainHeight = Random.Range (0.04f, 0.08f); perlinSpaceSeed = new Vector3(Random.Range(1f, 10f), Random.Range(1f, 10f), Random.Range(1f, 10f)); icyness = Mathf.Sqrt(Random.Range (0.01f, 15.0f))-2f; Color32 shore = color(Random.Range(60, 120), Random.Range(120, 180), Random.Range(70, 110)); Color32 hills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 highHills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 mountains = color(Random.Range(210, 250), Random.Range(210, 250), Random.Range(230, 250)); gradient = new Gradient(); Gradient.GradientPoint p1 = new Gradient.GradientPoint(shore, 0.0f); Gradient.GradientPoint p2 = new Gradient.GradientPoint(hills, 0.5f); Gradient.GradientPoint p3 = new Gradient.GradientPoint(highHills, 0.8f); Gradient.GradientPoint p4 = new Gradient.GradientPoint(mountains, 1.0f); gradient.gradientPoints = new Gradient.GradientPoint[] { p1, p2, p3, p4 }; waterColor = new Color32((byte)Random.Range(40, 50), (byte)Random.Range(30, 90), (byte)Random.Range(90, 150), (byte)80); landIceColor = new Color32((byte)Random.Range(230, 240), (byte)Random.Range(230, 240), (byte)Random.Range(240, 255), (byte)30); waterIceColor = new Color32((byte)Random.Range(230, 245), (byte)Random.Range(240, 255), (byte)Random.Range(230, 245), (byte)240); starLight = new Color32( (byte)(Random.Range(135, 195) - 50*icyness), (byte)(Random.Range(164, 124) - 40*icyness), (byte)(Random.Range(200, 255) - 2*icyness), (byte)255); starIntensity = Random.Range (1.5f, 2.0f); planetSize = Random.Range (0.75f, 1.25f); name = PlanetNameGenerator.GenerateName(); }
public PlanetParameters(PlanetSeed planetSeed) { this.planetSeed = planetSeed; Random.seed = planetSeed.seed; gradientMultiplier = Random.Range(1.3f, 2.3f); seaLevel = Random.Range(0.25f, 0.8f); terrainHeight = Random.Range(0.04f, 0.08f); perlinSpaceSeed = new Vector3(Random.Range(1f, 10f), Random.Range(1f, 10f), Random.Range(1f, 10f)); icyness = Mathf.Sqrt(Random.Range(0.01f, 15.0f)) - 2f; Color32 shore = color(Random.Range(60, 120), Random.Range(120, 180), Random.Range(70, 110)); Color32 hills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 highHills = color(Random.Range(80, 140), Random.Range(100, 160), Random.Range(60, 100)); Color32 mountains = color(Random.Range(210, 250), Random.Range(210, 250), Random.Range(230, 250)); gradient = new Gradient(); Gradient.GradientPoint p1 = new Gradient.GradientPoint(shore, 0.0f); Gradient.GradientPoint p2 = new Gradient.GradientPoint(hills, 0.5f); Gradient.GradientPoint p3 = new Gradient.GradientPoint(highHills, 0.8f); Gradient.GradientPoint p4 = new Gradient.GradientPoint(mountains, 1.0f); gradient.gradientPoints = new Gradient.GradientPoint[] { p1, p2, p3, p4 }; waterColor = new Color32((byte)Random.Range(40, 50), (byte)Random.Range(30, 90), (byte)Random.Range(90, 150), (byte)80); landIceColor = new Color32((byte)Random.Range(230, 240), (byte)Random.Range(230, 240), (byte)Random.Range(240, 255), (byte)30); waterIceColor = new Color32((byte)Random.Range(230, 245), (byte)Random.Range(240, 255), (byte)Random.Range(230, 245), (byte)240); starLight = new Color32( (byte)(Random.Range(135, 195) - 50 * icyness), (byte)(Random.Range(164, 124) - 40 * icyness), (byte)(Random.Range(200, 255) - 2 * icyness), (byte)255); starIntensity = Random.Range(1.5f, 2.0f); planetSize = Random.Range(0.75f, 1.25f); name = PlanetNameGenerator.GenerateName(); }
private static Planet GeneratePlanet(PlanetSeed seed, int planetNo, ref Star sun, bool useRandomTilt, string planetID, bool isMoon, SystemGenerationOptions genOptions) { var planet = new Planet(seed, sun, planetNo); planet.OrbitZone = Environment.OrbitalZone(sun.Luminosity, planet.SemiMajorAxisAU); planet.OrbitalPeriodDays = Environment.Period(planet.SemiMajorAxisAU, planet.MassSM, sun.Mass); if (useRandomTilt) { planet.AxialTiltDegrees = Environment.Inclination(planet.SemiMajorAxisAU); } planet.ExosphereTempKelvin = GlobalConstants.EARTH_EXOSPHERE_TEMP / Utilities.Pow2(planet.SemiMajorAxisAU / sun.EcosphereRadiusAU); planet.RMSVelocityCMSec = Environment.RMSVelocity(GlobalConstants.MOL_NITROGEN, planet.ExosphereTempKelvin); planet.CoreRadiusKM = Environment.KothariRadius(planet.DustMassSM, false, planet.OrbitZone); // Calculate the radius as a gas giant, to verify it will retain gas. // Then if mass > Earth, it's at least 5% gas and retains He, it's // some flavor of gas giant. planet.DensityGCC = Environment.EmpiricalDensity(planet.MassSM, planet.SemiMajorAxisAU, sun.EcosphereRadiusAU, true); planet.RadiusKM = Environment.VolumeRadius(planet.MassSM, planet.DensityGCC); planet.SurfaceAccelerationCMSec2 = Environment.Acceleration(planet.MassSM, planet.RadiusKM); planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); planet.MolecularWeightRetained = Environment.MinMolecularWeight(planet); // Is the planet a gas giant? if (((planet.MassSM * GlobalConstants.SUN_MASS_IN_EARTH_MASSES) > 1.0) && ((planet.GasMassSM / planet.MassSM) > 0.05) && (planet.MolecularWeightRetained <= 4.0)) { if ((planet.GasMassSM / planet.MassSM) < 0.20) { planet.Type = PlanetType.SubSubGasGiant; } else if ((planet.MassSM * GlobalConstants.SUN_MASS_IN_EARTH_MASSES) < 20.0) { planet.Type = PlanetType.SubGasGiant; } else { planet.Type = PlanetType.GasGiant; } } else // If not, it's rocky. { planet.RadiusKM = Environment.KothariRadius(planet.MassSM, false, planet.OrbitZone); planet.DensityGCC = Environment.VolumeDensity(planet.MassSM, planet.RadiusKM); planet.SurfaceAccelerationCMSec2 = Environment.Acceleration(planet.MassSM, planet.RadiusKM); planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); if ((planet.GasMassSM / planet.MassSM) > 0.000001) { var h2Mass = planet.GasMassSM * 0.85; var heMass = (planet.GasMassSM - h2Mass) * 0.999; var h2Life = Environment.GasLife(GlobalConstants.MOL_HYDROGEN, planet.ExosphereTempKelvin, planet.SurfaceGravityG, planet.RadiusKM); var heLife = Environment.GasLife(GlobalConstants.HELIUM, planet.ExosphereTempKelvin, planet.SurfaceGravityG, planet.RadiusKM); if (h2Life < sun.AgeYears) { var h2Loss = ((1.0 - (1.0 / Math.Exp(sun.AgeYears / h2Life))) * h2Mass); planet.GasMassSM -= h2Loss; planet.MassSM -= h2Loss; planet.SurfaceAccelerationCMSec2 = Environment.Acceleration(planet.MassSM, planet.RadiusKM); planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); } if (heLife < sun.AgeYears) { var heLoss = ((1.0 - (1.0 / Math.Exp(sun.AgeYears / heLife))) * heMass); planet.GasMassSM -= heLoss; planet.MassSM -= heLoss; planet.SurfaceAccelerationCMSec2 = Environment.Acceleration(planet.MassSM, planet.RadiusKM); planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); } } } planet.AngularVelocityRadSec = Environment.AngularVelocity(planet); planet.DayLengthHours = Environment.DayLength(planet.AngularVelocityRadSec, planet.OrbitalPeriodDays, planet.Eccentricity); planet.HasResonantPeriod = Environment.HasResonantPeriod(planet.AngularVelocityRadSec, planet.DayLengthHours, planet.OrbitalPeriodDays, planet.Eccentricity); planet.EscapeVelocityCMSec = Environment.EscapeVelocity(planet.MassSM, planet.RadiusKM); planet.HillSphereKM = Environment.SimplifiedHillSphereKM(sun.Mass, planet.MassSM, planet.SemiMajorAxisAU); if (planet.IsGasGiant) { planet.HasGreenhouseEffect = false; planet.VolatileGasInventory = GlobalConstants.INCREDIBLY_LARGE_NUMBER; planet.Atmosphere.SurfacePressure = GlobalConstants.INCREDIBLY_LARGE_NUMBER; planet.BoilingPointWaterKelvin = GlobalConstants.INCREDIBLY_LARGE_NUMBER; planet.SurfaceTempKelvin = GlobalConstants.INCREDIBLY_LARGE_NUMBER; planet.GreenhouseRiseKelvin = 0; planet.Albedo = Utilities.About(GlobalConstants.GAS_GIANT_ALBEDO, 0.1); planet.WaterCoverFraction = 1.0; planet.CloudCoverFraction = 1.0; planet.IceCoverFraction = 0.0; planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); planet.MolecularWeightRetained = Environment.MinMolecularWeight(planet); planet.SurfaceGravityG = GlobalConstants.INCREDIBLY_LARGE_NUMBER; } else { planet.SurfaceGravityG = Environment.Gravity(planet.SurfaceAccelerationCMSec2); planet.MolecularWeightRetained = Environment.MinMolecularWeight(planet); planet.HasGreenhouseEffect = Environment.Greenhouse(sun.EcosphereRadiusAU, planet.SemiMajorAxisAU); planet.VolatileGasInventory = Environment.VolatileInventory( planet.MassSM, planet.EscapeVelocityCMSec, planet.RMSVelocityCMSec, sun.Mass, planet.OrbitZone, planet.HasGreenhouseEffect, (planet.GasMassSM / planet.MassSM) > 0.000001); planet.Atmosphere.SurfacePressure = Environment.Pressure( planet.VolatileGasInventory, planet.RadiusKM, planet.SurfaceGravityG); planet.BoilingPointWaterKelvin = Math.Abs(planet.Atmosphere.SurfacePressure) < 0.001 ? 0.0 : Environment.BoilingPoint(planet.Atmosphere.SurfacePressure); // Sets: planet.surf_temp, planet.greenhs_rise, planet.albedo, planet.hydrosphere, // planet.cloud_cover, planet.ice_cover Environment.IterateSurfaceTemp(ref planet); CalculateGases(planet, genOptions.GasTable); planet.IsTidallyLocked = Environment.IsTidallyLocked(planet); // Assign planet type if (planet.Atmosphere.SurfacePressure < 1.0) { if (!isMoon && ((planet.MassSM * GlobalConstants.SUN_MASS_IN_EARTH_MASSES) < GlobalConstants.ASTEROID_MASS_LIMIT)) { planet.Type = PlanetType.Asteroids; } else { planet.Type = PlanetType.Barren; } } else if ((planet.Atmosphere.SurfacePressure > 6000.0) && (planet.MolecularWeightRetained <= 2.0)) // Retains Hydrogen { planet.Type = PlanetType.SubSubGasGiant; planet.Atmosphere.Composition = new List <Gas>(); } else { // Atmospheres: // TODO remove PlanetType enum entirely and replace it with a more flexible classification systme if (planet.WaterCoverFraction >= 0.95) // >95% water { planet.Type = PlanetType.Water; } else if (planet.IceCoverFraction >= 0.95) // >95% ice { planet.Type = PlanetType.Ice; } else if (planet.WaterCoverFraction > 0.05) // Terrestrial { planet.Type = PlanetType.Terrestrial; } else if (planet.MaxTempKelvin > planet.BoilingPointWaterKelvin) // Hot = Venusian { planet.Type = PlanetType.Venusian; } else if ((planet.GasMassSM / planet.MassSM) > 0.0001) // Accreted gas, but no greenhouse or liquid water make it an ice world { planet.Type = PlanetType.Ice; planet.IceCoverFraction = 1.0; } else if (planet.Atmosphere.SurfacePressure <= 250.0) // Thin air = Martian { planet.Type = PlanetType.Martian; } else if (planet.SurfaceTempKelvin < GlobalConstants.FREEZING_POINT_OF_WATER) { planet.Type = PlanetType.Ice; } else { planet.Type = PlanetType.Unknown; } } } // Generate moons planet.Moons = new List <Planet>(); if (!isMoon) { var curMoon = seed.FirstMoon; var n = 0; while (curMoon != null) { if (curMoon.Mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES > .000001) { curMoon.SemiMajorAxisAU = planet.SemiMajorAxisAU; curMoon.Eccentricity = planet.Eccentricity; n++; string moon_id = String.Format("{0}.{1}", planetID, n); var generatedMoon = GeneratePlanet(curMoon, n, ref sun, useRandomTilt, moon_id, true, genOptions); double roche_limit = 2.44 * planet.RadiusKM * Math.Pow((planet.DensityGCC / generatedMoon.DensityGCC), (1.0 / 3.0)); double hill_sphere = planet.SemiMajorAxisAU * GlobalConstants.KM_PER_AU * Math.Pow((planet.MassSM / (3.0 * sun.Mass)), (1.0 / 3.0)); if ((roche_limit * 3.0) < hill_sphere) { generatedMoon.MoonSemiMajorAxisAU = Utilities.RandomNumber(roche_limit * 1.5, hill_sphere / 2.0) / GlobalConstants.KM_PER_AU; generatedMoon.MoonEccentricity = Utilities.RandomEccentricity(); } else { generatedMoon.MoonSemiMajorAxisAU = 0; generatedMoon.MoonEccentricity = 0; } planet.Moons.Add(generatedMoon); } curMoon = curMoon.NextPlanet; } } return(planet); }
void Display(PlanetSeed planetSeed) { Display(new PlanetParameters(planetSeed)); }
private void CoalescePlanetesimals(double a, double e, double mass, double critMass, double dustMass, double gasMass, double stellLuminosityRatio, double bodyInnerBound, double bodyOuterBound, bool doMoons) { // First we try to find an existing planet with an over-lapping orbit. PlanetSeed thePlanet = null; PlanetSeed nextPlanet = null; PlanetSeed prevPlanet = null; var finished = false; for (thePlanet = _planetHead; thePlanet != null; thePlanet = thePlanet.NextPlanet) { double diff = thePlanet.SemiMajorAxisAU - a; double dist1; double dist2; if (diff > 0.0) { dist1 = (a * (1.0 + e) * (1.0 + _reducedMass)) - a; /* x aphelion */ _reducedMass = Math.Pow((thePlanet.Mass / (1.0 + thePlanet.Mass)), (1.0 / 4.0)); dist2 = thePlanet.SemiMajorAxisAU - (thePlanet.SemiMajorAxisAU * (1.0 - thePlanet.Eccentricity) * (1.0 - _reducedMass)); } else { dist1 = a - (a * (1.0 - e) * (1.0 - _reducedMass)); /* x perihelion */ _reducedMass = Math.Pow((thePlanet.Mass / (1.0 + thePlanet.Mass)), (1.0 / 4.0)); dist2 = (thePlanet.SemiMajorAxisAU * (1.0 + thePlanet.Eccentricity) * (1.0 + _reducedMass)) - thePlanet.SemiMajorAxisAU; } // Did the planetesimal collide with this planet? if (Math.Abs(diff) <= Math.Abs(dist1) || Math.Abs(diff) <= Math.Abs(dist2)) { double new_dust = 0; double new_gas = 0; double new_a = (thePlanet.Mass + mass) / ((thePlanet.Mass / thePlanet.SemiMajorAxisAU) + (mass / a)); e = GetNewEccentricity(thePlanet, e, a, mass, new_a); if (doMoons) { finished = DoMoons(thePlanet, mass, critMass, dustMass, gasMass); } if (!finished) { //Trace.TraceInformation("Collision between two planetesimals!\n {0:0.00} AU ({1:0.00}EM) + {2:0.00} AU ({3:0.00}EM = {4:0.00}EMd + {5:0.00}EMg [{6:0.00}EM]). {7:0.00} AU ({8:0.00})", // the_planet.a, the_planet.mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // a, mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // dust_mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // gas_mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // crit_mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // new_a, e); var newMass = thePlanet.Mass + mass; AccreteDust(ref newMass, ref new_dust, ref new_gas, new_a, e, stellLuminosityRatio, bodyInnerBound, bodyOuterBound); thePlanet.SemiMajorAxisAU = new_a; thePlanet.Eccentricity = e; thePlanet.Mass = newMass; thePlanet.DustMass += dustMass + new_dust; thePlanet.GasMass += gasMass + new_gas; if (thePlanet.Mass >= critMass) { thePlanet.IsGasGiant = true; } while (thePlanet.NextPlanet != null && thePlanet.NextPlanet.SemiMajorAxisAU < new_a) { nextPlanet = thePlanet.NextPlanet; if (thePlanet == _planetHead) { _planetHead = nextPlanet; } else { prevPlanet.NextPlanet = nextPlanet; } thePlanet.NextPlanet = nextPlanet.NextPlanet; nextPlanet.NextPlanet = thePlanet; prevPlanet = nextPlanet; } } finished = true; break; } else { prevPlanet = thePlanet; } } // Planetesimals didn't collide. Make it a planet. if (!(finished)) { thePlanet = new PlanetSeed(a, e, mass, dustMass, gasMass); if (mass >= critMass) { thePlanet.IsGasGiant = true; } else { thePlanet.IsGasGiant = false; } if (_planetHead == null) { _planetHead = thePlanet; thePlanet.NextPlanet = null; } else if (a < _planetHead.SemiMajorAxisAU) { thePlanet.NextPlanet = _planetHead; _planetHead = thePlanet; } else if (_planetHead.NextPlanet == null) { _planetHead.NextPlanet = thePlanet; thePlanet.NextPlanet = null; } else { nextPlanet = _planetHead; while (nextPlanet != null && nextPlanet.SemiMajorAxisAU < a) { prevPlanet = nextPlanet; nextPlanet = nextPlanet.NextPlanet; } thePlanet.NextPlanet = nextPlanet; prevPlanet.NextPlanet = thePlanet; } } }
private bool DoMoons(PlanetSeed planet, double mass, double critMass, double dustMass, double gasMass) { bool finished = false; double existingMass = 0.0; if (planet.FirstMoon != null) { for (PlanetSeed m = planet.FirstMoon; m != null; m = m.NextPlanet) { existingMass += m.Mass; } } if (mass < critMass) { if (mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES < 2.5 && mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES > .0001 && existingMass < planet.Mass * .05) { PlanetSeed moon = new PlanetSeed(0, 0, mass, dustMass, gasMass); if (moon.DustMass + moon.GasMass > planet.DustMass + planet.GasMass) { double tempDust = planet.DustMass; double tempGas = planet.GasMass; double tempMass = planet.Mass; planet.DustMass = moon.DustMass; planet.GasMass = moon.GasMass; planet.Mass = moon.Mass; moon.DustMass = tempDust; moon.GasMass = tempGas; moon.Mass = tempMass; } if (planet.FirstMoon == null) { planet.FirstMoon = moon; } else { moon.NextPlanet = planet.FirstMoon; planet.FirstMoon = moon; } finished = true; //Trace.TraceInformation("Moon captured... {0:0.00} AU ({1:0.00}EM) <- {2:0.00} EM", // the_planet.a, // the_planet.mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES); } //else //{ // Trace.TraceInformation("Moon escapes... {0:0.00} AU ({1:0.00} EM){2} {3:0.00}L {4}", // the_planet.a, // the_planet.mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // existing_mass < (the_planet.mass * .05) ? "" : " (big moons)", // mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES, // (mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES) >= 2.5 ? ", too big" : (mass * GlobalConstants.SUN_MASS_IN_EARTH_MASSES) <= .0001 ? ", too small" : ""); //} } return(finished); }
// TODO documentation /// <summary> /// /// </summary> /// <param name="stellarMassRatio"></param> /// <param name="stellarLumRatio"></param> /// <param name="innerDust"></param> /// <param name="outerDust"></param> /// <param name="outerPlanetLimit"></param> /// <param name="dustDensityCoeff"></param> /// <param name="seedSystem"></param> /// <param name="doMoons"></param> /// <returns></returns> public List <PlanetSeed> GetPlanetaryBodies(double stellarMassRatio, double stellarLumRatio, double innerDust, double outerDust, double outerPlanetLimit, double dustDensityCoeff, PlanetSeed seedSystem, bool doMoons) { SetInitialConditions(innerDust, outerDust); double planet_inner_bound = NearestPlanet(stellarMassRatio); double planet_outer_bound = outerPlanetLimit == 0 ? FarthestPlanet(stellarMassRatio) : outerPlanetLimit; PlanetSeed seeds = seedSystem; while (_dustLeft) { double a, e; if (seeds != null) { a = seeds.SemiMajorAxisAU; e = seeds.Eccentricity; seeds = seeds.NextPlanet; } else { a = Utilities.RandomNumber(planet_inner_bound, planet_outer_bound); e = Utilities.RandomEccentricity(); } double mass = GlobalConstants.PROTOPLANET_MASS; double dust_mass = 0; double gas_mass = 0; //Trace.TraceInformation("Checking {0:0.00} AU", a); if (DustAvailable(InnerEffectLimit(a, e, mass), OuterEffectLimit(a, e, mass))) { //Trace.TraceInformation("Injecting protoplanet at {0:0.00} AU", a); _dustDensity = dustDensityCoeff * Math.Sqrt(stellarMassRatio) * Math.Exp(-GlobalConstants.ALPHA * Math.Pow(a, (1.0 / GlobalConstants.N))); double crit_mass = CriticalLimit(a, e, stellarLumRatio); AccreteDust(ref mass, ref dust_mass, ref gas_mass, a, e, crit_mass, planet_inner_bound, planet_outer_bound); dust_mass += GlobalConstants.PROTOPLANET_MASS; if (mass > GlobalConstants.PROTOPLANET_MASS) { CoalescePlanetesimals(a, e, mass, crit_mass, dust_mass, gas_mass, stellarLumRatio, planet_inner_bound, planet_outer_bound, doMoons); } //Trace.TraceInformation(".. failed due to large neighbor."); } //Trace.TraceInformation(".. failed"); } var seedList = new List <PlanetSeed>(); var next = _planetHead; while (next != null) { seedList.Add(next); next = next.NextPlanet; } return(seedList); }