Skip to content

Commit

Permalink
experimental support for indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-s committed Sep 29, 2020
1 parent e7110b6 commit ae76037
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
6 changes: 4 additions & 2 deletions @xolotl/xolotl.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function displayScalarObject(self)
end
info_str = [' (g=' g ', E=' E ')'];

fprintf([' | ' url_str info_str '\n'])
fprintf([ ' ' char(1154) ' ' url_str info_str '\n'])
end

% also show the synapses in this compartment
Expand All @@ -135,9 +135,11 @@ function displayScalarObject(self)
url = ['matlab:' inputname(1) '.' compartment '.' synapse];
url_str = ['<a href="' url '">' synapse '</a>'];
info_str = [' (' mat2str(self.(compartment).(synapse).gmax,4) 'nS)'];
fprintf([' > ' url_str info_str '\n'])
fprintf([' ' char(881) ' ' url_str info_str '\n'])
end

% 1244 881 1154

fprintf('\n')
end

Expand Down
31 changes: 20 additions & 11 deletions c++/mechanisms/oleary/IntegralController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ void IntegralController::init() {

bool targetMissing = true;


// read the Calcium Target from the CalciumTarget mechanism
// in the compartment that the controlled object is in
for (int i = 0; i < n_mech; i++) {

string this_mech = temp_comp->getMechanismPointer(i)->getClass().c_str();
Expand All @@ -92,7 +95,6 @@ void IntegralController::init() {
}

Target = temp_comp->getMechanismPointer(i)->getState(0);

targetMissing = false;
}
}
Expand Down Expand Up @@ -186,6 +188,12 @@ void IntegralController::connect(synapse* syn_) {
void IntegralController::integrate(void) {


// if the target is NaN, we will interpret this
// as the controller being disabled
// and do nothing
if (isnan(Target)) {return;}


switch (control_type) {
case 0:
mexErrMsgTxt("[IntegralController] misconfigured controller. Make sure this object is contained by a conductance or synapse object");
Expand All @@ -195,13 +203,13 @@ void IntegralController::integrate(void) {
case 1:

{
// if the target is NaN, we will interpret this
// as the controller being disabled
// and do nothing
if (isnan(Target)) {return;}

double Ca_error = Target - (channel->container)->Ca_prev;

// debug -- constant drive
if (Target < 0) {
Ca_error = 1;
}

// integrate mRNA
m += (dt/tau_m)*(Ca_error);

Expand All @@ -224,14 +232,15 @@ void IntegralController::integrate(void) {
}
case 2:
{
// if the target is NaN, we will interpret this
// as the controller being disabled
// and do nothing

if (isnan(Target)) {return;}

double Ca_error = Target - (syn->post_syn)->Ca_prev;

// debug -- constant drive
if (Target < 0) {
Ca_error = 1;
}


// integrate mRNA
m += (dt/tau_m)*(Ca_error);

Expand Down

0 comments on commit ae76037

Please sign in to comment.