Coder Social home page Coder Social logo

d610f20 / random-activitygen-py Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 5.0 66.45 MB

method for generating realistic scenarios for SUMO's ACTIVITYGEN

License: GNU General Public License v3.0

Python 99.40% Shell 0.60%
sumo statistics population osm traffic scenario schools generation

random-activitygen-py's People

Contributors

falkecarlsen avatar jenrik avatar mathiasmehl avatar niceastvillage avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

random-activitygen-py's Issues

Render curved roads

The render only creates straight roads, meaning that busstops/schools looks like they are placed outside of edges

ValueError in `position_on_edge` when running on large network

Running time python randomActivityGen.py -n in/aalborg_metro.net.xml -s in/aalborg_metro.stat.xml -o /out/aalborg_metro.stat.xml --verbose --display on OSM downloaded map of Aalborg metropolitan area.

Traceback (most recent call last):
  File "randomActivityGen.py", line 160, in <module>
    main()
  File "randomActivityGen.py", line 147, in main
    setup_bus_stops(net, stats, int(args["--bus-stop.distance"]), int(args["--bus-stop.k"]))
  File "randomActivityGen.py", line 92, in setup_bus_stops
    for i, busstop in enumerate(bus_stop_generator(edges, min_distance, min_distance*2, k, seeds=seed_bus_stops)):
  File "/home/user/projects/random-activitygen-py/bus.py", line 80, in bus_stop_generator
    point = next(filter(
  File "/home/user/projects/random-activitygen-py/utility.py", line 187, in firstn
    yield next(gen)
  File "/home/user/projects/random-activitygen-py/bus.py", line 24, in _road_point_generator
    pos = position_on_edge(road, remaining)
  File "/home/user/projects/random-activitygen-py/utility.py", line 126, in position_on_edge
    for coord1, coord2 in (edge.getShape()[i:i + 2] for i in range(0, int(len(edge.getShape())), 2)):
ValueError: not enough values to unpack (expected 2, got 1)

Save image rendered with --display

Maybe allow user to choose to save the image or not.
Save only the latest image overwriting previous iamges, perhaps name it netFile-statsFile so that it is easy to identify the files used to generate it.

Categorise log events by context

Instead of putting logs like the following:
logging.debug(f"Using begin_age: {begin_age}, end_age: {end_age} for school(s)")
We should categorise them, so it is easy to read through a long logfile and understand the context of each event:
logging.debug(f"[school] Using begin_age: {begin_age}, end_age: {end_age} for school(s)")
The above is just an idea but seems to work okay.

Ability to generate stats file from scratch

We currently assume that the user has a half-finished stats file. It case they don't we can probably automatically guestimate the number of inhabitants and number household etc. from the network's size. Other values can just be some default values to generate an average city.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.