Specialization of ValueRange for orbital size parameter.
More...
|
override void | parseAll () |
| Ensures that any abstract entries in the config file are properly interpreted. More...
|
|
|
static double | parseOrbitSize (string rawValue) |
| Converts an arbitrary string representation of an orbit size to a specific value. More...
|
|
static double | parseOrbitalElement (string rawValue) |
| Converts an arbitrary string representation of an orbital element to a specific value. More...
|
|
static double | getPlanetProperty (string planet, string property) |
| Returns the desired property of a known celestial body. More...
|
|
|
enum | SizeType { SemimajorAxis,
Periapsis,
Apoapsis
} |
| Defines the parametrization of orbit size that is used.
|
|
enum | Distribution {
Uniform,
LogUniform,
Gaussian,
Normal,
Rayleigh,
Exponential,
Isotropic
} |
| Defines the type of probability distribution from which the value is drawn.
|
|
|
static Regex | mmrDecl |
| Defines the syntax for a Resonance declaration. More...
|
|
|
const string | planetFormat = "(?<planet>.+)" |
| Parse format for planet names. More...
|
|
const string | propFormat = "(?<prop>rad|soi|sma|per|apo|ecc|inc|(a|l)pe|lan|mn(a|l)0)" |
| Parse format for planet properties. More...
|
|
const string | planetProp = planetFormat + "\\s*\\.\\s*" + propFormat |
| Parse format for planets, with properties. More...
|
|
Distribution | dist |
| The probability distribution from which the value is drawn.
|
|
string | rawMin |
| Abstract string representation of min .
|
|
double | min |
| The minimum allowed value (not always used)
|
|
string | rawMax |
| Abstract string representation of max .
|
|
double | max |
| The maximum allowed value (not always used)
|
|
string | rawAvg |
| Abstract string representation of avg .
|
|
double | avg |
| The average value (not always used)
|
|
string | rawStdDev |
| Abstract string representation of stdDev .
|
|
double | stdDev |
| The standard deviation of the values (not always used)
|
|
Specialization of ValueRange for orbital size parameter.
- Todo:
- I don't think that SizeRange is a subtype of ValueRange in the Liskov sense... check!
SizeRange |
( |
Distribution |
dist, |
|
|
SizeType |
type = SizeType.SemimajorAxis , |
|
|
double |
min = 0.0 , |
|
|
double |
max = 1.0 , |
|
|
double |
avg = 0.0 , |
|
|
double |
stddev = 0.0 |
|
) |
| |
|
package |
Assigns situation-specific default values to the ValueRange.
- Parameters
-
[in] | dist | The distribution from which the value will be drawn |
[in] | type | The description of orbit size that is used |
[in] | min,max | The minimum and maximum values allowed for distributions. May be unused. |
[in] | avg | The mean value returned. May be unused. |
[in] | stddev | The standard deviation of values returned. May be unused. |
- Postcondition
- The given values will be used by draw() unless they are specifically overridden by a ConfigNode.
- Exception Safety
- Does not throw exceptions
Returns the parametrization used by this ValueRange.
- Returns
- The orbit size parameter represented by this object.
- Exception Safety
- Does not throw exceptions.
override void parseAll |
( |
| ) |
|
|
protectedvirtual |
Ensures that any abstract entries in the config file are properly interpreted.
- Precondition
this.rawMin
, this.rawMax
, this.rawAvg
, and this.rawStdDev
contain a representation of the desired object value
- Warning
- Class invariant should not be assumed to hold true prior to calling parseAll()
- Exceptions
-
TypeInitializationException | Thrown if the ConfigNode could not be interpreted as a set of floating-point values |
- Exception Safety
- The program is in a consistent state in the event of an exception
Reimplemented from Population.ValueRange.
static double parseOrbitSize |
( |
string |
rawValue | ) |
|
|
staticprotected |
Converts an arbitrary string representation of an orbit size to a specific value.
- Parameters
-
[in] | rawValue | A string representing the value. |
- Returns
- The value represented by
rawValue
.
- Precondition
- rawValue has one of the following formats:
- a string representation of a floating-point number
- a string of the format "Ratio(<Planet>.<stat>, <value>)", where <Planet> is the name of a loaded celestial body, <stat> is one of (rad, soi, sma, per, apo, ecc, inc, ape, lpe, lan, mna0, mnl0), and <value> is a string representation of a floating-point number
- a string of the format "Offset(<Planet>.<stat>, <value>)", where <Planet>, <stat>, and <value> are as above.
- a string of the format "Resonance(<Planet>, <m>:<n>)", where <Planet> is the name of a loaded celestial body, and <m> and <n> are string representations of positive integers. In keeping with standard astronomical convention, m > n means an orbit inside that of <Planet>, while m < n means an exterior orbit
- Exceptions
-
ArgumentException | Thrown if rawValue could not be interpreted as a floating-point value |
- Exception Safety
- This method is atomic.
Initial value:= new Regex(
"Resonance\\(\\s*" +
planetFormat +
"\\s*,\\s*(?<m>\\d+)\\s*:\\s*(?<n>\\d+)\\s*\\)",
RegexOptions.IgnoreCase)
Defines the syntax for a Resonance declaration.
The documentation for this class was generated from the following file: