Skip to content

Commit

Permalink
Updated computeStoppingPlaceUsage.py. Refs #8405
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Mar 24, 2021
1 parent fddd368 commit 1a84e2c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions tools/output/computeStoppingPlaceUsage.py
Expand Up @@ -31,21 +31,20 @@
import os,sys

def get_options(args=None):
optParser = optparse.OptionParser()
optParser.add_option("-o", "--stop-output-file", dest="stopOutput",
parser = sumolib.options.ArgumentParser(description="Compute Stopping Place usage")
parser.add_argument("-o", "--stop-output-file", dest="stopOutput",
help="output route file with stops")
optParser.add_option("-s", "--stopping-place", dest="stoppingPlace",
parser.add_argument("-s", "--stopping-place", dest="stoppingPlace",
help="stoppingPlace Type (busStop, parkingArea...)", default="parkingArea")
optParser.add_option("-c", "--csv", dest="csv",
help="write in CSV format", default="")
(options, args) = optParser.parse_args(args=args)
parser.add_argument("--csv", action="store_true", default=False,
help="write in CSV format")
options = parser.parse_args(args=args)
if not options.stopOutput:
optParser.print_help()
sys.exit()
return options



def main(options):
# declare veh counts
vehCounts = defaultdict(list)
Expand Down Expand Up @@ -84,10 +83,9 @@ def main(options):
outf.write("%s,%s\n" % (tPrev, count))
else:
outf.write(" <step time=\"%s\" number=\"%s\"/>\n" % (t, count))
if (options.csv == ""):
if (options.csv == False):
# close route tag
outf.write("</stoppingPlace>\n")

if __name__ == "__main__":
options = get_options(sys.argv)
main(options)
main(get_options())

0 comments on commit 1a84e2c

Please sign in to comment.