Esempio n. 1
0
int main(){
  
  Rate rate_ext = 0;

  RateFunctor<double> input(Inp);
  RateFunctor<double> openlock(Opl);

  RateAlgorithm<double> alg_ext(rate_ext);

	WilsonCowanParameter par_wc;
	par_wc._f_bias        = 0;
	par_wc._f_noise       = 1.0;
	par_wc._rate_maximum  = 50;
	par_wc._time_membrane = 50e-3;
  

	WilsonCowanAlgorithm alg(par_wc);

	Network network;

	NodeId id_input = network.addNode(input, EXCITATORY_DIRECT);
	NodeId id_gate = network.addNode(alg, EXCITATORY_DIRECT);
	NodeId id_output = network.addNode(alg, EXCITATORY_DIRECT);
	NodeId id_lock = network.addNode(alg, INHIBITORY_DIRECT);
	NodeId id_openlock = network.addNode(openlock ,INHIBITORY_DIRECT);

	double weight = 1.0;

	network.makeFirstInputOfSecond(id_input, id_gate, weight);
	network.makeFirstInputOfSecond(id_input, id_lock, weight);
	network.makeFirstInputOfSecond(id_gate, id_output, weight);
	network.makeFirstInputOfSecond(id_lock, id_gate, -1*weight);
	network.makeFirstInputOfSecond(id_openlock, id_lock, -2*weight);

	MPILib::CanvasParameter par_canvas;
	par_canvas._state_min     = -0.020;
	par_canvas._state_max     = 0.020;
	par_canvas._t_min         = 0.0;
	par_canvas._t_max         = 2.0;
	par_canvas._f_min         = 0.0;
	par_canvas._f_max         = 50.0;
	par_canvas._dense_min     = 0.0;
	par_canvas._dense_max     = 200.0;



	MPILib::report::handler::RootReportHandler handler("singlepoptest", true, true, par_canvas );

	handler.addNodeToCanvas(id_input);
	handler.addNodeToCanvas(id_gate);
	handler.addNodeToCanvas(id_output);
	handler.addNodeToCanvas(id_lock);
	handler.addNodeToCanvas(id_openlock);

	const SimulationRunParameter
		par_run
		(
		  handler,
		  10000000,
		  0.0,
		  2.0,
	          1e-3,
		  1e-3,
		   "wilsom.log"
		);

	network.configureSimulation(par_run);
	network.evolve();

	return 0;
}
Esempio n. 2
0
int main(){

	cout << "Demonstrating Omurtag et al. (2000)" << endl;
	Number    n_bins = 500;
	Potential V_min  = 0.0;

	NeuronParameter
		par_neuron
		(
			1.0,
			0.0,
			0.0,
			0.0,
			50e-3
		);

	OdeParameter
		par_ode
		(
			n_bins,
			V_min,
			par_neuron,
			InitialDensityParameter(0.0,0.0)
		);

	double min_bin = 0.01;
	LifNeuralDynamics dyn(par_ode,min_bin);
	LeakingOdeSystem sys(dyn);
	GeomParameter par_geom(sys);
	GeomDelayAlg alg(par_geom);

	Rate rate_ext = 800.0;
	RateAlgorithm<MPILib::DelayedConnection> alg_ext(rate_ext);

	Network network;

	NodeId id_rate = network.addNode(alg_ext,EXCITATORY_DIRECT);
	NodeId id_alg  = network.addNode(alg,    EXCITATORY_DIRECT);

	MPILib::DelayedConnection con(1,0.03,0.0);
	network.makeFirstInputOfSecond(id_rate,id_alg,con);

	MPILib::report::handler::RootReportHandler handler("singlepoptest", true, true);
	handler.addNodeToCanvas(id_alg);

	const SimulationRunParameter
		par_run
		(
			handler,
			10000000,
			0.0,
			0.5,
			1e-3,
			1e-4,
			"singlepoptest.log"
		);

	network.configureSimulation(par_run);
	network.evolve();

	return 0;
}
Esempio n. 3
0
int main(){

	cout << "Demonstrating Quadratic-Integrate-and-Fire under jump response" << endl;
	Number    n_bins = 1000;
	Potential V_min  = -10.0;

	NeuronParameter
		par_neuron
		(
			10.0,
			-10.0,
			-10.0,
			0.0,
			10e-3
		);

	OdeParameter
		par_ode
		(
			n_bins,
			V_min,
			par_neuron,
			InitialDensityParameter(0.0,0.0)
		);


	GeomLib::QifParameter
	  par_qif
	  (
	    0.5, // 
	    0.5  // default gamma sys
	  );

	DiffusionParameter par_diffusion(0.03,0.03);
	CurrentCompensationParameter par_current(0.0,0.0);
	SpikingQifNeuralDynamics dyn(par_ode,par_qif);
	QifOdeSystem sys(dyn);
	GeomDelayAlg alg_qif(GeomParameter(sys,  par_diffusion, par_current));
      


	// Reproduce mu = 0.6, sigma = 0.7       
	Rate rate_ext = 6000;
	Efficacy h    = -8e-3;

	RateAlgorithm<MPILib::DelayedConnection> alg_ext(rate_ext);

	Network network;

	NodeId id_rate = network.addNode(alg_ext, MPILib::INHIBITORY_GAUSSIAN);
	NodeId id_alg  = network.addNode(alg_qif, MPILib::EXCITATORY_GAUSSIAN);

	MPILib::DelayedConnection con(1,h,0.0);
	network.makeFirstInputOfSecond(id_rate,id_alg,con);


	MPILib::CanvasParameter par_canvas;
	par_canvas._state_min     = -10.0;
	par_canvas._state_max     =  10.0;
	par_canvas._t_min         = 0.0;
	par_canvas._t_max         = 0.5;
	par_canvas._f_min         = 0.0;
	par_canvas._f_max         = 10.0;
	par_canvas._dense_min     = 0.0;
	par_canvas._dense_max     = 5.0;


	MPILib::report::handler::RootReportHandler handler("twopopcanvas.root", true, true, par_canvas);
	handler.addNodeToCanvas(id_alg);

      

	const SimulationRunParameter
		par_run
		(
			handler,
			10000000,
			0.0,
			0.5,
			2e-3,
			1e-4,
			"singlepoptest.log"
		);

	network.configureSimulation(par_run);
	network.evolve();

	return 0;
}