Class StratConOrogeny
OrogenyProfiles.yaml
and picks one for a planet from its combined conditions.
Unlike hydrology, which weights on a single scalar, orogeny selection is multifactor: a profile's weight is the geometric mean of Gaussian factors for gravity, temperature, and water coverage (each skipped when the profile is indifferent to it), times categorical multipliers for rocky, icy, and airless worlds. The mean rather than the product matters here: each Gaussian is at most 1, so multiplying them would penalize a profile for naming more conditions, and these profiles name between one and three. Neighboring profiles still appear for variety; larger sigmas mean more variety.
- Since:
- 0.51.01
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe root object ofOrogenyProfiles.yaml. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault Gaussian standard deviations (in each condition's own units) if the YAML omits them.static final doublestatic final double -
Method Summary
Modifier and TypeMethodDescriptiondoublestatic StratConOrogenydoubledoublestatic voidloadForTest(String path) Test seam: loads the orogeny profiles from an explicit path and installs the result as the singleton.selectProfile(PlanetProfile planet) Picks an orogeny profile for the given planet, weighted by how well the planet matches each profile's conditions.
-
Field Details
-
DEFAULT_GRAVITY_SIGMA
public static final double DEFAULT_GRAVITY_SIGMADefault Gaussian standard deviations (in each condition's own units) if the YAML omits them.- See Also:
-
DEFAULT_TEMPERATURE_SIGMA
public static final double DEFAULT_TEMPERATURE_SIGMA- See Also:
-
DEFAULT_WATER_SIGMA
public static final double DEFAULT_WATER_SIGMA- See Also:
-
-
Method Details
-
getInstance
- Returns:
- the singleton orogeny instance, loading it from the YAML on first use and falling back to a single indifferent default profile if the file cannot be read
-
loadForTest
Test seam: loads the orogeny profiles from an explicit path and installs the result as the singleton.Production resolves
MHQConstants.STRAT_CON_OROGENY_PROFILES_PATH, which lives under thedatadirectory that is built when the application launches. That directory does not exist in the test environment, so tests point this at their own copy undertestresourcesinstead.- Parameters:
path- the file to load the orogeny profiles from
-
getGravitySigma
public double getGravitySigma() -
getTemperatureSigma
public double getTemperatureSigma() -
getWaterSigma
public double getWaterSigma() -
getProfiles
-
selectProfile
Picks an orogeny profile for the given planet, weighted by how well the planet matches each profile's conditions.- Parameters:
planet- the planet's resolved data- Returns:
- the chosen profile
-