{# NEST synaptic event transient template This template defines C++ methods of the form: int modelName::synapticEvent_transients (long_t lag) These methods update the synaptic states when a spike is received. They are invoked by the event handling portion of the update method, which is generated by template "NEST-solver-events.tmpl". Template variables are: - modelName: the name of the current system - synapticEventDefs - a list of synaptic event objects that have the following fields: - pscName - descriptive name (label) of the post-synaptic conductance component - pscId - unique identifier of the post-synaptic conductance component - localVars - local variables used in the state update equations - eventVarEqDef - the equation that assigns the event variable its value (currently, this is the equation that reads the synaptic weight from the event queue) - eventVar - the name of the variable the receives the event argument (e.g. weight) - externalEventEqDef - the equations that assigns values to any imported quantities, e.g. voltage - transientEventEqDefs - the equations that update the synaptic states #} {% for synapticEvent in synapticEventDefs %} inline int {{modelName}}::{{synapticEvent.pscName}}_transients (long_t lag) { {% if (not (synapticEvent.localVars == [])) %} double {{synapticEvent.localVars | join(", ")}}; {% endif %} {{synapticEvent.eventVarEqDef}} if ({{synapticEvent.eventVar}} > 0.0) { {{synapticEvent.externalEventEqDef}} {% for eq in synapticEvent.transientEventEqDefs %} {{eq}} {% endfor %} return 1; } return 0; } {% endfor %}