Skip to content
Snippets Groups Projects
Commit c27757f9 authored by Ben Cumming's avatar Ben Cumming Committed by kabicm
Browse files

Fix event-generator bugs in model (#439)

There were two latent bugs in the event generation part of `model`.

1. A segmentation fault when initializing the `event_generators` in the `model` constructor caused by using an index variable after it had been incremented.
2. Events generated during the first epoch were not delivered on time.

The first issue was simple to fix, by ensuring that the coutning variable is incremented at the end of the loop.

The second issue required refactoring the event wrangling inside `model`. Events can be introduced into a model via three sources:

1. Generated by spike exchange
2. By calling the `model::inject_events()` interface
3. `event_generator`s attached to cells.

The refactoring was required to ensure that all three sources are handled correctly. There is further opportunities for refactoring the code to make it a bit cleaner, specifically putting the wrangling code in its own type that could be tested seperately, outside `model`, but that is beyond the scope of this fix. 
parent 51d09f7d
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment