arup-group / elara

Command line utility for processing MATSim events output files.
MIT License
13 stars 4 forks source link

Handler to calculate average speed by hour and link #80

Closed sarah-e-hayes closed 3 years ago

sarah-e-hayes commented 3 years ago

Seems to work reasonably well and gives the results I expect from the test sim! Might need some help writing a test for it though

sarah-e-hayes commented 3 years ago

The tests are cheating a little at the moment - I couldn't find where it's reading the set of events from so just asserted that it should return the value it is returning. I think they're deined ~ line 124 here but can't trace further back than that.


def events(test_config, test_paths):
    events = inputs.Events(test_config)
    events.build(test_paths.resources)
    return events.elems```

For duration calculations, assumed that if vehicle entering or leaving traffic (ie the first link of journey), then duration needs to be doubled to account for the fact agent is dropped halfway (?) along link and only travels half the distance.