Unit 5: State Machines in Python

In this unit, you will learn how to implement state machines in Python. Achieving this is valuable for several reasons:

  • You will be able to deepen your understanding about state machines in general.
  • You will be able to solve arbitrarily complex synchronization tasks in Python.
  • You will have a framework for the implementation during the semester project.

For the Semester Project

To have your code in sync with your state machine diagrams and handle concurrency in an effective way, you will program parts of your semester project using STMPY.

Preparation

Go through the following preparation material before we meet in class:

Teamwork on Monday

Go through the following activities with your team:

Questions and Answers

The STMPY library was indeed developed especially for this course. It's open source and you can use it also later on, but that is not the point. We use it here as a simplified framework for the purpose of learning. Once you master it, you can use other frameworks, or even structure your code in a suitable way without STMPY. So the point of using STMPY is not because you will use it later, but because it helps you learning.

Remember the blog post we recommended you to read. Sometimes you find out that you need a state machine after it's too late. We want you to understand how to handle concurrent behavior using state machines. Once you have learned that, you can master other frameworks and concepts to handle it.

Concluding this Unit

Please clean up the room after you. Remove any trash or paper.

Team Reflection

  • Add another section to the team reflection document, just like last week.
  • How did the roles work today?

Individual Reflection

To conclude a unit, fill out the individual reflection. Also, make notes about ny observations, which will help you for the reflective essay at the end of the semester.

If the form does not open properly or you get an error message, try right-clicking the link and opening it in a new tab or window.

Edit this page