Complete the code to define the main component that handles data flow in a SCADA system.
class SCADAController: def __init__(self): self.data_handler = [1]()
The DataHandler is the main component responsible for managing data flow in SCADA systems, so it fits best here.
Complete the code to add a method that scales the system by adding new nodes.
def add_node(self, node): if len(self.nodes) < [1]: self.nodes.append(node)
The system is designed to scale up to 50 nodes to maintain performance and reliability.
Fix the error in the method that balances load across nodes.
def balance_load(self): total_load = sum(node.load for node in self.nodes) average = total_load [1] len(self.nodes) for node in self.nodes: node.load = average
Using / performs floating-point division to calculate the average load correctly.
Fill both blanks to create a dictionary comprehension that maps node IDs to their status if the load is below threshold.
node_status = {node.id: node.status for node in self.nodes if node.load [1] [2]The condition node.load < 75 filters nodes with load below 75.
Fill all three blanks to create a dictionary comprehension that maps uppercase node names to their load if load is above threshold.
high_load_nodes = { [1]: [2] for node in self.nodes if node.load [3] 60 }This comprehension maps uppercase node names to their load when the load is greater than 60.