Overview
The ScaleOut Model Development Tool offers an environment in which you can test the interaction of models and their respective instances. It can be used for local testing and development before deploying models to production in the ScaleOut Digital Twins™ service.
You can drive your test by creating simulation models that will simulate sensor messages or control the behavior of real-time instances.
It is recommended that you first test your models individually using the other testing modes available in the Model Development Tool. The other modes allow you to step through the rules and perform unit testing of each model. Once you have validated the individual behavior of each model then using the multiple-model simulation will allow you to test the interaction of these models, or test more complex scenarios (integration testing).
In that mode, you can:
spawn many instances of several models at the same time
import instances from CSV files and automatically initialize them with a set of properties
control the test scenario by implementing simulation models which will drive your test
send messages from simulation instances to real-time instances to drive a particular test scenario
control the pace of the simulation by defining the time increment between each simulation step
set a start date and time and a duration for your simulation
run the simulation continuously or step-by-step
track properties of different instances at each time step of the simulation
create aggregated metrics to track numerical properties (similarly to widgets in our production UI)
Control a test scenario through simulation models
Once you have created instances for your real-time model, you can exercise a particular scenario by implementing simulation models which send messages to the real-time instances. These test scenarios can use heuristics or have deterministic behavior, depending on your testing needs. You could, for instance, create a simulation model whose instances randomly send messages to the corresponding real-time instances to simulate an incident and test the response of the real-time models.
Take the example of a real-time model for a digital twin that tracks the temperature of a mechanical component. In real life, the mechanical component would send temperature readings to the real-time instance, and if the temperature gets above a certain value, the digital twin could send an alert. For your testing purposes, you can create a simulation model which sends temperature readings to the real-time instance using the EMIT_TELEMETRY function.
This simulation could model the mechanical component’s failure by increasing temperature readings over time–this would test that the real-time instance will trigger an alert as expected.
More sophisticated scenarios could developed with the simulation instances that involve complex interactions between models, add randomness, or test scenarios over a long period. Another benefit is that you could use the same simulation models and deploy them at scale in your test deployments, outside of the Development tool.
Time considerations in simulation
Whether you are looking at simulations in the ScaleOut Digital Twins service or in the Model Development Tool, time is handled in a similar way. You can view a simulation as a sequence of discrete time steps at which simulation instances execute some logic (defined in simulation rules for rule-based models). At each new iteration of a simulation, the simulation time gets incremented by a pre-defined value (simulation time step increment) and all simulation instances are offered a chance to execute their simulation rules. Each instance can also elect to not do anything for a given simulation duration (done by calling the DELAY function): once that duration elapses in simulation time, those instances will again run simulation rules. Because you can pause a simulation at any time, there is no correlation between simulation time and real time. You can also in the Model Development Tool decide to run the simulation with a certain value for your simulation time step increment, and add a real time delay between each simulation iteration: this is to allow you to slow down the execution of each step in order to monitor the execution of your simulation.
Let’s take a simple example to illustrate all of these concepts. Say we have a real-time model with 2 instances (InstanceA and InstanceB) and a simulation model (with corresponding InstanceA and InstanceB). We set the simulation time increment to 1000ms, and add a real time delay of 2 seconds. If we run this simulation continuously without pausing it, every 2 seconds of real time, the simulation time will increase by 1000ms and run the simulation rules on InstanceA and InstanceB of the simulation model. Now say that InstanceB calls DELAY for 10 seconds of simulation time. InstanceA will run for the next 10 simulation time steps, while InstanceB is “sleeping”. After the 10 iterations (10 seconds of simulation time), InstanceB will again start running simulation rules with every new time step. This whole sequence will run in about 20 seconds of real time since we set the real-time delay between simulation iterations to 2 seconds.
See also
For more information on using simulation for your models, please refer to Using Digital Twins for Simulation