View Source VacEngine.Simulation (Vac Engine v1.1.1)
Provides the model for the blueprint simulation. Simulation is used to assess whether a ruleset meets business requirements.
A blueprint simulation is a collection of input/output definitions. The output corresponds to the expected outcome of the blueprint for the given input.
Simulation runner
The input descriptions are processed a case runner (similar to the main processor) in order to determine if the corresponding output expectations are met.
Stacks, layers, cases
The description passed to the runner is actually a "stack" of simple descriptions called "cases" where the higher case's values overwrite the lower case's ones. Cases are refenced as "layer" in the "stack" and may be referenced in several stacks. Only input is composed this way. Lower cases are not intended to describe output.
Two-layers "Basic stacks" and "Templates"
In the current implementation of the simulation. Stacks are limited to two level. The bottom layer is called a "Template" where the top one is called a "Runnable case".
Blueprint templates and basic stacks
Each blueprint simulation has a collection of templates (a many to many relation between cases and blueprints) that can be used as bottom layer cases. Each simulation also has a collection fo "Basic stacks", each containing a runnable case and optionally a template. The editor allows to pick the template of the basic cases among the simulation's templates, but technically, a template can be any case of the workspace.
Case sharing
Blueprints can share cases. This automatically occurs when a blueprint is duplicated, but not when a blueprint is exported and reimported where each case is duplicated.
When cases are shared, they can be modified at one for every blueprint. This is useful when you want to fix an error.
Workspace cases collections
Cases
Cases are grouped in a multi-layer stack. Each layer is a single case.
The content of a case can be used as a base for another case, forming a stack (technically, even a single case is part of a stack).
The basic stack is a two-layered stack (used as the only existing stack structure)
Cases are created workspace-wide whereas case stacks are limited to the blueprint scope. This structure allows to share cases among several blueprints.
Link to this section Summary
Functions
Creates a new stack with an empty runnable case and no template case.
Create a new blank template for the given blueprint with the given name.
Create a new input entry for the given case, key with the given value.
Create a new output entry for the given case, key and variable.
Create a new simulation setting for the given blueprint.
Creates a new stack using the given attributes.
Delete the given input entry.
Delete given output entry.
Deletes the stack with the given id. Layers are also deleted. Cases not.
Delete the template of the given simple stack.
Delete the template with the given id.
Fork the runnable case of the given simple stack, i.e. create a copy to use in the given stack.
For the template case, i.e. create a copy to use in the template and all cases using this template.
Get the blueprint name and ids that share the runnable case of the given simple (two-layer) stack.
Returns the name and ids of the blueprints with which the case is shared.
Retrieve the cases (stacks) using the given template.
Get the first stack associated to the given blueprint.
Get the simulation settings.
Retrieve a stack corresponding to the given id.
Retrieve a stack corresponding to the given id (throw! version).
Retrieve all the stack names for the given blueprint.
Get the runnable case of the given simple stack.
Get the template case of the given simple stack.
Get all stacks for the given blueprint.
Retrieve the template with the given id.
Get all the given blueprint's template names.
Get all the given blueprint's templates.
Import all cases from a path (used for bulk importation).
Add the case entries (input and output) to the stacks retrieved by the given query.
Add the setting attribute to the stacks retrieved by the given query.
Queue a case to be runned by the simulation runner.
Sets whether the case expects an error to occur (mostly when the complete element is not used).
Set the "expected" value of the given output entry.
Set the case with the given id as template case for the given simple stack.
Set the forbidden flag of the given output entry. If forbidden is set to true, the corresponding output variable is expected to be absent of the output in the current case.
Update given input entry value.
Update setting with the given options.
Currently, the only option is the datetime env_now
.
Validate given input entry for the given variable.
Validate the setting.
Get the default value for a variable of the given type. If the type is string, the enum must me passed if it exists.
Link to this section Functions
Creates a new stack with an empty runnable case and no template case.
Create a new blank template for the given blueprint with the given name.
Create a new input entry for the given case, key with the given value.
Create a new output entry for the given case, key and variable.
Create a new simulation setting for the given blueprint.
The default "now" time used here is "2000-01-01" (0h).
Creates a new stack using the given attributes.
Delete the given input entry.
Delete given output entry.
Deletes the stack with the given id. Layers are also deleted. Cases not.
Delete the template of the given simple stack.
Delete the template with the given id.
Fork the runnable case of the given simple stack, i.e. create a copy to use in the given stack.
This is useful when the runnable case is shared among stacks of several blueprints, e.g. when a blueprint has been duplicated.
For the template case, i.e. create a copy to use in the template and all cases using this template.
This is useful when the template case is shared among templates of several blueprints, e.g. when a blueprint has been duplicated.
Get the blueprint name and ids that share the runnable case of the given simple (two-layer) stack.
Returns the name and ids of the blueprints with which the case is shared.
Retrieve the cases (stacks) using the given template.
Get the first stack associated to the given blueprint.
Get the simulation settings.
Retrieve a stack corresponding to the given id.
Retrieve a stack corresponding to the given id (throw! version).
Retrieve all the stack names for the given blueprint.
Typically used to build the list of available stacks.
Get the runnable case of the given simple stack.
Get the template case of the given simple stack.
Get all stacks for the given blueprint.
Retrieve the template with the given id.
Get all the given blueprint's template names.
Get all the given blueprint's templates.
Import all cases from a path (used for bulk importation).
Add the case entries (input and output) to the stacks retrieved by the given query.
Add the setting attribute to the stacks retrieved by the given query.
Queue a case to be runned by the simulation runner.
Sets whether the case expects an error to occur (mostly when the complete element is not used).
Set the "expected" value of the given output entry.
Set the case with the given id as template case for the given simple stack.
Set the forbidden flag of the given output entry. If forbidden is set to true, the corresponding output variable is expected to be absent of the output in the current case.
Update given input entry value.
Update setting with the given options.
Currently, the only option is the datetime env_now
.
Validate given input entry for the given variable.
Validate the setting.
Get the default value for a variable of the given type. If the type is string, the enum must me passed if it exists.