Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State Machine Simulator #1158

Merged
merged 11 commits into from
Oct 8, 2024
Merged

Conversation

pchrszon-dlr
Copy link
Contributor

This PR adds a simulator for the stepwise execution of state machines.

How to use:

  • Open the simulator view using Window > Show View > Other... > Virtual Satellite > State Machine Simulator
  • Select one or more state machines, either in the VirSat Navigator or in a state machine diagram. Selecting a structural element works too. This will select all contained state machines.
  • The simulator should show the combined initial state of the state machines.
  • On the right side of the simulator, transitions can be selected and executed using double-click or the forward arrow in the action bar.
  • The backward arrow removes the last transition from the trace.
  • After a transition has been made, the simulator no longer reacts to new selections of state machines. To start a new trace using other state machines, click on the Clear Trace button and then select a new set of state machines.
  • If a state machine diagram editor is open during the simulation, the currently selected state and the selected transition will be highlighted in the diagram. Clicking a transition label in the diagram will select the corresponding transition in the simulator.

Closes #1044

Simulator

@pchrszon-dlr pchrszon-dlr changed the title Feature/1044 state machine simulator State Machine Simulator Aug 28, 2023
- the state machine simulator view now reacts to the state machines
  selected in the navigator or state machine diagrams
- selecting a transition in the simulator highlights the corresponding
  transition in the diagram
- selecting a transition in the diagram selects the transition in the
  transition viewer


- the previous implementation had a quadratic worst-case complexity
- the improved implementation has linear complexity (in the number of
  state machines)
@pchrszon-dlr pchrszon-dlr force-pushed the feature/1044-state-machine-simulator branch from 8e7f7af to bd868d5 Compare August 28, 2023 08:47
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #1158 (bac3b3c) into development (81b14ce) will decrease coverage by 0.15%.
The diff coverage is 66.41%.

❗ Current head bac3b3c differs from pull request most recent head 6d831cc. Consider uploading reports for the commit 6d831cc to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             development    #1158      +/-   ##
=================================================
- Coverage          86.87%   86.72%   -0.15%     
- Complexity          5145     5181      +36     
=================================================
  Files                629      632       +3     
  Lines              25659    25793     +134     
  Branches            2331     2346      +15     
=================================================
+ Hits               22290    22368      +78     
- Misses              2584     2636      +52     
- Partials             785      789       +4     
Files Coverage Δ
...n/statemachines/statespace/StateSpaceExplorer.java 88.11% <88.11%> (ø)
...extension/statemachines/statespace/TraceState.java 0.00% <0.00%> (ø)
...tension/statemachines/util/StateMachineHelper.java 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

Copy link
Member

@franzTobiasDLR franzTobiasDLR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking awsome!!

@PhilMFischer PhilMFischer merged commit 9483b75 into development Oct 8, 2024
12 checks passed
@PhilMFischer PhilMFischer deleted the feature/1044-state-machine-simulator branch October 8, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Simulation for State Machines
3 participants