Custom Asteroids  1.0.0
A mod for Kerbal Space Program that lets users control where asteroids appear
 All Classes Namespaces Files Functions Variables Enumerations Properties Pages
Population.PhaseRange Class Reference

Specialization of ValueRange for orbital phase parameter. More...

+ Inheritance diagram for Population.PhaseRange:

Package Types

enum  PhaseType { MeanLongitude, MeanAnomaly }
 Defines the parametrization of orbit size that is used.
 
enum  EpochType { GameStart, Now }
 Defines the time at which the phase is measured.
 
- Package Types inherited from Population.ValueRange
enum  Distribution {
  Uniform, LogUniform, Gaussian, Normal,
  Rayleigh, Exponential, Isotropic
}
 Defines the type of probability distribution from which the value is drawn.
 

Package Functions

 PhaseRange (Distribution dist, PhaseType type=PhaseType.MeanAnomaly, EpochType epoch=EpochType.GameStart, double min=0.0, double max=1.0, double avg=0.0, double stddev=0.0)
 Assigns situation-specific default values to the ValueRange. More...
 
PhaseType getParam ()
 Returns the parametrization used by this ValueRange. More...
 
EpochType getEpoch ()
 Returns the epoch at which the phase is evaluated. More...
 
- Package Functions inherited from Population.ValueRange
 ValueRange (Distribution dist, double min=0.0, double max=1.0, double avg=0.0, double stdDev=0.0)
 Assigns situation-specific default values to the ValueRange. More...
 
double draw ()
 Generates a random number consistent with the distribution. More...
 

Private Attributes

PhaseType type
 The type of parameter describing the orbit.
 
EpochType epoch
 The time at which the parameter should be calculated.
 

Additional Inherited Members

- Protected Member Functions inherited from Population.ValueRange
virtual void parseAll ()
 Ensures that any abstract entries in the config file are properly interpreted. More...
 
- Static Protected Member Functions inherited from Population.ValueRange
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...
 
- Protected Attributes inherited from Population.ValueRange
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)
 

Detailed Description

Specialization of ValueRange for orbital phase parameter.

Todo:
I don't think that PhaseRange is a subtype of ValueRange in the Liskov sense... check!

Constructor & Destructor Documentation

PhaseRange ( Distribution  dist,
PhaseType  type = PhaseType.MeanAnomaly,
EpochType  epoch = EpochType.GameStart,
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]distThe distribution from which the value will be drawn
[in]typeThe description of orbit position that is used
[in]epochThe time at which the orbit position should be measured
[in]min,maxThe minimum and maximum values allowed for distributions. May be unused.
[in]avgThe mean value returned. May be unused.
[in]stddevThe 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

Member Function Documentation

EpochType getEpoch ( )
package

Returns the epoch at which the phase is evaluated.

Returns
The epoch at which the orbital position is specified
Exception Safety
Does not throw exceptions.
PhaseType getParam ( )
package

Returns the parametrization used by this ValueRange.

Returns
The orbit position parameter represented by this object.
Exception Safety
Does not throw exceptions.

The documentation for this class was generated from the following file: