The assignment is divided into two points, relating to concurrent programming based on the exchange of messages, using as a reference paradigm that of actors, in the concentrated and in the distributed.
Implement a task solution of the problem described in assignment #01, maintaining the subdivision in the two points:
- without GUI, to make a comparison at the performance level (doing the same tests carried out in assignment #01 and making a comparison with those results too).
- with GUI
Adopting an actor-based approach, employing, on the one hand, design principles and methods useful for promoting modularity, encapsulation and relative properties, and on the other a solution that maximizes performance and responsiveness.
Create a distributed application that aims to monitor possible flooding in a smart city. For this purpose, a certain (predetermined) number of “smart things” are installed in the city that perceive some environmental data. In particular, several rain gauges have the objective of controlling the level of rainfall (expressed in mm ^ 3) in a certain time interval. A rain gauge is placed in a certain position (for simplicity, in a flat space of two dimensions). The city is divided into (predefined) zones and each rain gauge operates in only one zone. For simplicity, the area of the city is considered as a rectangle WxH placed in a Euclidean space. The zones must completely cover the area of the city (there cannot be a portion of the space not managed by the system). For simplicity, in this case it is assumed that the rectangle is subdivided following a CxR grid. Optional advanced for those who want, spatial divisions can be considered based on the number of nodes (each area can contain a maximum of three devices) The rain gauges must go into an alarm condition when the majority of the sensors in a certain area perceive a value above a certain (predetermined) threshold. Even if the total number of rain gauges is fixed, any of them can fail, so the majority for a certain area can change over time. When the area is in alarm, the system must alert one of the nearby fire stations to the alarm generated. The same barracks can manage at most one alarm. For simplicity, each zone has a fire station. The alarm generated by the sensors can only be disabled by a fire station (so even if the perceptions return below the threshold, the alarm in a certain area must remain active). Finally, firefighters have access to an application (with GUI) through which they can:
- view the status of the zones (ok/alarm/under management)
- view the number of sensors in a certain area
- view the status of the barracks (free, occupied)
- disable alarms