Variable swim represents the state of the sign.
The agents Pump and Switch have been developed independently and use different variables to represent water level. They are renamed to the same variable level in order for them to interact properly. The pump has two states on and off , which maintain a steady rate of change for the water level. In addition, switching between the steady modes takes two units of time, during which the rate of level changes with time. This is implemented by two additional modes turnOff and turnOn and a clock timer .