java.lang.Object
mekhq.campaign.digitalGM.stratCon.sectorGeneration.StratConOrogeny

public class StratConOrogeny extends Object
Loads the orogeny (mountain-building) profiles used by improved sector generation from 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
  • Field Details

    • DEFAULT_GRAVITY_SIGMA

      public static final double DEFAULT_GRAVITY_SIGMA
      Default 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

      public static StratConOrogeny 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

      public static void loadForTest(String path)
      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 the data directory that is built when the application launches. That directory does not exist in the test environment, so tests point this at their own copy under testresources instead.

      Parameters:
      path - the file to load the orogeny profiles from
    • getGravitySigma

      public double getGravitySigma()
    • getTemperatureSigma

      public double getTemperatureSigma()
    • getWaterSigma

      public double getWaterSigma()
    • getProfiles

      public List<OrogenyProfile> getProfiles()
    • selectProfile

      public OrogenyProfile selectProfile(PlanetProfile planet)
      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