public static int GetNumberOfBusyPes(this List <Host> hostList) { int numberOfBusyPes = 0; foreach (Host host in hostList) { numberOfBusyPes += PeList.GetNumberOfBusyPes(host.PeList); } return(numberOfBusyPes); }
public static Host GetHostWithFreePe(this List <Host> hostList, int pesNumber) { foreach (Host host in hostList) { if (PeList.GetNumberOfFreePes(host.PeList) >= pesNumber) { return(host); } } return(null); }