Discrete Event Simulator Walkthrough
Master the art of the Action Diagram for the Discrete Event Simulator
Innoslate’s Discrete Event Simulator and Action Diagram enable modeling and analysis of complex system behaviors. This walkthrough series covers simulation features like sequential execution, decision logic, decomposition, resources, costs, triggers, and synchronization with step-by-step guidance. Each tutorial builds on the last, ensuring a thorough understanding of the simulator’s capabilities and enhancing your ability to create robust simulations.
This walkthrough aims to provide a solid foundation in Innoslate's Action Diagram, essential for maximizing the Discrete Event Simulator's utility, allowing users to model, analyze, and optimize complex systems with precision.
To follow along and explore the features covered in this walkthrough, download the Robotic Arm Project and import it into a new Innoslate project.
Walkthrough Use Case
Level Zero: Getting Started
Video walkthrough of different features of the DES View
This introductory level introduces a Robotic System model and the Discrete Event Simulator in Innoslate.
Steps
- Navigate to Diagrams:
- Click Diagrams in the top navigation bar to switch to the Diagrams Dashboard.
- Access the Action Diagram:
- Locate and click the diagram named Level One: Robot Root Action to open the Action Diagram.
- Launch the Simulator:
- In the Action Diagram, click the blue Simulate dropdown menu and select Discrete Event.
- This opens the Discrete Event Simulator with the Action Diagram loaded and ready to simulate.
- Explore the left sidebar to acquaint yourself with the panels available for addition to the DES view. You will observe categories of information that can be monitored in the simulation, such as time, cost, resources, and others, allowing you to incorporate panels like the Gantt Chart and Action Trace 3D.
- Press Play.
Outcome
You are now ready to explore the simulator’s features in the next tutorial.
Level One: Sequential Execution
Level One Robotic Arm Model
This tutorial demonstrates how Action constructs are executed sequentially using the Level One: Robot Root Action diagram.
Steps
- Locate and Open the Action Diagram:
- In Diagrams View, navigate to Level One: Robot Root Action.
- Observe the sequential process where each Action waits for the previous one to complete.
- Verify Action Durations:
- Click each Action to check its Duration attribute in the left sidebar’s Attributes tab.
- Example durations:
- Wake Robot: Fixed 8 seconds.
- Sleep Robot: Fixed 8 seconds.
- Receive User Command: Normal Distribution (mean: 4s, std dev: 2s).
- Perform User Command: Normal Distribution (mean: 30s, std dev: 15s).
- Ensure all Actions have a Duration (value + units) for proper execution.
- Run the Simulation:
- In the Action Diagram, click Simulate > Discrete Event.
- Set Speed to 1x (Real Time) in the settings and save.
- Add panels: Action Trace 3D (Other> Action Trace 3D), Gantt Chart (Time> Gantt Chart).
- Click Play to start the simulation.
- Observe Panels:
- Status: Shows the current Action.
- Action Trace 3D: Blue for completed Actions, green for current, gray for pending.
- Total Time: Displays elapsed simulation time.
- Gantt Chart: Shows executed Actions in blue.
- Analyze Results:
- When complete, the Status panel shows 100% COMPLETE.
- Rerun the simulation (Restart button) to observe how random distributions affect total time.
- Pause the simulation (via the left sidebar) while it is running again to utilize the Step button, allowing you to progress through each Action individually.
Outcome
You have learned how sequential Actions are simulated, how time is recorded, and how to interpret the panels displayed.
Level Two: Decision Logic
Level Two Robotic Arm Model
This tutorial introduces decision points using OR and LOOP constructs in the Level Two: Robot Root Action diagram.
Steps
- Open the Action Diagram:
- In Diagrams View, navigate to Level Two: Robot Root Action.
- Note the LOOP (for multiple command iterations) and OR (to validate commands).
- Understand Constructs:
- LOOP: Iterates until a condition is met (e.g., user-specified iterations). Without a script, it prompts for the number of iterations.
- OR: Selects one branch (e.g., Yes to perform a valid command, No to display an error).
- Run the Simulation:
- Click Simulate > Discrete Event.
- Under Settings, ensure Speed is 1x (Real Time) and Decisions is set to Prompt on no script. Save settings.
- Add panels: Action Trace 3D (Other> Action Trace 3D), Gantt Chart (Time> Gantt Chart), and others as preferred.
- Click Play.
- Interact with Prompts:
- When the LOOP executes, a prompt asks for the number of iterations. Accept the default (3) and click Submit.
- For each OR prompt (Valid Command?), select:
- Iteration 1: Yes
- Iteration 2: No
- Iteration 3: Yes
- Analyze Results:
- Observe how the Gantt Chart and Action Trace 3D reflect the chosen paths.
- Rerun the simulation with different prompt inputs to see varying outcomes.
Outcome
You can simulate and analyze models with decision logic using OR and LOOP constructs.
Level Three: Decomposition, Resources, and Costs
Level Three Robotic Arm Model
This tutorial explores decomposition, resource consumption, and cost modeling using the Level Three: Robot Root Action diagram.
Steps
- Open the Action Diagram:
- In Diagrams View, navigate to Level Three: Robot Root Action.
- Note the DECOMPOSED flag on Perform Desired Command, indicating a lower-level Action Diagram.
- Explore Decomposition:
- Click the DECOMPOSED flag to view the child diagram.
- The diagram includes an OR with three branches (Move, Pick Up, Replace Part), each consuming the Power resource.
- Verify Resource Settings:
- Select the Power resource and check its attributes in the ‘Attributes’ tab of the left sidebar:
- Initial Amount: 2000
- Minimum Amount: 0
- Maximim Amount: 2000
- Units: mAh
- Select the Power resource and check its attributes in the ‘Attributes’ tab of the left sidebar:
- Verify Resource Consumption:
- On the same left sidebar, select the Relationships tab and change the ‘Pinned’ dropdown to ‘Active’.
Click the Attributes button next to Grab Object and verify:
- Amount: Normal Distribution (mean: 10, std dev: 3).
- Repeat for other Actions. Save changes.
- Verify Cost Attributes:
- Select Replace Robot Part on the diagram.
- Find & Select Open on the toolbar.
- Select Entity View.
- Find incurs Cost on the Relationships Table.
- Click the Part Cost entity to enter its Entity View.
- Verify:
- Amount: Uniform Distribution (mean: 100, var: 200)
- Units: $
- Run the Simulation:
- Return to Level Three: Robot Root Action Diagram (Diagrams > Level Three: Robot Root Action Diagram)
- Find & Select on the toolbar Simulate > Discrete Event.
- Add Cost Over Time Panel from the left sidebar (Cost>Cost Over Time>Select 'Total'> Set.
- Add Resources Over Time Panel from the left sidebar (‘Resources’>'Resources Over Time Panel'> Select 'Power' >Set) .
- Add more panels: Action Trace 3D (Other> Action Trace 3D), Gantt Chart (Time> Gantt Chart), and others as preferred.
- Under 'Settings' set Decisions to Automate with no script and ‘Save Settings’.
- Click Play.
- When the LOOP executes, a prompt asks for the number of iterations. Accept the default (3) and click Submit.
- Choose "Yes" for the Valid Command? prompt.
- Select "Move" for the Perform Action? prompt.
- Choose "Yes" for the Valid Command? prompt for the 2nd iteration.
- Select "Pick-Up" for the Perform Action? prompt.
- Choose "Yes" for the Valid Command? prompt for the 3rd iteration.
- Select "Replace Part" for the Perform Action? prompt.
- Analyze Results:
-
- Observe Resources Over Time showing Power depletion and Cost Over Time showing cost increases (especially when Replace Robot Part executes).
- In Action Trace 3D, you can enhance your understanding of the model by using the scroll function to zoom in and out, left-clicking to rotate the view, and right-clicking to pan across the decomposed diagram.
- Rerun to see varying resource and cost outcomes.
Outcome
You know how to simulate models with decomposition, track resource consumption, and analyze costs.
Level Four: Triggers
Level Four Robotic Arm Model
This tutorial demonstrates Input/Output constructs to control Action execution order using the Level Four: Robot Root Action diagram.
Steps
- Open the Action Diagram:
- In Diagrams View, navigate to Level Four: Robot Root Action.
- Note the Parallel construct with Branch Assets User, Robot Application and Robot.
- Understand Triggers:
- Initiate a Command generates a User Command Input/Output received by Interpret User Command.
- Send Command to Robot generates an Action Command Input/Output for Perform Command.
- In the Perform Command decomposition diagram, the Action Command Input/Output triggers Perform User Action.
- Parent Actions (e.g., Perform Command) pass Input/Outputs to child Actions without their own duration or resources. When an ‘Input/Output’ is triggered to a parent, the ‘Input/Output’ is automatically added to the child diagram. The ‘Input/Output’ needs to then be received (or generated) by the applicable child ‘Action’ in the decomposition diagram to avoid an error.
- Prepare and Run the Simulation:
- From the Open Dropdown, select ‘Parent Diagram’.
- Click Simulate > Discrete Event.
- Add panels: Action Trace 3D (Other> Action Trace 3D), Gantt Chart (Time> Gantt Chart), and others as preferred.
- Click Play.
- When the LOOP executes, a prompt asks for the number of iterations. Accept the default (3) and click Submit.
- Choose "Yes" for the Valid Command? prompt during the first two iterations.
- Choose "No"for the third iteration, to end the simulation in deadlock.
- Analyze Results:
-
- In the Gantt Chart, yellow bars show wait times for Input/Output triggers.
- On the third iteration when No is selected, a Simulation Deadlock dialog appears because Perform User Action awaits an untriggered Input/Output.
- Rerun with Yes selections to observe smooth execution.
Outcome
You understand how Input/Output constructs control execution order and can identify deadlock scenarios.
Level Five: Synchronization
This tutorial introduces the SYNC construct to manage synchronization and prevent deadlocks using the Level Five: Robot Root Action diagram.
Steps
- Open the Action Diagram:
- In Diagrams View, navigate to Level Five: Robot Root Action.
- Note the SYNC construct (Sync Robot State) addressing the deadlock from Level Four.
- Understand the SYNC Construct:
- The SYNC executes when any branch completes (e.g., Perform Command for Yes or Receive Cancel Command for No).
- Its Duration (set to 0 seconds) determines how long to wait before terminating incomplete branches.
- Run the Simulation:
- Add panels: Action Trace 3D (Other> Action Trace 3D), Gantt Chart (Time> Gantt Chart), and others as preferred.
- Click Simulate > Discrete Event.
- Click Play.
- When the LOOP executes, a prompt asks for the number of iterations. Accept the default (3) and click Submit.
-
-
- Test both Yes and No for the Valid Command? prompt.
-
- Analyze Results:
- The SYNC ensures completion without deadlock, terminating the opposing branch instantly.
- In the Status panel, observe Actions waiting for Input/Output triggers (e.g., Interpret User Command).
- Rerun with different prompt choices to confirm consistent behavior.
Outcome
You can use SYNC constructs to manage synchronization and prevent deadlocks.
Conclusion
This walkthrough is designed to educate you on mastering Innoslate’s Discrete Event Simulator, taking you from the basics of setup to advanced synchronization techniques. By engaging in hands-on learning and utilizing interactive tools, you will develop the skills necessary to effectively analyze, refine, and optimize simulations. For further learning, delve into Innoslate’s extensive documentation on Simulation Controls, Simulation Scripts, and the Monte Carlo Simulator, which are invaluable resources for enhancing your expertise and achieving successful simulation results.