Class SimulationController
Controller for the REST interface for managing Simulation records.
Inherited Members
Namespace: Quantellia.WMServer.Simulation
Assembly: WMServer.dll
Syntax
[ApiController]
[Authorize]
public class SimulationController : ControllerBase
Constructors
SimulationController(WMAppDbContext)
Declaration
public SimulationController(WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMAppDbContext | context |
Methods
Create(SimulationArgs)
Create but do not run a new Simulation of a DecisionModel.
Declaration
[HttpPost("simulation")]
public Task<ActionResult<OpenDISimulation>> Create(SimulationArgs args)
Parameters
Type | Name | Description |
---|---|---|
SimulationArgs | args | Arguments that control the simulation. |
Returns
Type | Description |
---|---|
Task<ActionResult<OpenDISimulation>> | Returns a reference to the newly created Simulation object. |
Delete(string)
Deletes the simulation record with the given ID, as well as all related simulation runs and results.
Declaration
[HttpDelete("simulation/{id}")]
public Task<IActionResult> Delete(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the simulation record to delete |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Get()
Get the collection of Simulation records owned by the user.
Declaration
[HttpGet("simulation")]
public Task<ActionResult<IEnumerable<OpenDISimulation>>> Get()
Returns
Type | Description |
---|---|
Task<ActionResult<IEnumerable<OpenDISimulation>>> |
Get(string)
Get the details of the Simulation with the specified ID.
Declaration
[HttpGet("simulation/{id}")]
public Task<ActionResult<OpenDISimulation>> Get(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | ID of the Simulation to retrieve. |
Returns
Type | Description |
---|---|
Task<ActionResult<OpenDISimulation>> | The full details of the requested Simulation record. |
GetRun(string, string?)
Returns a simulation run, with all simulation results populated.
Declaration
[HttpGet("simulation/run/{id}")]
public Task<ActionResult<OpenDISimulationRun>> GetRun(string id, string? format = "JSON")
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the simulation run |
string | format | Optional parameter specifying the format. Only "CSV", is supported in this version. |
Returns
Type | Description |
---|---|
Task<ActionResult<OpenDISimulationRun>> |
GetRuns(string)
Returns a list of all of the simulation runs of a provided simulation record
Declaration
[HttpGet("simulation/{id}/runs")]
public Task<ActionResult<IEnumerable<OpenDISimulationRun>>> GetRuns(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the simulation record |
Returns
Type | Description |
---|---|
Task<ActionResult<IEnumerable<OpenDISimulationRun>>> |
Exceptions
Type | Condition |
---|---|
NotImplementedException |
Run(string)
Run a previously saved Simulation.
Declaration
[HttpPost("simulation/{id}/run")]
public Task<ActionResult<OpenDISimulationRun>> Run(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the simulation to run. |
Returns
Type | Description |
---|---|
Task<ActionResult<OpenDISimulationRun>> |
Simulate(string, SimulationArgs)
Create a Simulation of a Decision Model and run it.
Declaration
[HttpPost("simulate/{id}")]
public Task<ActionResult<OpenDISimulationRun>> Simulate(string id, SimulationArgs args)
Parameters
Type | Name | Description |
---|---|---|
string | id | ID of the Decision Model that will be simulated. |
SimulationArgs | args | The arguments that control the simulation. |
Returns
Type | Description |
---|---|
Task<ActionResult<OpenDISimulationRun>> |
Remarks
If the SaveAs argument is specified, the simulation will be saved as a new Simulation
entity with whose Name is the value of the
args
.SaveAs argument.
Update(string, SimulationArgs)
Update the Simulation record with the specified ID.
Declaration
[HttpPut("simulation/{id}")]
public Task<IActionResult> Update(string id, SimulationArgs args)
Parameters
Type | Name | Description |
---|---|---|
string | id | ID of the Simulaiton record to update. |
SimulationArgs | args | Object containing the values to be updated. |
Returns
Type | Description |
---|---|
Task<IActionResult> |