#include <HHChannel.h>
Public Member Functions | |
HHChannel () | |
~HHChannel () | |
void | vSetXpower (const Eref &e, double Xpower) |
void | vSetYpower (const Eref &e, double Ypower) |
void | vSetZpower (const Eref &e, double Zpower) |
void | vSetInstant (const Eref &e, int Instant) |
int | vGetInstant (const Eref &e) const |
void | vSetX (const Eref &e, double X) |
double | vGetX (const Eref &e) const |
void | vSetY (const Eref &e, double Y) |
double | vGetY (const Eref &e) const |
void | vSetZ (const Eref &e, double Z) |
double | vGetZ (const Eref &e) const |
void | vSetUseConcentration (const Eref &e, int value) |
void | vSetModulation (const Eref &e, double modulation) |
double | vGetModulation (const Eref &e) const |
void | innerSetXpower (double Xpower) |
void | innerSetYpower (double Ypower) |
void | innerSetZpower (double Zpower) |
void | vProcess (const Eref &e, ProcPtr p) |
void | vReinit (const Eref &e, ProcPtr p) |
void | vHandleConc (const Eref &e, double conc) |
HHGate * | vGetXgate (unsigned int i) const |
HHGate * | vGetYgate (unsigned int i) const |
HHGate * | vGetZgate (unsigned int i) const |
void | innerCreateGate (const string &gateName, HHGate **gatePtr, Id chanId, Id gateId) |
Inner utility function for creating the gate. | |
bool | checkOriginal (Id chanId) const |
Returns true if channel is original, false if copy. | |
void | vCreateGate (const Eref &e, string gateType) |
void | destroyGate (const Eref &e, string gateType) |
void | innerDestroyGate (const string &gateName, HHGate **gatePtr, Id chanId) |
bool | setGatePower (const Eref &e, double power, double *assignee, const string &gateType) |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Specify the Class Info static variable for initialization. |
The HHChannel class sets up a Hodkin-Huxley type ion channel. The form used here is quite general and can handle up to 3 gates, named X, Y and Z. The Z gate can be a function of concentration as well as voltage. The gates are normally computed using the form
alpha(V) closed <------------> open beta(V)
where the rates for the transition are alpha and beta, and both are functions of V. The state variables for each gate (X_, Y_, and Z_) are the fraction in the open state.
Gates can also be computed instantaneously, giving the instantaneous ratio of alpha to beta rather than solving the above conversion process. The actual functions alpha and beta are provided by an auxiliary class, the HHGate. The idea is that all copies of a channel share the same gate, thus saving a great deal of space. It also makes it possible to cleanly change the parameters of all the channels of a give class, all at once. Should one want to mutate a subset of channels, they just need to set up separate gates.
HHGates are implemented as a special category of FieldElement, so that they can be accessed as readonly pointers available to the HHChannel. The FieldElement containing the HHGate appears as a child Element of the HHChannel. The HHChannel Element can be an array; the associated HHGate is a singleton. So there has to be a local copy of the HHGate on each node.
HHChannel::HHChannel | ( | ) |
HHChannel::~HHChannel | ( | ) |
bool HHChannel::checkOriginal | ( | Id | chanId | ) | const |
Returns true if channel is original, false if copy.
If the gate exists and has only this element for input, then change the gate power. If the gate exists and has multiple parents, then make a new gate, set its power. If the gate does not exist, make a new gate, set its power.
The function is designed with the idea that if copies of this channel are made, then they all point back to the original HHGate. (Unless they are cross-node copies). It is only if we subsequently alter the HHGate of this channel that we need to make our own variant of the HHGate, or disconnect from an existing one.
References HHGate::isOriginalChannel().
void HHChannel::destroyGate | ( | const Eref & | e, | |
string | gateType | |||
) |
Utility function for destroying gate. Works only on original HHChannel. Somewhat dangerous, should never be used after a copy has been made as the pointer of the gate will be in use elsewhere.
const Cinfo * HHChannel::initCinfo | ( | ) | [static] |
Specify the Class Info static variable for initialization.
Reimplemented from ChanCommon.
References HHChannelBase::initCinfo().
void HHChannel::innerCreateGate | ( | const string & | gateName, | |
HHGate ** | gatePtr, | |||
Id | chanId, | |||
Id | gateId | |||
) |
Inner utility function for creating the gate.
Inner utility for destroying the gate
void HHChannel::innerSetXpower | ( | double | Xpower | ) |
void HHChannel::innerSetYpower | ( | double | Ypower | ) |
void HHChannel::innerSetZpower | ( | double | Zpower | ) |
bool HHChannel::setGatePower | ( | const Eref & | e, | |
double | power, | |||
double * | assignee, | |||
const string & | gateType | |||
) |
Utility for altering gate powers
Referenced by vSetXpower(), vSetYpower(), and vSetZpower().
void HHChannel::vCreateGate | ( | const Eref & | e, | |
string | gateType | |||
) | [virtual] |
Implements HHChannelBase.
int HHChannel::vGetInstant | ( | const Eref & | e | ) | const [virtual] |
Implements HHChannelBase.
double HHChannel::vGetModulation | ( | const Eref & | e | ) | const [virtual] |
Reimplemented from ChanCommon.
References HHChannelBase::modulation_.
double HHChannel::vGetX | ( | const Eref & | e | ) | const [virtual] |
Implements HHChannelBase.
HHGate * HHChannel::vGetXgate | ( | unsigned int | i | ) | const [virtual] |
Access function used for the X gate. The index is ignored.
Implements HHChannelBase.
double HHChannel::vGetY | ( | const Eref & | e | ) | const [virtual] |
Implements HHChannelBase.
HHGate * HHChannel::vGetYgate | ( | unsigned int | i | ) | const [virtual] |
Access function used for the Y gate. The index is ignored.
Implements HHChannelBase.
double HHChannel::vGetZ | ( | const Eref & | e | ) | const [virtual] |
Implements HHChannelBase.
HHGate * HHChannel::vGetZgate | ( | unsigned int | i | ) | const [virtual] |
Access function used for the Z gate. The index is ignored.
Implements HHChannelBase.
void HHChannel::vHandleConc | ( | const Eref & | e, | |
double | conc | |||
) | [virtual] |
Assign the local Vm_ to the incoming Vm from the compartment void handleVm( double Vm ); Assign the local conc_ to the incoming conc from the concentration calculations for the compartment. Typically the message source will be a CaConc object, but there are other options for computing the conc.
Implements HHChannelBase.
processFunc handles the update and calculations every clock tick. It first sends the request for evaluation of the gate variables to the respective gate objects and recieves their response immediately through a return message. This is done so that many channel instances can share the same gate lookup tables, but do so cleanly. Such messages should never go to a remote node. Then the function does its own little calculations to send back to the parent compartment through regular messages.
Implements ChanBase.
References ProcInfo::dt, HHGate::lookupBoth(), HHChannelBase::modulation_, ChanCommon::sendProcessMsgs(), ChanCommon::updateIk(), HHChannelBase::useConcentration_, ChanCommon::vGetGbar(), ChanCommon::Vm_, ChanCommon::vSetGk(), HHChannelBase::Xpower_, HHChannelBase::Ypower_, and HHChannelBase::Zpower_.
Reinitializes the values for the channel. This involves computing the steady-state value for the channel gates using the provided Vm from the parent compartment. It involves a similar cycle through the gates and then updates to the parent compartment as for the processFunc.
Here we get the steady-state values for the gate (the 'instant' calculation) as A_/B_.
Implements ChanBase.
References Eref::element(), Element::getName(), HHGate::lookupBoth(), HHChannelBase::modulation_, ChanCommon::sendReinitMsgs(), ChanCommon::updateIk(), HHChannelBase::useConcentration_, ChanCommon::vGetGbar(), ChanCommon::Vm_, ChanCommon::vSetGk(), HHChannelBase::Xpower_, HHChannelBase::Ypower_, and HHChannelBase::Zpower_.
void HHChannel::vSetInstant | ( | const Eref & | e, | |
int | Instant | |||
) | [virtual] |
Implements HHChannelBase.
void HHChannel::vSetModulation | ( | const Eref & | e, | |
double | modulation | |||
) | [virtual] |
Reimplemented from ChanCommon.
References HHChannelBase::modulation_.
void HHChannel::vSetUseConcentration | ( | const Eref & | e, | |
int | value | |||
) | [virtual] |
Implements HHChannelBase.
void HHChannel::vSetX | ( | const Eref & | e, | |
double | X | |||
) | [virtual] |
Implements HHChannelBase.
void HHChannel::vSetXpower | ( | const Eref & | e, | |
double | power | |||
) | [virtual] |
Assigns the Xpower for this gate. If the gate exists and has only this element for input, then change the gate value. If the gate exists and has multiple parents, then make a new gate. If the gate does not exist, make a new gate
Implements HHChannelBase.
References HHChannelBase::selectPower(), setGatePower(), and HHChannelBase::Xpower_.
void HHChannel::vSetY | ( | const Eref & | e, | |
double | Y | |||
) | [virtual] |
Implements HHChannelBase.
void HHChannel::vSetYpower | ( | const Eref & | e, | |
double | Ypower | |||
) | [virtual] |
Implements HHChannelBase.
References HHChannelBase::selectPower(), setGatePower(), and HHChannelBase::Ypower_.
void HHChannel::vSetZ | ( | const Eref & | e, | |
double | Z | |||
) | [virtual] |
Implements HHChannelBase.
void HHChannel::vSetZpower | ( | const Eref & | e, | |
double | Zpower | |||
) | [virtual] |
Implements HHChannelBase.
References HHChannelBase::selectPower(), setGatePower(), HHChannelBase::useConcentration_, and HHChannelBase::Zpower_.