SHARE
TWEET

Untitled

a guest Jun 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def main():
  2.  
  3.     parser = argparse.ArgumentParser(description="Simulation of drivers' behavior")
  4.     parser.add_argument('-f', '--fleet',
  5.                         help='Fleet sizes to simulate, formatted as comma-separated list (i.e. "-f 250,275,300")')
  6.     parser.add_argument('-m', '--multiplier',
  7.                         help='Surge multiplier, formatted as comma-separated list (i.e. "-m 1,1.5,2")')
  8.  
  9.     args = parser.parse_args()
  10.     if args.fleet:
  11.         fleet_sizes = [int(x) for x in args.fleet.split(',')]
  12.     else:
  13.         fleet_sizes = FLEET_SIZE
  14.     if args.multiplier:
  15.         surges = [float(x) for x in args.multiplier.split(',')]
  16.     else:
  17.         surges = [SURGE_MULTIPLIER]
  18.      
  19. python script.py -f 1000, 1500 -m 1, 2
  20.      
  21. for i in {1000, 1500}; do python script.py -f i & done; done
  22.      
  23. ValueError: could not convert string to float: 'i'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top