Newer
Older
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- Documentation of Simulation Perspective. -->
<head>
<link rel="stylesheet" type="text/css" href="../layout/stylesheet.css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<title>Simulation of the behavior of your Application</title>
</head>
<div class="header">
<div class="box">
<div class="navbar">
<!--a href="https://www.fortiss.org/" align="left">
<img src="fortiss-logo.png" width="90px" height="20px" align="left">
</a-->
<div class="dropdown">
<button class="btn" id="hamburger">
<label for="hamburger" class="hamburger">
<span class="hamburgerLine"></span>
<span class="hamburgerLine"></span>
<span class="hamburgerLine"></span>
</label>
</button>
<div class="dropdown-content">
<a href="../getting_started.html"> Main Page</a>
<a href="../ModandSim/model_element_attributes.html">Modeling and Simulation</a>
<a href="../ta/technical_viewpoint.html">Deployment and Code Generation</a>
<a href="../dse/dse_perspective.html">Design Space Exploration (DSE)</a>
<a href="../assuranceCases/creation.html">Assurance Case Modeling</a>
<a href=".././af3_further_resources.html">Further Resources</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Modeling and Simulation <i class="triangle"></i></button>
<div class="dropdown-content">
<a href="model_element_attributes.html">Introduction to Graphical Modeling Interface</a>
<a href="component_architecture.html">Component Architecture Modeling</a>
<a href="data_dictionary.html">Data Dictionary: Types and Functions</a>
<a href="code_specification.html">Behavior Modeling -> Code Specifications</a>
<a href="state_automaton.html">Behavior Modeling -> State Automata</a>
<a href="hierarchical_state_automaton.html">Behavior Modeling -> Hierarchical State Automata</a>
<a href="mode_automaton.html">Behavior Modeling -> Mode Automata</a>
<a href="operatorpanels.html">Simulation -> Operator Panels</a>
<a href="operatorpanels_advanced.html">Simulation -> Advanced Operator Panels</a>
<a href="cosimulation_with_af3.html">Simulation -> Co-Simulation and FMI Support</a>
<a href="refactoring.html">Refactoring</a>
<a href="model_markers_view.html">On-the-fly Checks</a>
</div>
</div>
<div class="topnav-right">
<a href="mailto:af_user@lists.fortiss.org?subject=Reporting 'simulation_with_af3.html' Documentation Problem!&body= Dear Af3 team, I am reporting an issue related to 'modelling and simulation'.
{Please specify the problem precisely here.}.">Report a Problem?</a>
</div>
</div>
</head>
</div>
</div>
<div class="box">
<button onclick="topFunction()" id="upBtn" title="Go to top">Top</button>
<h2>Simulation of the behavior of your Application</h2>
<h4>Introduction</h4>
<p>This section describes how to simulate the behavior of your components and its comprised state automatons. You can simulate your entire component architecture as well as only subcomponents of your architecture. Simulations can be influenced by manually setting values at input-ports of components. During the stepwise simulation, you can analyze:
<li>values of the input and output ports</li>
<li>active state of a state automaton, as well as values of its internal variables</li>
<h4>The Simulation Perspective</h4>
<p>The <i>Simulation Perspective</i> contains three main areas.
<li>on the left side there is the <i>Simulation View</i> containing a tree of simulatable components</li>
<li>on the upper right side the component architectures of composite components and the state automatons of atomic components are visualized, each in a separate view</li>
<li>on the lower right side there are table views showing the values of the I/O-Ports of components and states, as well as the values of DataStateVariables</li>
<p>This is only a default layout. Of course you can reorder the complete layout regarding to your personal flavor.</p>
<p>In order to execute a simulation, select a component in your <i>Modeling Perspective</i>, open the context menu (by right-clicking on it) and choose "Run Simulator".</p>
<img src="./pictures/Simulation.RunSimulator.png" />
<p> After you have done this, the <i>Simulation Perspective</i> will appear automatically. (However, if your component architecture is not simulatable (e.g. because it has unconnected ports), then the Simulation Perspective stays empty and will not be opened.)</p>
<p>After the Simulation Perspective becomes active, initially you will see only the simulation view containing the tree of components. In order to open the other views, open the context menu of a component and select your desired view. For composite components, the <i>Component Architecture View</i> and the <i>I/O View</i> is available. For atomic components, the <i>State automaton view</i>, the <i>I/O View</i> and the <i>Data State view</i> can be selected.</p>
<img src="./pictures/simulationPerspective.png" style='height: 250%; width: 100%;'/>
<h4>Execute Simulations</h4>
<p>You can execute simulations step-wise by clicking on the <i>Simulation Step</i> Button at the top of the <i>Simulation View</i>.</p>
<img src="./pictures/Simulation.ControlButtons.png" />
<p> You can also execute multiple Steps by clicking the <i>Run Simulation</i> Button. After this, currently per default 4 simulation steps per second are executed until you press the <i>Pause Simulation</i> Button. After you have paused a Simulation, you can continue step-wise or per Run-Button. If you want to be back to the precise step of the simulation, use <em>Step Back Button</em>.</p>
<p>However, as long as you don't have specified some input values and all inputs stay on <i>NoVal</i>, nothing will happen during the execution steps apart from default initial outputs that will appear. Hence, you should specify a value of an input port first before performing an execution step. To do so, go to the I/O View (e.g., of your top level component) and insert a valid input port value.</p>
<p>Currently, unfortunately AutoFOCUS3 provides no support for choosing valid input values. You can figure out valid inputs by first discover the type of the port in your Component or State Automaton Diagram (inside the Modeling Perspective) and then have a look into your <i>Data Dictionary</i> to identify valid type-values. E.g., if the type of your port is a Enumeration called "Signal" having an Enumeration Member called "Present", you have to insert "Present()" as input value.</p>
<p>You recognize the insertion of an invalid input value, because the <i>Invalid Type</i> Error Marker doesn't disappear. If you leave the edit field while an invalid value is inserted, the value is reset to the original value.</p>
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<img src="./pictures/Simulation.SetValue.png" />
<p> Most often, you want to induce the value into the Input-Port only once, therewith the input will be NoVal at the next step. In this case, let the <i>Hold</i>-Checkbox beside the input field unchecked and the value will be reset to NoVal automatically at the next step. If you want that the input value is induced to the Input-Port at every step, activate the <i>Hold</i>-Checkbox.</p>
</p>After you have inserted such an input value, the value of the respective channel in the diagram will change from NoVal to your inserted value.</p>
<img src="./pictures/Simulation.Step1.png" />
<p>Now, you might press the <i>Simulation Step</i> Button <img src="./pictures/Simulation.step.png" />. Because component <i>Merge</i> is weak-causal, the input value is directly influencing the output value at the same step, <i>channelReq</i> becomes also <i>Present</i>.</p>
<p>You can simulate an entire simulation sequence by performing the multiple simulations steps or pressing the Run-Button <img src="./pictures/Simulation.run.png" />. During this, you can obtain the behavior of your component (as black box view) by observing the values of the output ports or the channels. Hint: You cannot insert I/O values while the simulation is running. Please pause the simulation in order to input some values.</p>
<img src="./pictures/Simulation.Step2.png" />
<p>If all ports are valued with NoVal, this does not necessarily mean that the simulation sequence is over. Instead, the components might execute steps of their state automatons without doing some outputs. Hence, you should have a look to the state automatons also during the simulations.</p>
<h5>imulation of State Automatons</h5>
<p>During simulation of State Automatons, the currently active state is marked in orange color while all other states are blue.</p>
<p>If your State Automaton has <i>Data State Variables</i> (DSV) and a Guard of an outgoing transition of the currently active state contains such a DSV, you should also have a look at the <i>Data State View</i> to observe the values of the DSVs.</p>
<img src="./pictures/Simulation.StateAutomata.png" />
<p> Only if all state automatons are waiting for input values (inside the guards of all outgoing transitions of all active states) and all ports are valued with NoVal, the simulation sequence is over and you should insert new input values.</p>
<p>You can also reset simulations to their initial state by clicking on the red <i>Reset Simulation</i> Button <img src="./pictures/Simulation.reset.png" />.</p>
<h5>Simulation using Operator-Panels</h5>
<p>AutoFOCUS provides the possibility to add <a href="operatorpanels.html">Operator-Panels</a> to models in order to visualize model data during simulations as well as induce input data into the simulation. This is an alternative way to insert data in the I/O-Views.</p>
</div>
<script src="../layout/jsscript/topBtn.js">
</script>