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 algorithmpopulationCenter-log10population this profile is most favored at, ornullif indifferentwaterCenter- water coverage (percent) this profile is most favored at, ornullhabitabilityCenter- habitability (0..1) this profile is most favored at, ornulltechCenter- technology level (0..1) this profile is most favored at, ornullcityCountModifier- multiplier on the population-derived city count, ornullfor neutralclustering- how tightly cities cluster,0.0(spread apart) to1.0(tight), ornullfor spreadcoastalBias- how strongly cities favor the coast,0.0to1.0, ornullfor nonefarmReach- how many hexes out from a city its farmland catchment extends, ornullfor a light defaultfarmDensity- the base chance (0..1) that an arable hex within reach becomes farmland, ornullfor 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 Summary
ConstructorsConstructorDescriptionUrbanProfile(UrbanProfileType type, Double populationCenter, Double waterCenter, Double habitabilityCenter, Double techCenter, Double cityCountModifier, Double clustering, Double coastalBias, Integer farmReach, Double farmDensity) Creates an instance of aUrbanProfilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecityCountModifierrecord component.doubleReturns the value of theclusteringrecord component.doubleReturns the value of thecoastalBiasrecord component.doublefinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefarmDensityrecord component.doubleReturns the value of thefarmReachrecord component.intReturns the value of thehabitabilityCenterrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thepopulationCenterrecord component.Returns the value of thetechCenterrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Returns the value of thewaterCenterrecord component.
-
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 aUrbanProfilerecord class.- Parameters:
type- the value for thetyperecord componentpopulationCenter- the value for thepopulationCenterrecord componentwaterCenter- the value for thewaterCenterrecord componenthabitabilityCenter- the value for thehabitabilityCenterrecord componenttechCenter- the value for thetechCenterrecord componentcityCountModifier- the value for thecityCountModifierrecord componentclustering- the value for theclusteringrecord componentcoastalBias- the value for thecoastalBiasrecord componentfarmReach- the value for thefarmReachrecord componentfarmDensity- the value for thefarmDensityrecord component
-
-
Method Details
-
cityCountModifierOrDefault
public double cityCountModifierOrDefault() -
clusteringOrDefault
public double clusteringOrDefault() -
coastalBiasOrDefault
public double coastalBiasOrDefault() -
farmReachOrDefault
public int farmReachOrDefault() -
farmDensityOrDefault
public double farmDensityOrDefault() -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
populationCenter
Returns the value of thepopulationCenterrecord component.- Returns:
- the value of the
populationCenterrecord component
-
waterCenter
Returns the value of thewaterCenterrecord component.- Returns:
- the value of the
waterCenterrecord component
-
habitabilityCenter
Returns the value of thehabitabilityCenterrecord component.- Returns:
- the value of the
habitabilityCenterrecord component
-
techCenter
Returns the value of thetechCenterrecord component.- Returns:
- the value of the
techCenterrecord component
-
cityCountModifier
Returns the value of thecityCountModifierrecord component.- Returns:
- the value of the
cityCountModifierrecord component
-
clustering
Returns the value of theclusteringrecord component.- Returns:
- the value of the
clusteringrecord component
-
coastalBias
Returns the value of thecoastalBiasrecord component.- Returns:
- the value of the
coastalBiasrecord component
-
farmReach
Returns the value of thefarmReachrecord component.- Returns:
- the value of the
farmReachrecord component
-
farmDensity
Returns the value of thefarmDensityrecord component.- Returns:
- the value of the
farmDensityrecord component
-