Book a Demo

Author Topic: State Machine Simulation  (Read 4195 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
State Machine Simulation
« on: September 24, 2013, 06:13:49 am »
Hi All

When executing a state machine simulation with behaviour of state operations specified in JavaScript and using Interpreted simulation, is there a maximum number of steps / simulation code instructions that are executed?

If so, can this be configured?

I have a simple state machine, that goes into a "flip flop" between states (i.e. it never ends) this is deliberate, strange though it sounds. When I run the simulation, it ends automatically after seemingly random number of steps.

In order to simulate a delay in a state, I have used the following code

sim.endOfPhase = false;
while (!sim.endOfPhase) {

         sim.endOfPhase = (Math.floor(Math.random()*100+1) == 1);
        Trace("end of night  phase  = " + sim.endOfPhase);
}


This code is in a behaviour of each "flip flop" state, so that the simulation just simply oscillate between states very rapidly.

It appears, that there is some kind a execution limit, but can anyone confirm this?

Cheers

Phil
Models are great!
Correct models are even greater!

starling13

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: State Machine Simulation
« Reply #1 on: May 28, 2019, 12:33:00 am »
I have the same issue with EA 12.1.

The FSM with Javascript guards and conditions stops after few steps.

Amelia28

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: State Machine Simulation
« Reply #2 on: July 06, 2019, 03:32:01 am »
Hi,
same issue too. 


Dafont Showbox Adam4adam


« Last Edit: July 26, 2019, 06:53:13 am by Amelia28 »