1: Procedure  LOADBALANCE()
2:   discoverMobileAgents()
3:  if ( ) then
4:   optimizeTaskThroughput( )     ⊳ Algorithm 2
5:   optimizeNumberOfAgents( )       Algorithm 3
6:  else
7:   optimizeResourceUtilization( )    ⊳ Algorithm 4
8:  end if
9: end procedure
Algorithm 1: Load-balancing procedure to reduce the work load of an agent. : list containing mobile agent identifiers, : CPU load on the current host, and : predefined CPU threshold.