set_paras.py 1.0 KB

12345678910111213141516171819202122232425262728
  1. import sys, os, shutil
  2. sys.path.append("/home/vangogh/software/FuzzScene/code/")
  3. import Constants
  4. operator_flag = sys.argv[1]
  5. radar_rand_time = sys.argv[2]
  6. seed_num = sys.argv[3]
  7. model_num = sys.argv[4]
  8. model_arr = sys.argv[5]
  9. clear_output = sys.argv[6]
  10. print("[" + os.path.basename(__file__) + ", Line " + str(sys._getframe().f_lineno) + ", " + sys._getframe().f_code.co_name + "] ", "operator_flag: ", operator_flag, "radar_rand_time: ", radar_rand_time, "seed_num: ", seed_num, "model_num: ", model_num, "model_arr: ", model_arr, "clear_output: ", clear_output)
  11. f = open(Constants.CONSTANTS_PATH, "r+")
  12. new = []
  13. for line in f:
  14. new.append(line)
  15. f.close()
  16. new[1] = 'OPERATOR_FLAG = ' + operator_flag + '\n'
  17. new[2] = 'RADAR_RAND_TIME = ' + radar_rand_time + '\n'
  18. new[3] = 'SEED_NUM = ' + seed_num + '\n'
  19. new[4] = 'MODEL_NUM = ' + model_num + '\n'
  20. new[5] = 'MODEL_ARR = ' + model_arr + '\n'
  21. new[6] = 'CLEAR_OUTPUT = ' + clear_output + '\n'
  22. f = open(Constants.CONSTANTS_PATH, "w+")
  23. for n in new:
  24. f.write(n)
  25. f.close()