17 #include "../shell/Shell.h"
30 "Author",
"Upinder S. Bhalla, 2007, NCBS",
31 "Description",
"HHChannel: Hodgkin-Huxley type voltage-gated Ion channel. Something "
32 "like the old tabchannel from GENESIS, but also presents "
33 "a similar interface as hhchan from GENESIS. ",
38 static Cinfo HHChannelCinfo(
45 sizeof(doc)/
sizeof(
string)
48 return &HHChannelCinfo;
62 X_( 0.0 ), Y_( 0.0 ), Z_( 0.0 ),
63 xInited_( false ), yInited_( false ), zInited_( false ),
87 double *assignee,
const string& gateType )
92 if (
doubleEq( *assignee, 0.0 ) && power > 0 ) {
94 }
else if (
doubleEq( power, 0.0 ) ) {
164 cout <<
"Warning: HHChannel::createGate: '" << gateName <<
165 "' on Element '" << chanId.
path() <<
"' already present\n";
168 *gatePtr =
new HHGate( chanId, gateId );
175 cout <<
"Warning: HHChannel::createGate: Not allowed from copied channel:\n" << e.
id().
path() <<
"\n";
179 if ( gateType ==
"X" )
181 else if ( gateType ==
"Y" )
183 else if ( gateType ==
"Z" )
186 cout <<
"Warning: HHChannel::createGate: Unknown gate type '" <<
187 gateType <<
"'. Ignored\n";
193 if ( *gatePtr == 0 ) {
194 cout <<
"Warning: HHChannel::destroyGate: '" << gateName <<
195 "' on Element '" << chanId.
path() <<
"' not present\n";
206 cout <<
"Warning: HHChannel::destroyGate: Not allowed from copied channel:\n" << e.
id().
path() <<
"\n";
210 if ( gateType ==
"X" )
212 else if ( gateType ==
"Y" )
214 else if ( gateType ==
"Z" )
217 cout <<
"Warning: HHChannel::destroyGate: Unknown gate type '" <<
218 gateType <<
"'. Ignored\n";
281 double x = exp( -B * dt );
282 return state * x + ( A / B ) * ( 1 - x );
284 return state + A * dt ;
350 cout <<
"Warning: B_ value for " << e->
getName() <<
351 " is ~0. Check X table\n";
363 cout <<
"Warning: B value for " << e->
getName() <<
364 " is ~0. Check Y table\n";
379 cout <<
"Warning: B value for " << e->
getName() <<
380 " is ~0. Check Z table\n";
407 if ( modulation > 0.0 )
double vGetZ(const Eref &e) const
HHGate * zGate_
HHGate data structure for the yGate.
double modulation_
Value used to scale channel conductance up or down.
void vCreateGate(const Eref &e, string gateType)
static const int INSTANT_Y
double conc_
Conc_ is input variable for Ca-dependent channels.
void vReinit(const Eref &e, ProcPtr p)
std::string path(const std::string &separator="/") const
HHGate * vGetYgate(unsigned int i) const
unsigned int value() const
void vSetModulation(const Eref &e, double modulation)
HHGate * vGetXgate(unsigned int i) const
bool checkOriginal(Id chanId) const
Returns true if channel is original, false if copy.
double Zpower_
Exponent for Z gate.
static PFDD selectPower(double power)
double Z_
State variable for Z gate.
Element * element() const
double(* takeXpower_)(double, double)
void destroyGate(const Eref &e, string gateType)
static const int INSTANT_Z
int instant_
bitmapped flag for X, Y, Z, to do equil calculation for gate
bool doubleEq(double x, double y)
void lookupBoth(double v, double *A, double *B) const
void vSetUseConcentration(const Eref &e, int value)
double(* takeZpower_)(double, double)
static const Cinfo * initCinfo()
double Vm_
Vm_ is input variable from compartment, used for most rates.
static const double EPSILON
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
static const Cinfo * initCinfo()
double Y_
State variable for Y gate.
void vSetXpower(const Eref &e, double Xpower)
void vSetGk(const Eref &e, double Gk)
void createGate(const Eref &e, string gateType)
int vGetInstant(const Eref &e) const
HHGate * yGate_
HHGate data structure for the yGate.
void vSetX(const Eref &e, double X)
void vHandleConc(const Eref &e, double conc)
double vGetGbar(const Eref &e) const
void vSetZ(const Eref &e, double Z)
double integrate(double state, double dt, double A, double B)
Internal variable used to calculate conductance.
void innerCreateGate(const string &gateName, HHGate **gatePtr, Id chanId, Id gateId)
Inner utility function for creating the gate.
double Ypower_
Exponent for Y gate.
void vSetY(const Eref &e, double Y)
void vSetInstant(const Eref &e, int Instant)
static const Cinfo * hhChannelCinfo
double vGetY(const Eref &e) const
void sendReinitMsgs(const Eref &e, const ProcPtr info)
void innerDestroyGate(const string &gateName, HHGate **gatePtr, Id chanId)
double(* takeYpower_)(double, double)
double vGetX(const Eref &e) const
static const int INSTANT_X
void vSetZpower(const Eref &e, double Zpower)
void vSetYpower(const Eref &e, double Ypower)
void sendProcessMsgs(const Eref &e, const ProcPtr info)
double vGetModulation(const Eref &e) const
const string & getName() const
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
double Xpower_
Exponent for X gate.
HHGate * vGetZgate(unsigned int i) const
void vProcess(const Eref &e, ProcPtr p)
bool isOriginalChannel(Id id) const