Class Simulation
Stores and manages simulation runs.
Implements
Inherited Members
Namespace: Quantellia.WMServer.Simulation
Assembly: WMServer.dll
Syntax
public class Simulation : DecisionModelBase, IHasDecisionModel, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IWMOwnableResource, IWMResource
Constructors
Simulation()
Parameterless constructor for Simulation
Declaration
public Simulation()
Simulation(string)
Constructor Simulation specifying ID
Declaration
public Simulation(string ID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | ID |
Properties
DecisionModel
Evaluate a reference to the DecisionModel for which the simulation is being run.
Declaration
public DecisionModel DecisionModel { get; set; }
Property Value
| Type | Description |
|---|---|
| DecisionModel |
Owner
WMPrincipal that owns this Simulation instance.
Declaration
public WMPrincipal? Owner { get; set; }
Property Value
| Type | Description |
|---|---|
| WMPrincipal |
OwnerID
Owner of the Decision Model
Declaration
public string? OwnerID { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
OwnerType
Declaration
public string? OwnerType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Properties
Custom properties defined by the user
Declaration
public Dictionary<string, string> Properties { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> |
ReturnElements
The elements expected to be returned in this simulation in serialized format
Declaration
public List<string> ReturnElements { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> |
Runs
Runs associated with this simulation record. Note that this is not populated automatically on object creation. This is populated manually when it is necessary to convey each run in an OpenDISimulation
Declaration
public List<SimulationRun> Runs { get; set; }
Property Value
| Type | Description |
|---|---|
| List<SimulationRun> |
SimulationParams
The simulation parameters in serialized format.
Declaration
public SimulationParams SimulationParams { get; set; }
Property Value
| Type | Description |
|---|---|
| SimulationParams |
UserData
Additional optional data, specified by the user.
Declaration
public string UserData { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Get(WMPrincipal, string, WMAppDbContext)
Returns Simulation with ID, throws exception if does not exist.
Declaration
public static Task<Simulation> Get(WMPrincipal principal, string ID, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of this entity |
| string | ID | The ID of the entity |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task<Simulation> |
Exceptions
| Type | Condition |
|---|---|
| Exception |
GetAll(WMPrincipal, WMAppDbContext)
Returns all Simulation owned by principal. in OpenDI format
Declaration
public static Task<IEnumerable<OpenDISimulation>> GetAll(WMPrincipal principal, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of this entity |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<OpenDISimulation>> |
Exceptions
| Type | Condition |
|---|---|
| Exception |
GetPopulated(WMPrincipal, string, WMAppDbContext)
Returns Simulation with ID, throws exception if does not exist. Populates run info.
Declaration
public static Task<Simulation> GetPopulated(WMPrincipal principal, string ID, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of this entity |
| string | ID | The ID of the entity |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task<Simulation> |
Exceptions
| Type | Condition |
|---|---|
| Exception |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
| Type | Description |
|---|---|
| WMResourceOperationsDefinition |
Simulate(WMPrincipal, WMAppDbContext)
Runs a simulation on the parameters contained in this Simulation.
Declaration
public Task<SimulationRun> Simulate(WMPrincipal principal, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task<SimulationRun> | A SimulationRun object representing this run. |
Simulate(WMPrincipal, string, WMAppDbContext)
Performs a simulation on the simulation record with id
Declaration
public static Task<SimulationRun> Simulate(WMPrincipal principal, string id, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The user |
| string | id | The ID of the simulation record |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task<SimulationRun> |