Represents the set of values an orbital element may assume.
More...
|
virtual void | parseAll () |
| Ensures that any abstract entries in the config file are properly interpreted. 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...
|
|
|
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)
|
|
|
enum | Distribution {
Uniform,
LogUniform,
Gaussian,
Normal,
Rayleigh,
Exponential,
Isotropic
} |
| Defines the type of probability distribution from which the value is drawn.
|
|
|
void IPersistenceLoad. | PersistenceLoad () |
| Callback used by ConfigNode.LoadObjectFromConfig()
|
|
Represents the set of values an orbital element may assume.
The same consistency caveats as for Population apply here.
Assigns situation-specific default values to the ValueRange.
- Parameters
-
[in] | dist | The distribution from which the value will be drawn |
[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
Generates a random number consistent with the distribution.
- Returns
- The desired random variate. The distribution depends on this object's internal data.
- Exceptions
-
System.InvalidOperationException | Thrown if the parameters are inappropriate for the distribution, or if the distribution is invalid. |
- Exception Safety
- This method is atomic
static double getPlanetProperty |
( |
string |
planet, |
|
|
string |
property |
|
) |
| |
|
staticprotected |
Returns the desired property of a known celestial body.
- Parameters
-
[in] | planet | The exact, case-sensitive name of the celestial body |
[in] | property | The short name of the property to recover. Must be one of ("rad", "soi", "sma", "per", "apo", "ecc", "inc", "ape", "lan", "mna0", or "mnl0"). |
- Returns
- The value of
property
appropriate for planet
. Distances are given in meters, angles are given in degrees.
- Precondition
- All loaded celestial bodies have unique names
- Exceptions
-
ArgumentException | Thrown if no planet named name exists, or if property does not have one of the allowed values |
- Note
- The only properties supported for Sun are "rad" and "soi"
- Exception Safety
- This method is atomic
virtual 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 in Population.SizeRange.
static double parseOrbitalElement |
( |
string |
rawValue | ) |
|
|
staticprotected |
Converts an arbitrary string representation of an orbital element 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.
- Exceptions
-
ArgumentException | Thrown if rawValue could not be interpreted as a floating-point value |
- Exception Safety
- This method is atomic.
const string planetFormat = "(?<planet>.+)" |
|
protected |
Parse format for planet names.
const string planetProp = planetFormat + "\\s*\\.\\s*" + propFormat |
|
protected |
Parse format for planets, with properties.
const string propFormat = "(?<prop>rad|soi|sma|per|apo|ecc|inc|(a|l)pe|lan|mn(a|l)0)" |
|
protected |
Parse format for planet properties.
Initial value:
+ "\\s*(?<ratio>[-+.e\\d]+)\\s*\\)",
RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture)
Defines the syntax for a Ratio declaration.
Initial value:=
new Regex(
"Offset\\(\\s*" +
planetProp +
"\\s*,"
+ "\\s*(?<incr>[-+.e\\d]+)\\s*\\)",
RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture)
Defines the syntax for an Offset declaration.
The documentation for this class was generated from the following file: