### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ###
##                    308-522 -- Modelling and Simulation
##                                  Fall 2002
##                             --- ASSIGNMENT 1 ---
##
## SIM_reset.py
##
## last modified: 09/24/02
### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ###

def reset(parentApp, model):
 if hasattr(model, "simulatorThread"):
   model.simulatorThread.stop()
 if hasattr(model, "simulator"):
   del model.__dict__["simulator"]


 if "data" in dir(model):
   model.data.clear()
 else:
   print "\nWarning: no simulator to reset"
   print "\n         ignoring request\n"

