Skip to main content
. 2025 Apr 9;25(8):2375. doi: 10.3390/s25082375
Algorithm 1 Dynamic Power Management
  Inputs:
              switches[]: an array of all switches in the network
              spine_switch_type: an integer index that differentiates the spine switch role from the leaf and AGF types
              switch_interface_states: a dictionary mapping each switch with the current interface state (activated/deactivated)
              spine_start, spine_end: integer indices defining the range of spine switches
  Procedure:
1   for sw in switches:
2             if readRegister(sw, “switch_type”) == spine_switch_type:
3                  continue
4             required_spine_switches = readRegister(sw, “spine_switches”)
5             if required_spine_switches == spine_end:
6                   for i in range(spine_start, spine_end):
7                         update_switch_interfaces(switches[i], On, switch_interface_states)
8             else
9                   for i in range(spine_start, spine_end):
10                       neededCount = spine_start + required_spine_switches
11                       if i >= neededCount:
12                               update_switch_interfaces(switches[i], Off, switch_interface_states)
13                       else
14                               update_switch_interfaces(switches[i], On, switch_interface_states)