How to create a list of procedures
Posted: Mon Jun 20, 2011 1:18 am
I work on a detailed neuron model fitted to data and I want to build a list of functions and use it to make a dynamic init() function.
Every Channel in my model added to the model with a separate hoc file using a procedure. for example If I want to add HH to my model I make insert_hh.hoc file which contain a init_hh () function. advantage of this method is that I can add or remove mechanism with commenting the load_file("insert_??") at the beginning of the models main file. But to do this my init() function should be dynamic too.
I want a mechanism to update my init() function every time I add a new mechanism or remove a mechanism from the model. for example I'm thinking of a template which stores list of my init_??() functions. I can add a function to the list with template_name.add("function name") and run the list of functions with template_name.run().
1. is there any Class sth like this in the neuron?
2. if answer is no.
2.1 How can I make one myself?
2.2 Is there any array of strings at hoc level? if no how can I store a list of functions?
2.3 Is execute command proper for this job?
3. Is there any better way to do this other than what I propose?
Every Channel in my model added to the model with a separate hoc file using a procedure. for example If I want to add HH to my model I make insert_hh.hoc file which contain a init_hh () function. advantage of this method is that I can add or remove mechanism with commenting the load_file("insert_??") at the beginning of the models main file. But to do this my init() function should be dynamic too.
I want a mechanism to update my init() function every time I add a new mechanism or remove a mechanism from the model. for example I'm thinking of a template which stores list of my init_??() functions. I can add a function to the list with template_name.add("function name") and run the list of functions with template_name.run().
1. is there any Class sth like this in the neuron?
2. if answer is no.
2.1 How can I make one myself?
2.2 Is there any array of strings at hoc level? if no how can I store a list of functions?
2.3 Is execute command proper for this job?
3. Is there any better way to do this other than what I propose?