18 _tmo(to),_delay(delay),_tol(tol)
22 float dlog = _widths.size()>1 ? (log(pmax)-log(pmin))/(_widths.size()-1) : 0;
23 for(
int i=0; i<_widths.size(); i++ ) {
24 _widths[i] = pmin*exp(dlog*i);
26 _ap =
new Bisect( 0, INFINITY, tol );
47 if( _ap->
update( curr, fire ) ){
48 std::cout << _widths[_currw] <<
" " << curr << std::endl;
49 _thresh[_currw++] = curr;
50 if( _currw == _thresh.size() )
54 _ap =
new Bisect( 0, INFINITY, _tol );
57 delete _tmo->
timers[doppind];
58 double ttime = _tmo->
time+_widths[_currw]+_delay;
60 delete _tmo->
timers[stimind];
69 ofs <<
"# stimDuration(ms) stimStrength(pA/pF)" << std::endl;
70 for(
int i=0; i<_widths.size(); i++ )
71 ofs << _widths[i] <<
" " << _thresh[i] << std::endl;
89 if( _init )
return true;
91 double ttime = _tmo->
time+_widths[0]+_delay;
92 delete _tmo->
timers[doppind];
94 delete _tmo->
timers[stimind];
bool update(float &val, bool success)
update search
Lapicque(opencarp::timer_manager *to, float pmin, float pmax, int np, float tol, float delay)
constructor
void print(std::ostream &)
bool init(int, int)
initial first step
bool check(bool fire, float &, int, int)
check if the Lapicque curve is finished and update current
centralize time managment and output triggering
void initialize_singlestep_timer(double tg, double idur, int ID, const char *iname, const char *poolname=nullptr)
std::vector< base_timer * > timers
vector containing individual timers