Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Ex 1. Simulate a smart home system. Sensors send sensor events to a central hub. Each sensor event has a timestamp, severity, type, and location.
Ex 1. Simulate a smart home system. Sensors send sensor events to a central hub. Each sensor event has a timestamp, severity, type, and location. Notification worker threads consume events from the central hub. If the severity of the sensor event is low, the event is logged (written to disk), if the severity is high, the notification agent raises an alarm (prints to the error console). In main test, the program with 5 sensors and 3 workers. Ex 2. Modify the previous problem to use a factory method for the new sensor types you want to create. Use the observer model. Post an alert if there is an alert. Simulate this situation.
I need this solved in SCALA programming language
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started