Skip to content
Snippets Groups Projects
Commit 016b5775 authored by Sam Yates's avatar Sam Yates
Browse files

Add option to specify synapse mechanism in miniapp.

* -S (--syntype) option passes argument through to
  synapse creation in `make_cell`.
parent bebe362a
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ namespace io {
cl_options read_options(int argc, char** argv) {
// set default options
const cl_options default_options{"", 1000, 500, 100, 100., 0.025, false};
const cl_options default_options{"", 1000, 500, "expsyn", 100, 100., 0.025, false};
cl_options options;
// parse command line arguments
......@@ -29,6 +29,9 @@ cl_options read_options(int argc, char** argv) {
TCLAP::ValueArg<uint32_t> nsynapses_arg(
"s", "nsynapses", "number of synapses per cell",
false, 500, "non negative integer");
TCLAP::ValueArg<std::string> syntype_arg(
"S", "syntype", "type of synapse (expsyn or exp2syn)",
false, "expsyn", "synapse type");
TCLAP::ValueArg<uint32_t> ncompartments_arg(
"c", "ncompartments", "number of compartments per segment",
false, 100, "non negative integer");
......@@ -46,6 +49,7 @@ cl_options read_options(int argc, char** argv) {
cmd.add(ncells_arg);
cmd.add(nsynapses_arg);
cmd.add(syntype_arg);
cmd.add(ncompartments_arg);
cmd.add(ifile_arg);
cmd.add(dt_arg);
......@@ -55,6 +59,7 @@ cl_options read_options(int argc, char** argv) {
options.cells = ncells_arg.getValue();
options.synapses_per_cell = nsynapses_arg.getValue();
options.syn_type = syntype_arg.getValue();
options.compartments_per_segment = ncompartments_arg.getValue();
options.ifname = ifile_arg.getValue();
options.tfinal = tfinal_arg.getValue();
......
......@@ -11,6 +11,7 @@ struct cl_options {
std::string ifname;
uint32_t cells;
uint32_t synapses_per_cell;
std::string syn_type;
uint32_t compartments_per_segment;
double tfinal;
double dt;
......
......@@ -191,7 +191,7 @@ namespace synapses {
///////////////////////////////////////
/// make a single abstract cell
mc::cell make_cell(int compartments_per_segment, int num_synapses);
mc::cell make_cell(int compartments_per_segment, int num_synapses, const std::string& syn_type);
/// do basic setup (initialize global state, print banner, etc)
void setup();
......@@ -277,7 +277,7 @@ void all_to_all_model(nest::mc::io::cl_options& options, model& m) {
// make a basic cell
auto basic_cell =
make_cell(options.compartments_per_segment, synapses_per_cell);
make_cell(options.compartments_per_segment, synapses_per_cell, options.syn_type);
auto num_domains = global_policy::size();
auto domain_id = global_policy::id();
......@@ -400,7 +400,7 @@ void setup() {
}
// make a high level cell description for use in simulation
mc::cell make_cell(int compartments_per_segment, int num_synapses) {
mc::cell make_cell(int compartments_per_segment, int num_synapses, const std::string& syn_type) {
nest::mc::cell cell;
// Soma with diameter 12.6157 um and HH channel
......@@ -425,7 +425,7 @@ mc::cell make_cell(int compartments_per_segment, int num_synapses) {
auto distribution = std::uniform_real_distribution<float>(0.f, 1.0f);
// distribute the synapses at random locations the terminal dendrites in a
// round robin manner
nest::mc::parameter_list syn_default("expsyn");
nest::mc::parameter_list syn_default(syn_type);
for (auto i=0; i<num_synapses; ++i) {
cell.add_synapse({2+(i%2), distribution(gen)}, syn_default);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment