1kastner / conflowgen

A generator for synthetic container flows at maritime container terminals with a focus on yard operations
MIT License
11 stars 7 forks source link

Make previews and especially analyses smarter - avoid unnecessary recalculation by caching #40

Closed 1kastner closed 1 year ago

1kastner commented 2 years ago

Currently, some previews and post-hoc analyses are re-calculated several times. This is because they are re-used for other previews or post-hoc analyses. For each of the reports, the code is re-executed which turns out expensive, e.g. it is iterated over all containers (there could be millions) several times to calculate the very same value. This should be avoided in a smart way. Be aware though that the API is meant to always report the true state. We can e.g. first generate the output data, run an analysis, re-run the generation process and run the analysis again. Thus, caching must be reset in once the underlying data is changed.

Ideas:

Alternative: Leave everything as it is because it is not too much time wasted. A bug that leads to reporting wrong numbers would be much worse than waiting for some seconds more to get the results.

1kastner commented 1 year ago

Solved by #183.