Added end() function in network to terminate a simulation early