Can I force an assigned variable to be an integer in NMODL
Posted: Thu Sep 15, 2011 10:11 am
I wrote the NMODL file below, which defines an artificial cell which counts spikes/events of all the NetCons connected to it and fires when it reaches a predefined value. The firing of this cell is used to halt the simulation and subsequently save the results to file.
It would be neat if the assigned variables `count' and the parameter `stopcount' were unsigned integers. Is there a way to achieve that?
It would be neat if the assigned variables `count' and the parameter `stopcount' were unsigned integers. Is there a way to achieve that?
Code: Select all
: networkcounter.mod
NEURON {
ARTIFICIAL_CELL NetCounter
RANGE count, stopcount
}
PARAMETER {
stopcount=1e9 (1) <0,1e9>
}
ASSIGNED {
count (1)
}
INITIAL {
count=0
}
NET_RECEIVE(w) {
count=count+1
if(count >= stopcount){
net_event(t)
}
}