Record Class UrbanProfile

java.lang.Object
java.lang.Record
mekhq.campaign.digitalGM.stratCon.sectorGeneration.UrbanProfile
Record Components:
type - the profile's identity, which also selects its city-placement algorithm
populationCenter - log10 population this profile is most favored at, or null if indifferent
waterCenter - water coverage (percent) this profile is most favored at, or null
habitabilityCenter - habitability (0..1) this profile is most favored at, or null
techCenter - technology level (0..1) this profile is most favored at, or null
cityCountModifier - multiplier on the population-derived city count, or null for neutral
clustering - how tightly cities cluster, 0.0 (spread apart) to 1.0 (tight), or null for spread
coastalBias - how strongly cities favor the coast, 0.0 to 1.0, or null for none
farmReach - how many hexes out from a city its farmland catchment extends, or null for a light default
farmDensity - the base chance (0..1) that an arable hex within reach becomes farmland, or null for a light default

public record UrbanProfile(UrbanProfileType type, Double populationCenter, Double waterCenter, Double habitabilityCenter, Double techCenter, Double cityCountModifier, Double clustering, Double coastalBias, Integer farmReach, Double farmDensity) extends Record
A single urban (settlement) profile's tunable parameters, deserialized from UrbanProfiles.yaml.

Selection is multi-factor: a profile is weighted by how well the planet matches its Gaussian centers for population (as log10), water coverage, habitability, and technology level. A null center means the profile is indifferent to that condition. The placement parameters shape how the profile arranges cities.

Since:
0.51.01
  • Constructor Details

    • UrbanProfile

      public UrbanProfile(UrbanProfileType type, @Nullable Double populationCenter, @Nullable Double waterCenter, @Nullable Double habitabilityCenter, @Nullable Double techCenter, @Nullable Double cityCountModifier, @Nullable Double clustering, @Nullable Double coastalBias, @Nullable Integer farmReach, @Nullable Double farmDensity)
      Creates an instance of a UrbanProfile record class.
      Parameters:
      type - the value for the type record component
      populationCenter - the value for the populationCenter record component
      waterCenter - the value for the waterCenter record component
      habitabilityCenter - the value for the habitabilityCenter record component
      techCenter - the value for the techCenter record component
      cityCountModifier - the value for the cityCountModifier record component
      clustering - the value for the clustering record component
      coastalBias - the value for the coastalBias record component
      farmReach - the value for the farmReach record component
      farmDensity - the value for the farmDensity record component
  • Method Details

    • cityCountModifierOrDefault

      public double cityCountModifierOrDefault()
    • clusteringOrDefault

      public double clusteringOrDefault()
    • coastalBiasOrDefault

      public double coastalBiasOrDefault()
    • farmReachOrDefault

      public int farmReachOrDefault()
    • farmDensityOrDefault

      public double farmDensityOrDefault()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public UrbanProfileType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • populationCenter

      @Nullable public Double populationCenter()
      Returns the value of the populationCenter record component.
      Returns:
      the value of the populationCenter record component
    • waterCenter

      @Nullable public Double waterCenter()
      Returns the value of the waterCenter record component.
      Returns:
      the value of the waterCenter record component
    • habitabilityCenter

      @Nullable public Double habitabilityCenter()
      Returns the value of the habitabilityCenter record component.
      Returns:
      the value of the habitabilityCenter record component
    • techCenter

      @Nullable public Double techCenter()
      Returns the value of the techCenter record component.
      Returns:
      the value of the techCenter record component
    • cityCountModifier

      @Nullable public Double cityCountModifier()
      Returns the value of the cityCountModifier record component.
      Returns:
      the value of the cityCountModifier record component
    • clustering

      @Nullable public Double clustering()
      Returns the value of the clustering record component.
      Returns:
      the value of the clustering record component
    • coastalBias

      @Nullable public Double coastalBias()
      Returns the value of the coastalBias record component.
      Returns:
      the value of the coastalBias record component
    • farmReach

      @Nullable public Integer farmReach()
      Returns the value of the farmReach record component.
      Returns:
      the value of the farmReach record component
    • farmDensity

      @Nullable public Double farmDensity()
      Returns the value of the farmDensity record component.
      Returns:
      the value of the farmDensity record component