Skip to content

Commit

Permalink
Renamings: I_sum -> curr_sum, Cond_sum -> cond_sum
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPlotnikov committed Nov 29, 2016
1 parent 2f5f30c commit eeaac2e
Show file tree
Hide file tree
Showing 48 changed files with 91 additions and 90 deletions.
4 changes: 2 additions & 2 deletions models/aeif_cond_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ neuron aeif_cond_alpha_neuron:
# Add aliases to simplify the equation definition of V_m
exp_arg real = (V_m-V_th)/delta_T
I_spike pA = delta_T*exp(exp_arg)
I_syn_exc pA = Cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikesInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikesInh) * ( V_m - E_in )

V_m' = ( -g_L * ( ( V_m - E_L ) - I_spike ) - I_syn_exc - I_syn_inh - w + I_e + I_stim ) / C_m
w' = (a*(V_m - E_L) - w)/tau_w
Expand Down
4 changes: 2 additions & 2 deletions models/aeif_cond_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ neuron aeif_cond_alpha_implicit:
# Add aliases to simplify the equation definition of V_m
exp_arg real = (V_m-V_th)/delta_T
I_spike pA = delta_T*exp(exp_arg)
I_syn_exc pA = Cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikesInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikesInh) * ( V_m - E_in )

V_m' = ( -g_L * ( ( V_m - E_L ) - I_spike ) - I_syn_exc - I_syn_inh - w + I_e + I_stim ) / C_m

Expand Down
4 changes: 2 additions & 2 deletions models/aeif_cond_exp.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ neuron aeif_cond_exp_neuron:
# Add aliases to simplify the equation definition of V_m
exp_arg real = (V_m-V_th)/delta_T
I_spike pA = delta_T*exp(exp_arg)
I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )

V_m' = ( -g_L * ( ( V_m - E_L ) - I_spike ) - I_syn_exc - I_syn_inh - w + I_e + I_stim ) / C_m
w' = (a*(V_m - E_L) - w)/tau_w
Expand Down
4 changes: 2 additions & 2 deletions models/aeif_cond_exp_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ neuron aeif_cond_exp_implicit:
# Add aliases to simplify the equation definition of V_m
exp_arg real = (V_m-V_th)/delta_T
I_spike pA = delta_T*exp(exp_arg)
I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )

V_m' = ( -g_L * ( ( V_m - E_L ) - I_spike ) - I_syn_exc - I_syn_inh - w + I_e + I_stim ) / C_m
end
Expand Down
4 changes: 2 additions & 2 deletions models/hh_cond_exp_traub.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ neuron hh_cond_exp_traub_neuron:
I_Na pA = g_Na * Act_m * Act_m * Act_m * Act_h * ( V_m - E_Na )
I_K pA = g_K * Inact_n * Inact_n * Inact_n * Inact_n * ( V_m - E_K )
I_L pA = g_L * ( V_m - E_L )
I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )

shape g_in = exp(-1/tau_syn_in*t)
shape g_ex = exp(-1/tau_syn_ex*t)
Expand Down
4 changes: 2 additions & 2 deletions models/hh_cond_exp_traub_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ neuron hh_cond_exp_traub_implicit:
I_Na pA = g_Na * Act_m * Act_m * Act_m * Act_h * ( V_m - E_Na )
I_K pA = g_K * Inact_n * Inact_n * Inact_n * Inact_n * ( V_m - E_K )
I_L pA = g_L * ( V_m - E_L )
I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )

V_m' =( -I_Na - I_K - I_L - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m

Expand Down
4 changes: 2 additions & 2 deletions models/hh_psc_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ neuron hh_psc_alpha_neuron:
shape g_in = (e/tau_syn_in) * t * exp(-1/tau_syn_in*t)
shape g_ex = (e/tau_syn_ex) * t * exp(-1/tau_syn_ex*t)

I_syn_exc pA = I_sum(g_ex, spikeExc)
I_syn_inh pA = I_sum(g_in, spikeExc)
I_syn_exc pA = curr_sum(g_ex, spikeExc)
I_syn_inh pA = curr_sum(g_in, spikeExc)
I_Na pA = g_Na * Act_m * Act_m * Act_m * Act_h * ( V_m - E_Na )
I_K pA = g_K * Inact_n * Inact_n * Inact_n * Inact_n * ( V_m - E_K )
I_L pA = g_L * ( V_m - E_L )
Expand Down
4 changes: 2 additions & 2 deletions models/hh_psc_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ neuron hh_psc_alpha_implicit:
g_in'' = -g_in' / tau_syn_in
g_in' = g_in' - ( g_in / tau_syn_in )

I_syn_exc pA = I_sum(g_ex, spikeExc)
I_syn_inh pA = I_sum(g_in, spikeExc)
I_syn_exc pA = curr_sum(g_ex, spikeExc)
I_syn_inh pA = curr_sum(g_in, spikeExc)
I_Na pA = g_Na * Act_m * Act_m * Act_m * Act_h * ( V_m - E_Na )
I_K pA = g_K * Inact_n * Inact_n * Inact_n * Inact_n * ( V_m - E_K )
I_L pA = g_L * ( V_m - E_L )
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_chxk_2008_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ neuron iaf_chxk_2008_implicit:
G_ahp'' = -G_ahp' / tau_ahp
G_ahp' = G_ahp' - G_ahp / tau_ahp

I_syn_exc pA = Cond_sum(g_ex, spikesInh) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikesExc) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikesInh) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikesExc) * ( V_m - E_in )
I_ahp pA = G_ahp * ( V_m - E_ahp )
I_leak pA = g_L * ( V_m - E_L )

Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ neuron iaf_cond_alpha_neuron:
shape g_in = (e/tau_syn_in) * t * exp(-1/tau_syn_in*t)
shape g_ex = (e/tau_syn_ex) * t * exp(-1/tau_syn_ex*t)

I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_leak pA = g_L * ( V_m - E_L )

V_m' = ( -I_leak - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ neuron iaf_cond_alpha_implicit:
g_ex'' = -g_ex'/tau_syn_ex
g_ex' = g_ex' -g_ex/tau_syn_ex

I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_leak pA = g_L * ( V_m - E_L )

V_m' = ( -I_leak - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_beta.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ neuron iaf_cond_beta_neuron:
GE'' = -GE'/tau_syn_rise_E
GE' = GE' -GE/tau_syn_decay_E

I_syn_exc pA = (F_E + Cond_sum(GE, spikeExc)) * ( V_m - E_ex )
I_syn_inh pA = (F_I + Cond_sum(GI, spikeInh)) * ( V_m - E_in )
I_syn_exc pA = (F_E + cond_sum(GE, spikeExc)) * ( V_m - E_ex )
I_syn_inh pA = (F_I + cond_sum(GI, spikeInh)) * ( V_m - E_in )
I_leak pA = g_L * ( V_m - E_L ) # pa = nS * mV
V_m' = (-I_leak - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m
end
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_exp.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ neuron iaf_cond_exp_neuron:
shape g_in = exp(-1/tau_syn_in*t) # inputs from the inh conductance
shape g_ex = exp(-1/tau_syn_ex*t) # inputs from the exc conductance

I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_leak pA = g_L * ( V_m - E_L )
V_m' = ( -I_leak - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m
end
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_exp_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ neuron iaf_cond_exp_implicit:
g_in' = -g_in/tau_synI
g_ex' = -g_ex/tau_synE

I_syn_exc pA = Cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikeExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikeInh) * ( V_m - E_in )
I_leak pA = g_L * ( V_m - E_L )
V_m' = ( -I_leak - I_syn_exc - I_syn_inh + I_stim + I_e ) / C_m
end
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_cond_exp_sfa_rr_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ neuron iaf_cond_exp_sfa_rr_implicit:
g_sfa' = -g_sfa / tau_sfa
g_rr' = g_rr / tau_rr

I_syn_exc pA = Cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = Cond_sum(g_in, spikesInh) * ( V_m - E_in )
I_syn_exc pA = cond_sum(g_ex, spikesExc) * ( V_m - E_ex )
I_syn_inh pA = cond_sum(g_in, spikesInh) * ( V_m - E_in )
I_L pA = g_L * ( V_m - E_L )
I_sfa pA = g_sfa * ( V_m - E_sfa )
I_rr pA = g_rr * ( V_m - E_rr )
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_neuron.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ neuron iaf_neuron_nestml:
# Declarative description of the updates rules
equations:
shape G = (e/tau_syn) * t * exp(-1/tau_syn*t)
V_abs' = -1/Tau * V_abs + 1/C_m * (I_sum(G, spikes) + I_e + currents)
V_abs' = -1/Tau * V_abs + 1/C_m * (curr_sum(G, spikes) + I_e + currents)
end

# these parameter are adjusted from outside
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ neuron iaf_psc_alpha_neuron:
shape I_shape_in = (e/tau_syn_in) * t * exp(-1/tau_syn_in*t)
shape I_shape_ex = (e/tau_syn_ex) * t * exp(-1/tau_syn_ex*t)

V_abs' = -1/Tau * V_abs + 1/C_m * (I_sum(I_shape_in, in_spikes) + I_sum(I_shape_ex, ex_spikes) + I_e + currents)
V_abs' = -1/Tau * V_abs + 1/C_m * (curr_sum(I_shape_in, in_spikes) + curr_sum(I_shape_ex, ex_spikes) + I_e + currents)
end

parameters:
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_alpha_multisynapse.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ neuron iaf_psc_alpha_multisynapse_neuron:

equations:
shape I_shape = (e/tau_syn) * t * exp(-1/tau_syn*t)
V_abs' = -1/tau_m * V_abs + 1/C_m * (I_sum(I_shape, spikes) + I_e + currents)
V_abs' = -1/tau_m * V_abs + 1/C_m * (curr_sum(I_shape, spikes) + I_e + currents)
end

parameters:
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_delta.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ neuron iaf_psc_delta_neuron:

equations:
shape G = delta(t, tau_m)
V_abs' = -1/tau_m * V_abs + 1/C_m * (I_sum(G, spikes) + I_e + currents)
V_abs' = -1/tau_m * V_abs + 1/C_m * (curr_sum(G, spikes) + I_e + currents)
end

parameters:
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_exp.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ neuron iaf_psc_exp_neuron:
equations:
shape I_shape_in = exp(-1/tau_syn_in*t)
shape I_shape_ex = exp(-1/tau_syn_ex*t)
I_syn mV = (I_sum(I_shape_in, in_spikes) + I_sum(I_shape_ex, ex_spikes) + I_e + currents)
I_syn mV = (curr_sum(I_shape_in, in_spikes) + curr_sum(I_shape_ex, ex_spikes) + I_e + currents)
V_abs' = -1/tau_m * V_abs + 1/C_m * I_syn
end

Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_exp_multisynapse.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ neuron iaf_psc_exp_multisynapse_neuron:

equations:
shape I_shape = exp(-1/tau_syn*t)
I_syn pA = (I_sum(I_shape, spikes) + I_e + currents)
I_syn pA = (curr_sum(I_shape, spikes) + I_e + currents)
V_abs' = -1/tau_m * V_abs + 1/C_m * I_syn
end

Expand Down
2 changes: 1 addition & 1 deletion models/iaf_tum_2000.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ neuron iaf_tum_2000_neuron:
equations:
shape I_shape_in = exp(-1/tau_syn_in*t)
shape I_shape_ex = exp(-1/tau_syn_ex*t)
I_syn pA = (I_sum(I_shape_in, in_spikes) + I_sum(I_shape_ex, ex_spikes) + I_e + currents)
I_syn pA = (curr_sum(I_shape_in, in_spikes) + curr_sum(I_shape_ex, ex_spikes) + I_e + currents)
V_m' = -1/tau_m * V_m + 1/C_m * I_syn
end

Expand Down
2 changes: 1 addition & 1 deletion models/mat2_psc_exp.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ neuron mat2_psc_exp_neuron:

# V_th_alpha_1' = -V_th_alpha_1/tau_1
# V_th_alpha_2' = -V_th_alpha_2/tau_2
I_syn pA = (I_sum(I_shape_in, in_spikes) + I_sum(I_shape_ex, ex_spikes) + I_e + currents)
I_syn pA = (curr_sum(I_shape_in, in_spikes) + curr_sum(I_shape_ex, ex_spikes) + I_e + currents)
V_abs' = -1/tau_m * V_abs + 1/C_m * I_syn
end

Expand Down
4 changes: 2 additions & 2 deletions models/terub_neuron_gpe.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ neuron terub_neuron_gpe:
g_k_Ca real = 15.0 #Report:15, Terman Rubin 2002: 20.0
g_k1 real = 30.0

I_ex_mod real = -I_sum(g_ex, spikeExc) * V_m
I_in_mod real = I_sum(g_in, spikeInh) * (V_m-E_gg)
I_ex_mod real = -curr_sum(g_ex, spikeExc) * V_m
I_in_mod real = curr_sum(g_in, spikeInh) * (V_m-E_gg)

tau_n real = g_tau_n_0 + g_tau_n_1 / (1. + exp(-(V_m-g_theta_n_tau)/g_sigma_n_tau))
tau_h real = g_tau_h_0 + g_tau_h_1 / (1. + exp(-(V_m-g_theta_h_tau)/g_sigma_h_tau))
Expand Down
4 changes: 2 additions & 2 deletions models/terub_neuron_stn.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ neuron terub_neuron_stn:
k_Ca real = 22.5
k1 real = 15.0

I_ex_mod pA = -I_sum(g_ex,spikeExc)*V_m
I_in_mod pA = I_sum(g_in, spikeInh) * (V_m-E_gs)
I_ex_mod pA = -curr_sum(g_ex,spikeExc)*V_m
I_in_mod pA = curr_sum(g_in, spikeInh) * (V_m-E_gs)

tau_n mV = tau_n_0 + tau_n_1 / (1. + exp(-(V_m-theta_n_tau)/sigma_n_tau))
tau_h mV = tau_h_0 + tau_h_1 / (1. + exp(-(V_m-theta_h_tau)/sigma_h_tau))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void addPropagatorStep(ASTNeuron astNeuron, Path propagatorStepFile) {

final List<ASTFunctionCall> i_sumCalls = AstUtils.getAll(astNeuron.getBody().getODEBlock().get(), ASTFunctionCall.class)
.stream()
.filter(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.I_SUM))
.filter(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.CURR_SUM))
.collect(toList());

// Apply spikes from the buffer to the state variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static List<ASTFunctionCall> get_sumFunctionCalls(final ASTNode workingCopy) {
return AstUtils.getAll(workingCopy, ASTFunctionCall.class)
.stream()
.filter(astFunctionCall ->
astFunctionCall.getCalleeName().equals(PredefinedFunctions.I_SUM) ||
astFunctionCall.getCalleeName().equals(PredefinedFunctions.CURR_SUM) ||
astFunctionCall.getCalleeName().equals(PredefinedFunctions.COND_SUM))
.collect(Collectors.toList());
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/nest/nestml/_cocos/NestmlErrorStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ String getErrorMsgGeneratedFunctionDefined(GetterSetterFunctionNames coco,
+ " there is a variable called '" + variableName + "'.";
}

String getErrorMsg(I_SumHasCorrectParameter coco, String expression) {
return I_SumHasCorrectParameter.ERROR_CODE + ":" + "The arguments of the I_sum must be atomic expressions: "
+ "e.g. V_m and not : " + expression;
String getErrorMsg(SumHasCorrectParameter coco, String expression) {
return SumHasCorrectParameter.ERROR_CODE + ":" + "The arguments of the I_sum must be atomic expressions: "
+ "e.g. V_m and not : " + expression;
}

String getErrorMsg(InvalidTypesInDeclaration coco, String typeName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
import java.util.List;

import static java.util.stream.Collectors.toList;
import static org.nest.symboltable.predefined.PredefinedFunctions.I_SUM;
import static org.nest.symboltable.predefined.PredefinedFunctions.COND_SUM;
import static org.nest.symboltable.predefined.PredefinedFunctions.CURR_SUM;

/**
* This class ensures that I_sum(I,Buffer) gets only simple expression
* This class ensures that curr_sum(I,Buffer) gets only simple expression
*
* @author plotnikov
*/
public class I_SumHasCorrectParameter implements ODEASTOdeDeclarationCoCo {
public final static String ERROR_CODE = "NESTML_" + I_SumHasCorrectParameter.class.getSimpleName();
public class SumHasCorrectParameter implements ODEASTOdeDeclarationCoCo {
public final static String ERROR_CODE = "NESTML_" + SumHasCorrectParameter.class.getSimpleName();

@Override
public void check(final ASTOdeDeclaration odeDeclaration) {
final List<ASTFunctionCall> functions = AstUtils.getAll(odeDeclaration, ASTFunctionCall.class)
.stream()
.filter(astFunctionCall -> astFunctionCall.getCalleeName().equals(I_SUM))
.filter(astFunctionCall -> astFunctionCall.getCalleeName().equals(CURR_SUM) || astFunctionCall.getCalleeName().equals(COND_SUM))
.collect(toList());

for (final ASTFunctionCall functionCall:functions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ private void registerCocos() {
final VarHasTypeName varHasTypeName = new VarHasTypeName();
nestmlCoCoChecker.addCoCo(varHasTypeName);

final I_SumHasCorrectParameter i_sumHasCorrectParameter = new I_SumHasCorrectParameter();
nestmlCoCoChecker.addCoCo(i_sumHasCorrectParameter);
final SumHasCorrectParameter _sumHasCorrectParameter = new SumHasCorrectParameter();
nestmlCoCoChecker.addCoCo(_sumHasCorrectParameter);

final EquationsOnlyForStateVariables equationsOnlyForStateVariables = new EquationsOnlyForStateVariables();
nestmlCoCoChecker.addCoCo(equationsOnlyForStateVariables);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class PredefinedFunctions {
public static final String DELTA = "delta";
private static final String MAX = "max";
public static final String INTEGRATE_ODES = "integrate_odes";
public static final String I_SUM = "I_sum";
public static final String COND_SUM = "Cond_sum";
public static final String CURR_SUM = "curr_sum";
public static final String COND_SUM = "cond_sum";


private static final Map<String, MethodSymbol> name2FunctionSymbol = Maps.newHashMap();
Expand Down Expand Up @@ -124,11 +124,11 @@ public class PredefinedFunctions {
integrate.setReturnType(getVoidType());
name2FunctionSymbol.put(INTEGRATE_ODES, integrate);

final MethodSymbol i_sum = createFunctionSymbol(I_SUM);
final MethodSymbol i_sum = createFunctionSymbol(CURR_SUM);
i_sum.addParameterType(getType("pA"));
i_sum.addParameterType(getBufferType());
i_sum.setReturnType(getType("pA"));
name2FunctionSymbol.put(I_SUM, i_sum);
name2FunctionSymbol.put(CURR_SUM, i_sum);

final MethodSymbol cond_sum = createFunctionSymbol(COND_SUM);
cond_sum.addParameterType(getType("nS"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ public void generateSymPySolverForCondImplicitModel() throws IOException {
@Test
public void testReplacement() throws IOException {
final NESTMLParser p = new NESTMLParser(TEST_MODEL_PATH);
final String ODE_DECLARATION = "V' = -1/Tau * V + 1/C_m * (I_sum(G, spikes) + I_e + ext_currents)";
final String ODE_DECLARATION = "V' = -1/Tau * V + 1/C_m * (curr_sum(G, spikes) + I_e + ext_currents)";
final Optional<ASTEquation> ode = p.parseEquation(new StringReader(ODE_DECLARATION));
assertTrue(ode.isPresent());

boolean i_sum = AstUtils.getAll(ode.get(), ASTFunctionCall.class)
.stream()
.anyMatch(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.I_SUM));
.anyMatch(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.CURR_SUM));
assertTrue(i_sum);

final ASTEquation testant = ODETransformer.replaceSumCalls(ode.get());
i_sum = AstUtils.getAll(testant, ASTFunctionCall.class)
.stream()
.anyMatch(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.I_SUM));
.anyMatch(astFunctionCall -> astFunctionCall.getCalleeName().equals(PredefinedFunctions.CURR_SUM));
assertFalse(i_sum);
}

Expand Down
Loading

0 comments on commit eeaac2e

Please sign in to comment.