return this->propensity;
}
+double ElementaryReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void ElementaryReaction::fire()
{
std::vector<Species*>::iterator reac = this->reactants.begin(),
return this->propensity;
}
+double VirusReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void VirusReaction::fire()
{
// pick which virus reproduces
return propensity;
}
+double VirusDeathReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void VirusDeathReaction::fire()
{
// pick which virus dies
return propensity;
}
+double KillingReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void KillingReaction::fire()
{
// pick which virus to kill
}
+double CTLActivationReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void CTLActivationReaction::fire()
{
Tfrom->count -= 1;
return this->propensity;
}
+double NTVirusReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void NTVirusReaction::fire()
{
// pick which virus reproduces
return propensity;
}
+double NTVirusDeathReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void NTVirusDeathReaction::fire()
{
// pick which virus dies
return propensity;
}
+double AAKillingReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void AAKillingReaction::fire()
{
// pick which virus to kill
}
+double CTLaaActivationReaction::recalc(Reaction *rxn)
+{
+ return this->recalc();
+}
+
void CTLaaActivationReaction::fire()
{
Tfrom->count -= 1;
std::string name;
std::vector<Reaction*> affects; // reactions whose propensity must be updated when this one fires
virtual double recalc() = 0;
+ virtual double recalc(Reaction *rxn) = 0; // what other reaction fired to cause this one's propensity to be recalculated?
virtual void fire() = 0;
};
std::vector<int> reactant_stoich; // reaction order
std::vector<int> product_stoich; // must be negative for reactants that are consumed!
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
Hamiltonian H;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
VirusSpecies* V;
Hamiltonian H;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
VirusSpecies* V;
CTLSpecies* T;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
CTLSpecies* Tfrom;
CTLSpecies* Tto;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
PottsHamiltonian H;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
NTVirusSpecies* V;
PottsHamiltonian H;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
NTVirusSpecies* V;
CTLaaSpecies* T;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
CTLaaSpecies* Tfrom;
CTLaaSpecies* Tto;
double recalc();
+ double recalc(Reaction *rxn);
void fire();
};
total_propensity = total_propensity - oldA + newA;
for (rxn2 = (*rxn)->affects.begin(), end2 = (*rxn)->affects.end(); rxn2 != end2; ++rxn2) {
oldA = (*rxn2)->propensity;
- (*rxn2)->recalc();
+ (*rxn2)->recalc(*rxn);
newA = (*rxn2)->propensity;
//if (oldA == newA && newA != 0.0) {
// std::cout << "SAME: " << (*rxn)->name << " affected " << (*rxn2)->name << " with propensity " << newA << '\n';