Table of Contents

Class ComponentModel

Namespace
NominalSystems.Core
Assembly
NominalSystems.Core.dll

[NominalSystems] A implementable per-component object model

public abstract class ComponentModel
Inheritance
ComponentModel

Constructors

ComponentModel()

Default constructor

public ComponentModel()

Fields

IsEnabled

Is 'ComponentModel' enabled

public bool IsEnabled

Field Value

bool

Properties

ID

The event listener's ID

public Guid ID { get; }

Property Value

Guid

Target

The parent 'Component' object

public virtual Component Target { get; }

Property Value

Component

Methods

AddDelayEvent(Action, double)

Add a new simulation delay event (seconds)

public Guid AddDelayEvent(Action func, double seconds = 0)

Parameters

func Action

the event delegate

seconds double

the delay amount (seconds)

Returns

Guid

the event guid

AddDelayEvent(Action<double>, double)

Add a new simulation delay event (seconds)

public Guid AddDelayEvent(Action<double> func, double seconds = 0)

Parameters

func Action<double>

the event delegate

seconds double

the delay amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action func, double seconds = 0)

Parameters

func Action

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action<double, double>, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action<double, double> func, double seconds = 0)

Parameters

func Action<double, double>

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action<double>, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action<double> func, double seconds = 0)

Parameters

func Action<double>

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

GetSystem<T>()

public T GetSystem<T>() where T : SimulationSystem, new()

Returns

T

Type Parameters

T

OnBegin(double)

Called when the 'ComponentModel' is beginning

[Event(EventType.Default)]
protected virtual void OnBegin(double time)

Parameters

time double

elapsed time (seconds)

OnDecodeMetadata(JObject)

Called after the "ComponentModel" was loaded to handle additional metadata.

[Event(EventType.Default)]
protected virtual void OnDecodeMetadata(JObject metadata)

Parameters

metadata JObject

OnEncodeMetadata(JObject)

Called while the "ComponentModel" is being saved to save additional metadata.

[Event(EventType.Default)]
protected virtual JObject OnEncodeMetadata(JObject metadata)

Parameters

metadata JObject

Returns

JObject

OnFinish(double)

Called when the 'ComponentModel' is finishing

[Event(EventType.Default)]
protected virtual void OnFinish(double time)

Parameters

time double

elapsed time (seconds)

OnReset(double)

Called when the 'ComponentModel' is resetting

[Event(EventType.Default)]
protected virtual void OnReset(double time)

Parameters

time double

reset time (seconds)

OnUpdate(double, double)

Called when the 'ComponentModel' should update

[Event(EventType.Default)]
protected virtual void OnUpdate(double time, double step)

Parameters

time double

elapsed time (seconds)

step double

the time step (seconds)

StopEvent(Guid)

Stop the simulation event from running

public void StopEvent(Guid id)

Parameters

id Guid

a event id