Table of Contents

Class StateModel

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

[Nominal] The state properties model is able to store a range of states and be able to integrate over these states during the simulation. It is common that the state properties is added to a spacecraft for integrating through a state and is able to manage the base state data for the object itself.


[UniverseParent(typeof(IIntegrable))]
public class StateModel : UniverseModel<UniverseObject>
Inheritance
StateModel
Extension Methods

Constructors

StateModel()

Default constructor

protected StateModel()

Fields

IntegratorType

The integrator type used to integrate the state. Depending on the type, this will integrate the state differently.

public IntegratorType IntegratorType

Field Value

IntegratorType

Properties

Count

The number of properties within the cache

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public int Count { get; }

Property Value

int

Methods

CopyCache()

Creates a copy of all the states that exist within the current cache and returns the copy as a dictionary of the cache for easy access.

public Dictionary<string, StateProperty> CopyCache()

Returns

Dictionary<string, StateProperty>

A copy of the cache dictionary with completely new state property copies

Delete(string)

Attempts to delete a state property from the cache. This will remove it if it does exist.

public void Delete(string key)

Parameters

key string

The key to delete the property from

ForEach(Action<string, StateProperty>)

Iterate through each property with a action

public void ForEach(Action<string, StateProperty> action)

Parameters

action Action<string, StateProperty>

The key-value action

GetDouble(string)

Creates or gets the current double property as a single value that can store the state and derivative of some value.

public DoubleProperty GetDouble(string key)

Parameters

key string

The key to search for

Returns

DoubleProperty

The double property that now exists

GetMatrix3(string)

Creates or gets the current matrix 3x3 property as a 9-part vector that can store the state and derivative of some value.

public Matrix3Property GetMatrix3(string key)

Parameters

key string

The key to search for

Returns

Matrix3Property

The Matrix3x3 property that now exists

GetVector(string, int)

Creates or gets the current vector property as a n-part vector that can store the state and derivative of some value.

public VectorProperty GetVector(string key, int size)

Parameters

key string

The key to search for

size int

The size of the vector

Returns

VectorProperty

The vector property that now exists

GetVector3(string)

Creates or gets the current vector3 property as a 3-part vector that can store the state and derivative of some value.

public Vector3Property GetVector3(string key)

Parameters

key string

The key to search for

Returns

Vector3Property

The Vector3 property that now exists

Integrate(double, double)

Integrates the current state of the object using the current integrator type and the integrable object.

public void Integrate(double time, double step)

Parameters

time double

[s] The current time of the simulation

step double

[s] The timestep of the simulation

OnCreate()

Called when the object is created from the controller and has been attached to the parent object. By this point, it has been registered to the simulation and will run after the constructor.

protected override void OnCreate()

OnLoad(double)

Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.

protected override void OnLoad(double time)

Parameters

time double

[s] The current clock time of the simulation

OnSave()

Called before the object is saved into the save state. This ensures that any additional metadata can be saved on the object before it is automatically serialized.

protected override void OnSave()