Outputs should cache two data pushes
Currently, data passed may depend on module order (see #75 (closed)).
The problem is that on pull, the last pushed data entry is returned. For modules that have synchronized time steps, the data returned differs depending on update order:
Source updated first:
source o-----o
.-'
target o
Here, the target gets data for the wrong time.
Target updated first:
source o
|
target o
Here, the target gets the data for the correct time.
As a solution, outputs should be able to hold the two most recent data pushes. On pull, the data with the timestamp closest to the pull time should be returned, instead of simply the last data pushed.
In the above example, the first data entry to the source would be retrieved in both cases.
Alternatively, we could consider a rule like returning only data for the requested time or earlier. Would still result in the correct behaviour in the above example. This could however be problematic fir timestamps of source and target very close, but not exactly matching.