In this tutorial, models are mainly validated by means of monitoring with respect to correct traces. For a new - not yet implemented - interface, such traces are not available. In such a situation, simulation can be useful to validate the model.

To generate a simulation, first values for input parameters of commands and signals have to specified in a .params file. For the IService interface, this can be done as follows:

import "IService.interface"

interface: IService
trigger: LoadProduct
  state: Operational
    params: ( ProductName::WATER )
    params: ( ProductName::COLA )
  state: Error
    params: ( ProductName::JUICE )

Extend the project file VendingMachine.prj with the following task for simulator generation:

Generate Simulator {
    Simulator_IService for interface IService
    {
        params: "IService/IService.params"
    }
}

Generate the simulator by right-clicking on the .prj file and selecting Run As → Run generators. Wait for the generation to end - see the green progress bar in the bottom right corner - and navigate to folder src-gen/simulator/ and double-click on the generated .bat or .sh file. An alternative is to combine generation and execution by using Run As → Generate and execute simulator.

In the simulator, one can select an allowed action of the client or the server, if any. Next the action can be executed by clicking on it in the Action(s) column. Reply actions are preceded by "R:". Observe that the set of possible actions for LoadProduct depends on the values specified in IService.params.