State Machines
Description
Course State Machines designed to explore the library’s capabilities "State Machines" platforms Engee. State Machines – This is a model of an event-driven system that switches from one mode of operation to another when certain conditions are met. Finite automata allow you to build two types of models: state diagrams and flowcharts.
Each section contains a theoretical part, practical examples and tasks for self-completion.
Knowledge requirements: completion of courses Welcome to Engee and Visual modeling.
Total course time: ~3 hours.
Course program
Introduction to State Machines.
Using the example of a traffic light model, an initial idea of the principles of working with finite automata in Engee.
State diagrams.
The construction of state diagrams, the state diagram editor, time logic and by default transitions are studied.
Variables and data in state diagrams.
Input and output signals and local variables on state diagrams are studied.
Actions on state diagrams.
Actions with entry, during, and exit states, as well as actions with conditions, are studied.
Execution of state diagrams.
The example describes in detail the step-by-step execution of the state diagram: how conditions, actions and transitions between states work.
Project: Robot vacuum cleaner.
Students are invited to use the state diagram to build a model of the operation of a robot vacuum cleaner, which can be in one of four states: off, cleaning, parking and charging.
Flowcharts.
The basics of building flowcharts are studied. As a practical task, it is proposed to build a model of an iterator that returns to one when the index reaches the maximum value.
Hierarchy of diagrams.
The construction of hierarchical diagrams of states is studied. As a practical task, it is proposed to construct a hierarchical diagram of states describing the operation of a traffic light.