Occasionally, you may want to have full control over the amount of simulation time to simulate your model. Cameo Simulation Toolkit allows you to use a value of any selected property to determine the simulation time. With this option, you can control the value of the simulation time with your model. The model that enables you to use the runtime value as the simulation time is called "model-based clock". 

Using the model-based clock requires you to specify the property, whose value will be used as the simulation time, as the value of a timeValue tag definition of a Simulation Config. You can specify the unit value for the simulation time through the timeUnit tag definition of the Simulation Configuration. If the timeUnit is unspecified, the millisecond will be used by default. 

The Simulation Configuration with timeUnit and timeValue Setting for a Model-based Clock

The Simulation Configuration with timeUnit and timeValue setting for a model-based Clock.

When you select to use a model-based clock, Cameo Simulation Toolkit will ignore the clock ratio. The following are the constraints of the model-based clock

  • There should be only one object of a classifier whose property is specified as timeValue. In the preceding figure, the property time of the block Clock has been set as the timeValue of the System Execution, which is a Simulation Config for simulating the System block. There should be only one Clock object in each simulation.
  • You should not use a time event to update simulation time in a clock model. Because, it obtains simulation time from the model-based clock. In addition, a time event will be fired at a specific time or duration, and simulation time cannot be updated unless it is fired. Therefore, if you use a time event, simulation time will not be updated at all.