Added condition to finish simulation of not having any job waiting in
any ResourceManager