![netlogo switch netlogo switch](https://ccl.northwestern.edu/netlogo/2.0/docs/images/interface/image002.gif)
If the room temperature is lower than the desired one, the thermostat switches on and starts heating the room (generating new agents) until the desired value is reached, then, it switches off. The controller is incorporated into the thermostat so it heats the room until a desired value is reached. This controller is kept simple: a bang–bang controller (on–off controller). If the system is put in closed loop, a controller starts acting.
![netlogo switch netlogo switch](https://silentinstallhq.com/wp-content/uploads/2021/01/NetLogo.jpg)
The thermostat measures the temperature as a function of the number of agents on its surface, applying a first order dynamics to take into account the inertia in the behaviour of the thermostat. If the system is put in open loop mode, the temperature (modelled through heat balls - agents that move around) would decrease through time as some of the agents would eventually leave the room through the walls, as there is a relation between the temperature measured by the thermostat and the density of agents. This model has been developed to illustrate the behaviour of the system in open loop as well as in closed loop through an ON-OFF controller.
![netlogo switch netlogo switch](https://ccl.northwestern.edu/netlogo/6.0.1/docs/images/tutorial1/file-menu.gif)
Revista Iberoamericana de Automática e Informática industrial (sent for publication). Modelado Basado en Agentes: un Enfoque desde la Ingeniería de Sistemas. It has been developed as an explanatory example for the work: Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL This model is an adaptation from the NetLogo Thermostat model: