12 #include "../builtins/Interpol2D.h"
32 "String for setting X index.",
37 "String for setting Y index.",
42 "String for setting Z index.",
62 "Bitmapped flag: bit 0 = Xgate, bit 1 = Ygate, bit 2 = Zgate"
63 "When true, specifies that the lookup table value should be"
64 "used directly as the state of the channel, rather than used"
65 "as a rate term for numerical integration for the state",
70 "State variable for X gate",
75 "State variable for Y gate",
80 "State variable for Y gate",
93 "Incoming message from Concen object to specific conc to use"
94 "as the first concen variable",
98 "Incoming message from Concen object to specific conc to use"
99 "as the second concen variable",
109 "Sets up HHGate X for channel",
116 "Sets up HHGate Y for channel",
123 "Sets up HHGate Z for channel",
129 static Finfo* HHChannel2DFinfos[] =
148 static string doc[] =
150 "Name",
"HHChannel2D",
151 "Author",
"Niraj Dudani, 2009, NCBS, Updated Upi Bhalla, 2011",
152 "Description",
"HHChannel2D: Hodgkin-Huxley type voltage-gated Ion channel. Something "
153 "like the old tabchannel from GENESIS, but also presents "
154 "a similar interface as hhchan from GENESIS. ",
162 sizeof( HHChannel2DFinfos ) /
sizeof(
Finfo *),
165 sizeof(doc) /
sizeof(
string)
358 default: assert( 0 );
return 0.0;
364 static vector< map< string, int > > dep;
368 dep[ 0 ][
"VOLT_INDEX" ] = 0;
369 dep[ 0 ][
"C1_INDEX" ] = 1;
370 dep[ 0 ][
"C2_INDEX" ] = 2;
372 dep[ 0 ][
"VOLT_C1_INDEX" ] = 0;
373 dep[ 0 ][
"VOLT_C2_INDEX" ] = 0;
374 dep[ 0 ][
"C1_C2_INDEX" ] = 1;
376 dep[ 1 ][
"VOLT_INDEX" ] = -1;
377 dep[ 1 ][
"C1_INDEX" ] = -1;
378 dep[ 1 ][
"C2_INDEX" ] = -1;
380 dep[ 1 ][
"VOLT_C1_INDEX" ] = 1;
381 dep[ 1 ][
"VOLT_C2_INDEX" ] = 2;
382 dep[ 1 ][
"C1_C2_INDEX" ] = 2;
385 if ( dep[ dim ].find( index ) == dep[ dim ].end() )
388 if ( dep[ dim ][ index ] == 0 )
390 if ( dep[ dim ][ index ] == 1 )
392 if ( dep[ dim ][ index ] == 2 )
423 double x = exp( -B * dt );
424 return state * x + ( A / B ) * ( 1 - x );
426 return state + A * dt ;
487 cout <<
"Warning: B_ value for " << e->
getName() <<
488 " is ~0. Check X table\n";
499 cout <<
"Warning: B value for " << e->
getName() <<
500 " is ~0. Check Y table\n";
511 cout <<
"Warning: B value for " << e->
getName() <<
512 " is ~0. Check Z table\n";
536 double *assignee,
const string& gateType )
539 cout <<
"Error: HHChannel2D::set" << gateType <<
540 "power: Cannot use negative power: " << power << endl;
547 if (
doubleEq( *assignee, 0.0 ) && power > 0 ) {
549 }
else if (
doubleEq( power, 0.0 ) ) {
617 cout <<
"Warning: HHChannel2D::createGate: '" << gateName <<
618 "' on Element '" << chanId.
path() <<
"' already present\n";
621 *gatePtr =
new HHGate2D( chanId, gateId );
628 cout <<
"Warning: HHChannel2D::createGate: Not allowed from copied channel:\n" << e.
id().
path() <<
"\n";
632 if ( gateType ==
"X" )
634 else if ( gateType ==
"Y" )
636 else if ( gateType ==
"Z" )
639 cout <<
"Warning: HHChannel2D::createGate: Unknown gate type '" <<
640 gateType <<
"'. Ignored\n";
646 if ( *gatePtr == 0 ) {
647 cout <<
"Warning: HHChannel2D::destroyGate: '" << gateName <<
648 "' on Element '" << chanId.
path() <<
"' not present\n";
659 cout <<
"Warning: HHChannel2D::destroyGate: Not allowed from copied channel:\n" << e.
id().
path() <<
"\n";
663 if ( gateType ==
"X" )
665 else if ( gateType ==
"Y" )
667 else if ( gateType ==
"Z" )
670 cout <<
"Warning: HHChannel2D::destroyGate: Unknown gate type '" <<
671 gateType <<
"'. Ignored\n";
677 return exp( p *
log( x ) );
685 else if ( power == 1.0 )
687 else if ( power == 2.0 )
689 else if ( power == 3.0 )
691 else if ( power == 4.0 )
703 void testHHChannel2D2D()
static const double EPSILON
HHGate2D for the zGate.
void setZindex(string index)
static const int INSTANT_X
bool xInited_
State variable for Z gate.
double getZpower(const Eref &e) const
double depValue(int dependency)
bool isOriginalChannel(Id id) const
static double power1(double x, double p)
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
static const Cinfo * HHChannel2DCinfo
std::string path(const std::string &separator="/") const
unsigned int value() const
double vGetModulation(const Eref &e) const
double(* PFDD)(double, double)
void setYpower(const Eref &e, double Ypower)
int instant_
Exponent for Z gate.
double Y_
State variable for X gate.
void setInstant(int Instant)
double Ypower_
Exponent for X gate.
double(* takeZpower_)(double, double)
unsigned int getNumZgates() const
Returns 1 if Z gate present, otherwise 0.
void setZpower(const Eref &e, double Zpower)
void setXpower(const Eref &e, double Xpower)
void innerDestroyGate(const string &gateName, HHGate2D **gatePtr, Id chanId)
double getYpower(const Eref &e) const
Element * element() const
HHGate2D * zGate_
HHGate2D for the yGate.
double Z_
State variable for Y gate.
static double power4(double x, double p)
void setXindex(string index)
int dependency(string index, unsigned int dim)
void log(string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
Log to console (and to a log-file)
void vReinit(const Eref &e, ProcPtr p)
void innerCreateGate(const string &gateName, HHGate2D **gatePtr, Id chanId, Id gateId)
Inner utility function for creating the gate.
void setYindex(string index)
void setGk(const Eref &e, double Gk)
bool doubleEq(double x, double y)
static double power2(double x, double p)
double Vm_
Vm_ is input variable from compartment, used for most rates.
static const Cinfo * initCinfo()
double(* takeYpower_)(double, double)
double conc1_
Internal variable used to calculate conductance.
static PFDD selectPower(double power)
bool checkOriginal(Id chanId) const
Returns true if channel is original, false if copy.
HHGate2D * getYgate(unsigned int i)
Access function used for the Y gate. The index is ignored.
static const int INSTANT_Z
void createGate(const Eref &e, string gateType)
unsigned int getNumXgates() const
unsigned int getNumYgates() const
Returns 1 if Y gate present, otherwise 0.
void setNumGates(unsigned int num)
Dummy assignment function for the number of gates.
static double power3(double x, double p)
HHGate2D * getZgate(unsigned int i)
Access function used for the Z gate. The index is ignored.
double integrate(double state, double dt, double A, double B)
void sendReinitMsgs(const Eref &e, const ProcPtr info)
static const Cinfo * initCinfo()
void lookupBoth(double v, double c, double *A, double *B) const
double getXpower(const Eref &e) const
HHGate2D * getXgate(unsigned int i)
Access function used for the X gate. The index is ignored.
double Zpower_
Exponent for Y gate.
static const int INSTANT_Y
void vProcess(const Eref &e, ProcPtr p)
void sendProcessMsgs(const Eref &e, const ProcPtr info)
const string & getName() const
double getGbar(const Eref &e) const
static double powerN(double x, double p)
static const Cinfo * initCinfo()
Specify the Class Info static variable for initialization.
double(* takeXpower_)(double, double)
void destroyGate(const Eref &e, string gateType)