Event Generators
================

// Simplest generator: just do nothing
inline event_generator empty_generator(cell_local_label_type target, float weight) {
    return event_generator(std::move(target), weight, schedule());
}


// Generate events at integer multiples of dt that lie between tstart and tstop.
inline event_generator regular_generator(cell_local_label_type target,
                                         float weight,
                                         const units::quantity& tstart,
                                         const units::quantity& dt,
                                         const units::quantity& tstop=terminal_time*units::ms) {
    return event_generator(std::move(target), weight, regular_schedule(tstart, dt, tstop));
}

inline event_generator poisson_generator(cell_local_label_type target,
                                         float weight,
                                         const units::quantity& tstart,
                                         const units::quantity& rate_kHz,
                                         seed_type seed = default_seed,
                                         const units::quantity& tstop=terminal_time*units::ms) {
    return event_generator(std::move(target), weight, poisson_schedule(tstart, rate_kHz, seed, tstop));
}


// Generate events from a predefined sorted event sequence.
template<typename S> inline
event_generator explicit_generator(cell_local_label_type target,
                                   float weight,
                                   const S& s) {
    return event_generator(std::move(target), weight, explicit_schedule(s));
}

template<typename S> inline
event_generator explicit_generator_from_milliseconds(cell_local_label_type target,
                                                     float weight,
                                                     const S& s) {
    return event_generator(std::move(target), weight, explicit_schedule_from_milliseconds(s));
}
