void IzhikevichBranch::update(nest::Time const & origin, const nest::long_t from, const nest::long_t to) {

    assert(to >= 0 && (nest::delay) from < nest::Scheduler::get_min_delay());
    assert(from < to);

    nest::long_t current_steps = origin.get_steps();

    for (nest::long_t lag = from; lag < to; ++lag) {

        /***** Solve ODE over timestep *****/
        B_.current_regime->step_ode();

        /***** Transition handling *****/
        // Get multiplicity incoming events for the current lag and reset multiplicity of outgoing events
        refresh_events(lag);
        
        Transition_* transition;
        int simultaneous_transition_count = 0;
        double prev_t = origin.get_ms();
        while ((transition = B_.current_regime->transition(origin, lag))) {  // Check for a transition (i.e. the output of current_regime->transition is not NULL) and record it in the 'transition' variable.
            double t = transition->time_occurred(origin, lag);  // Get the exact time the transition occurred.
            if (t == prev_t)
                ++simultaneous_transition_count;
            else
                simultaneous_transition_count = 0;
            if (simultaneous_transition_count > MAX_SIMULTANEOUS_TRANSITIONS)
                throw ExceededMaximumSimultaneousTransitions("IzhikevichBranch", simultaneous_transition_count, t);
            bool discontinuous = transition->body(t) || (transition->get_target_regime() != B_.current_regime);
            B_.current_regime = transition->get_target_regime();
            B_.current_regime->set_triggers(t);
            if (discontinuous)
                B_.current_regime->init_solver();  // Reset the solver if the transition contains state assignments or switches to a new regime.
        }
        
        
        /***** Send output events for each event send port *****/
        // FIXME: Need to specify different output ports in a way that can be read by the receiving nodes
        // Output events        
        if (B_.num_spike_events) {
		    set_spiketime(nest::Time::step(origin.get_steps()+lag+1));
		    nest::SpikeEvent se;
		    se.set_multiplicity(B_.num_spike_events);
		    network()->send(*this, se, lag); 
        }

        /***** Get analog port values *****/
        B_.Isyn_value = B_.Isyn_analog_port.get_value(lag);

        /***** Record data *****/
        B_.logger_.record_data(current_steps + lag);
    }
}
Beispiel #2
0
/**
 * \brief Re-read the status of all keys.
 * \pre The caller is an instance of bear::input::system.
 */
void bear::input::keyboard::refresh()
{
  refresh_events();
  refresh_keys();
} // keyboard::refresh()
Beispiel #3
0
G_MODULE_EXPORT void on_reload_configuration1_activate(GtkWidget *wiggy, gpointer data)
{
	refresh_events();
}