Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. # I am sorry that it seems there is not a short code to display since the same
  2. # problem does not pop up when simulate(input_args) is a simple or short
  3. # function. I cannot simply put my entire code here because it is two long:
  4. # simulation(timeHorizon) it self is 60+ lines long and it has dependency on
  5. # functions and classes which together take up almost 300 lines
  6.  
  7. myRecord = open('myRecord','w')
  8. myRecord.write('***n')
  9. myRecord.write('Here begins one simulation:n')
  10. for i in range(0,100):
  11. myRecord.write('round '+str(i)+':n')
  12. roundResult = simulate(Horizon_t,i) # returns [T,N,M,M_neo,D,D_neo]
  13. for item in roundResult:
  14. myRecord.write('--'+str(item)+'n')
  15. startAllOver() # reset global variables [T,N,M,M_neo,D,D_neo]
  16. myRecord.close()
  17.  
  18. # expected : every iteration gives a new random result
  19.  
  20. # reality: all iterations are the same
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement