Bobbias
Member
I'd forgotten about the integer-as-state-identifier method. That works, but not always as well as you'd like. It works wonders in systems where each state is mutually exlusive. And of course, you can represent a system with various non-exclusive states by expanding the number of exclusive ones to involve all possible combinations, but that can get very messy and complex if your dealing with a number of states that can go on and off independant of a certain process (such as say, a washing machine that has to control the water temp by a simple "if too cold, heat up, if too hot, turn heater off" scenario, along with various the usual sequence of events). Of course, you could go for a hybred approach and have the heater control and wash cycle control have their own independant process controlling variables as well.
This is a good example of how there are plenty of different ways to go about this sort of thing, davidd31415.
This is a good example of how there are plenty of different ways to go about this sort of thing, davidd31415.