Class StateValue<T>
An integration state that can track a value of a specified type.
Implements
Inherited Members
Namespace: SpiceSharp.Simulations.IntegrationMethods
Assembly: SpiceSharp.dll
Syntax
public class StateValue<T> : IIntegrationStateType Parameters
| Name | Description | 
|---|---|
| T | The value type. | 
Constructors
StateValue(IHistory<T>)
Initializes a new instance of the StateValue<T> class.
Declaration
public StateValue(IHistory<T> history)Parameters
| Type | Name | Description | 
|---|---|---|
| IHistory<T> | history | The history. | 
StateValue(int)
Initializes a new instance of the StateValue<T> class.
Declaration
public StateValue(int length)Parameters
| Type | Name | Description | 
|---|---|---|
| int | length | The number of points to be tracked. | 
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if the number of points is smaller than 1. | 
Properties
Value
Gets or sets the current value.
Declaration
public T Value { get; set; }Property Value
| Type | Description | 
|---|---|
| T | The current value. | 
Methods
Accept()
Accepts the current point and moves on to the next.
Declaration
public void Accept()GetPreviousValue(int)
Gets a previous value of the state. An index of 0 indicates the current value.
Declaration
public T GetPreviousValue(int index)Parameters
| Type | Name | Description | 
|---|---|---|
| int | index | The number of points to go back in time. | 
Returns
| Type | Description | 
|---|---|
| T | The previous value. |