/******************************************************************* psim.h Revision 1.2 under construction ********************************************************************/ /* Copyright (C) 2000,2001 Doug Neubauer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PLOTFLAG (1) enum { BACKGROUNDSTRAIN, INFLUENZASTRAIN, RYEGRASSSTRAIN, TOTALSTRAINS }; enum { IGM, /* bCells */ IGG, IGA, IGE, TOTALPROFILES, TH0 = 0, /* t cells */ TH1, TH2 , D_IL12 = 0 , /* dendritic */ D_IL10 }; #define BRONCHIALFRACTION (7.5e-4) #define LPFRACTION (0.001) #define BRONCHIALFLOWVALUE (6.9 * BRONCHIALFRACTION) /* was 0.75 */ #define LPFLOWVALUE (6.9 * LPFRACTION) #define STRAINFREQUENCY (1.0e-5) /* was 1.0e-6 */ #define NUMBEROFTCEFFECTORPRECURSOR (16 - 1) #define NUMBEROFTCEFFECTORPRECURSORMEMORY (8 - 1) #define NUMBEROFTCBLASTPRECURSOR (4) #define NUMBEROFTHBLASTPRECURSOR (4) #define NUMBEROFTHEFFECTORPRECURSOR (14 - 1) // was 10-1 #define NUMBEROFTHEFFECTORPRECURSORMEMORY (8 - 1) #define NUMBEROFBCENTROBLASTPRECURSOR (12 - 1) #define NUMBEROFBPLASMAPRECURSOR (7 - 1) #define CENTROBLASTPERGERMINALCENTER (12500) #define TCEFFECTORCUTOFF (11 -1) #define TCEFFECTORCUTOFFMEMORY (6 -1) #define MAXIMUMTHPERGERMINALCENTER (1500.0) #define MAXIMUMFDCPERGERMINALCENTER (75.0) #define NUMBEROFTHMEMORYACTIVATE (4) #define IMMUNEDEBUG (1) #define METABOLISMDEBUG (0) #define VOLUMEHACK ( 2.97 / 1.5 ) typedef double * ImmuneSubstance; class GenericImmuneCell; typedef struct { double value[TOTALPROFILES]; } profileData ; profileData igeProfileGlobal[TOTALSTRAINS] = {{0.0, 0.0, 0.0,1.0},{0.0, 0.0, 0.0,1.0},{0.0, 0.0, 0.0, 1.0}}; profileData th2ProfileGlobal[TOTALSTRAINS] = {{0.0, 0.0, 1.0,0.0},{0.0, 0.0, 1.0,0.0},{0.0, 0.0, 1.0, 0.0}}; typedef struct { char type; /* circulatory, bile, digestive, lymph */ char *name ; double initialConcentration; char *quantityUnits ; char *concentrationUnits ; double volumeConversionFactor ; /* mm3/ml, etc. */ double quantityConversionFactor; /* pg/umole, etc. */ char whichVolume; /* T = total, P = plasma */ char auxiliary; } substanceEntry; typedef struct { char type; /* circulatory, bile, digestive, lymph */ char *name ; double initialConcentration[TOTALSTRAINS]; profileData initialProfile[TOTALSTRAINS]; char *quantityUnits ; char *concentrationUnits ; double volumeConversionFactor ; /* mm3/ml, etc. */ double quantityConversionFactor; /* pg/umole, etc. */ char whichVolume; /* T = total, P = plasma */ char profileStyle; /* 0 = no profile, strains only, b = bCell(isotype), t = tCell(cytokines), others...? */ } immuneCellEntry; typedef struct { char *name; double numberOfBCellsNaive[TOTALSTRAINS]; double numberOfBCellsRecirculate[TOTALSTRAINS]; double numberOfBCellsMarginalZone[TOTALSTRAINS]; double numberOfThCellsNaive[TOTALSTRAINS]; double numberOfTcCellsNaive[TOTALSTRAINS]; double numberOfMacrophage; double numberOfDendritic; double epitheliaCell; double k2BloodInput_bCellNaive; double k2BloodInput_bCellNaiveRecirculate; double k2BloodInput_thNaive; double k2BloodInput_tcNaive; double k2BloodInput_tcEffector; double k2BloodInput_Dendritic; double k2BloodInput_rbc; double k2BloodInput_platelets; double k2BloodInput_Macrophage; double k2BloodOutput_bCellNaive; double k2BloodOutput_bCellNaiveRecirculate; double k2BloodOutput_thNaive; double k2BloodOutput_tcNaive; double k2LymphInput_bCellNaiveRecirculate; double k2LymphInput_macrophageApc; double k2LymphInput_dendriticApc; double k2LymphOutput_bCellNaiveRecirculate; double k2LymphOutput_tcEffector; double k2LymphOutput_macrophageApc; double k2LymphOutput_dendriticApc; double k2LymphOutput_thNaive; double k2LymphOutput_tcNaive; double k2macrophageReplicate; double k2DendriticReplicate; double k2BloodInput_plasmaCell; double k2LymphOutput_plasmaCell; double k2BloodInput_thEffector; double k2LymphOutput_thEffector; double fdcGerminalCenters; double k2BloodInput_bCellMemory; double k2BloodInput_thMemory; double k2BloodInput_tcMemory; double k2BloodOutput_bCellMemory; double k2BloodOutput_thMemory; double k2BloodOutput_tcMemory; double k2LymphOutput_bCellMemory; double k2LymphOutput_thMemory; double k2LymphOutput_tcMemory; double k2LymphInput_bCellMemory; double k2LymphInput_thMemory; double k2LymphInput_tcMemory; double numberOfmastCell; double numberOfeosinophil; double k2BloodInput_mastCell; double k2BloodInput_eosinophil; } tissueConstant; typedef struct { char type; /* circulatory, bile, digestive, lymph */ char *name ; double flowOut; double flowIn; double totalVolume ; double plasmaVolume ; double quantity ; double length ; double pressure ; char *previousName ; char *nextName; } vesselEntry; class VesselSegment { public: VesselSegment (); void VesselSegment::Snapshot (); void VesselSegment::ExecuteInfusion (int index); GenericImmuneCell &VesselSegment::FindImmuneCell (char *s); int VesselSegment::FindImmuneCellIndex (char *s); int VesselSegment::ConnectJunctions (double dTime); void VesselSegment::PrintImmuneCell (char *s, int index, int strainIndex, int profileIndex, char type); static void VesselSegment::HelpPrint (); VesselSegment *VesselSegment::FindVessel (char *s); void VesselSegment::PrintSubstance (int substanceIndex, char type); int FindSubstanceIndex (char *s); void VesselSegment::CalculateFlows (int numberbloodVessels); static void VesselSegment::CalculateBoundaryFlows (VesselSegment *destination,VesselSegment *source,double timeConstantValueOut,double timeConstantValueIn, int *transferList); static int *VesselSegment::CreateTransferList (VesselSegment *destination,VesselSegment *source,char **transferNames); double &VesselSegment::FindSubstance (char *s,char flag); inline void SetSubstanceQuantity(int substanceIndex,double value){ substanceQuantity[substanceIndex] = value / substanceBase[substanceIndex].quantityConversionFactor; /* printf("SetSubstanceQuantity: %s.%s %g\n",name,substanceBase[substanceIndex].name,substanceQuantity[substanceIndex]); */ } inline void InjectSubstance(int substanceIndex,double value){ substanceQuantity[substanceIndex] += value; } inline void SetTransferFlag(double value){transferFlag += value; /* printf("transferFlag: %s %g\n",name,transferFlag); */ } inline double VesselSegment::Concentration2Umoles (double concentration, int index){ return(concentration * ReadVolume(substanceBase[index].whichVolume) / (substanceBase[index].volumeConversionFactor * substanceBase[index].quantityConversionFactor)) ;} // concentration -> umole inline double VesselSegment::ImmuneConcentration2Umoles (double concentration, int index){ return(concentration * ReadVolume(immuneCellBase[index].whichVolume) / (immuneCellBase[index].volumeConversionFactor * immuneCellBase[index].quantityConversionFactor)) ;} // concentration -> umole inline void SetSubstanceConcentration(int substanceIndex,double value){ substanceQuantity[substanceIndex] = Concentration2Umoles(value,substanceIndex); } inline double ReadTimeConstant(){return(timeConstantValueOut) ;} inline void SetTimeConstant(double newTimeConstant){timeConstantValueOut = newTimeConstant;} inline double ReadTransferFlag(){return(transferFlag) ;} inline double ReadVolume(char flag){ if(flag == 'T') return(totalVolume); else return(plasmaVolume); } private: char *name; int previousSegment ; int nextSegment ; int numberOfSubstances ; int numberOfImmuneCells; double totalVolume ; double plasmaVolume ; double timeConstantValueIn ; double timeConstantValueOut; double *substanceQuantity ; double *dSubstanceQuantity ; GenericImmuneCell *immuneCells; double transferFlag; substanceEntry *substanceBase; immuneCellEntry *immuneCellBase; static int vesselIndex ; }; class Nerve { public: // accessible by all Nerve(){value = 0.0;} void SetNerve(double newValue){value = newValue;} double ReadNerve(){return(value) ;} private: // accessible by this class only double value; }; class GenericSphincterOfOddi { public: void Run() ; GenericSphincterOfOddi(VesselSegment *newBileDuct, VesselSegment *newCommonHepaticDuct, VesselSegment *newPancreaticDuct, VesselSegment *newIntestine, VesselSegment *newCapillary, double newFlowConstant ,char *newOrganName, double dTime ) : cck( newCapillary->FindSubstance("cck", '-')), trypsin( newIntestine->FindSubstance("trypsin", '-' ) ), chymotrypsin(newIntestine->FindSubstance("chymotrypsin", '-' ) ), carboxypeptidase(newIntestine->FindSubstance("carboxypeptidase", '-' ) ), bileSalts( newIntestine->FindSubstance("bileSalts", '-' ) ), bicarbonate( newIntestine->FindSubstance("bicarbonate", '-' ) ), lipase( newIntestine->FindSubstance("lipase", '-' ) ), amylase( newIntestine->FindSubstance("amylase", '-' ) ), bileTrypsin( newBileDuct->FindSubstance("trypsin", '-' ) ), bileChymotrypsin(newBileDuct->FindSubstance("chymotrypsin", '-' ) ), bileCarboxypeptidase(newBileDuct->FindSubstance("carboxypeptidase", '-' ) ), bileBileSalts( newBileDuct->FindSubstance("bileSalts", '-' ) ), bileBicarbonate( newBileDuct->FindSubstance("bicarbonate", '-' ) ), bileLipase( newBileDuct->FindSubstance("lipase", '-' ) ), bileAmylase( newBileDuct->FindSubstance("amylase", '-' ) ) { bileDuct = newBileDuct; commonHepaticDuct = newCommonHepaticDuct; pancreaticDuct = newPancreaticDuct; intestine = newIntestine; capillary = newCapillary ; organName = newOrganName; flowConstant = newFlowConstant; initialTimeConstantValueOut = bileDuct->ReadTimeConstant(); k2SphincterOfOddi = 6.35 ; kmSphincterOfOddi = 8.03e-6 * VOLUMEHACK; } private: char *organName; VesselSegment *capillary; VesselSegment *intestine ; VesselSegment *bileDuct ; VesselSegment *commonHepaticDuct ; VesselSegment *pancreaticDuct ; double &cck; double &trypsin; double &chymotrypsin; double &carboxypeptidase; double &bileSalts; double &bicarbonate; double &lipase; double &amylase; double &bileTrypsin; double &bileChymotrypsin; double &bileCarboxypeptidase; double &bileBileSalts; double &bileBicarbonate; double &bileLipase; double &bileAmylase; double initialTimeConstantValueOut; double k2SphincterOfOddi; double kmSphincterOfOddi; double flowConstant; }; class GenericStomach { public: void Run() ; GenericStomach(VesselSegment *newCapillary, VesselSegment *newIntestine, double newFlowConstant,char *newOrganName, double dTime ) : gastrin( newCapillary->FindSubstance("gastrin", '-') ), proteinSolid( newIntestine->FindSubstance("proteinSolid", '-') ), proteinChyme( newIntestine->FindSubstance("proteinChyme", '-') ), carbohydrates( newIntestine->FindSubstance("carbohydrates", '-') ), fats( newIntestine->FindSubstance("fats", '-') ), hcl( newIntestine->FindSubstance("hcl", '-' ) ), pepsin( newIntestine->FindSubstance("pepsin", '-' ) ), peptides( newIntestine->FindSubstance("peptides", '-' ) ) { capillary = newCapillary; intestine = newIntestine; organName = newOrganName; flowConstant = newFlowConstant; initialTimeConstantValueOut = intestine->ReadTimeConstant(); kProteinChyme = 6.31e-005 ; hclMultiplier = 3.8e-2 ; k2Hcl = 9.66e4 / VOLUMEHACK ; kmHcl = -3.15 ; k2Pepsin = 3.33e-3 ; kmPepsin = 3.5e-5 * VOLUMEHACK ; k2Peptides = 1.0e-4 ; kmPeptides = 2000.0 ; kbGastrin = 5.1765e-9 ; k2Gastrin = 7.2865e-008 ; kmGastrin = 1978.49 ; kmiGastrin = 9.49e-4 ; kStomach2SmallIntestine = 0.0487 ; kiStomach2SmallIntestine = 1.0/250.0 ; } private: char *organName; VesselSegment *capillary ; VesselSegment *intestine ; double flowConstant; double &gastrin; double &proteinSolid; double &proteinChyme; double &carbohydrates; double &fats; double &hcl; double &pepsin; double &peptides; double initialTimeConstantValueOut; double kProteinChyme; double hclMultiplier; double k2Hcl; double kmHcl; double k2Pepsin; double kmPepsin; double k2Peptides; double kmPeptides; double kbGastrin; double k2Gastrin; double kmGastrin; double kmiGastrin; double kStomach2SmallIntestine; double kiStomach2SmallIntestine; }; class GenericSmallIntestine { public: void Run() ; GenericSmallIntestine(VesselSegment *newIntestine, VesselSegment *newJejunum, VesselSegment *newCapillary, char *newOrganName, double dTime ) : bloodBileSalts(newCapillary->FindSubstance("bileSalts", '-') ), bloodAminoAcids( newCapillary->FindSubstance("aminoAcids", '-') ), cck( newCapillary->FindSubstance("cck", '-') ), gip( newCapillary->FindSubstance("gip", '-') ), glucose( newCapillary->FindSubstance("glucose", '-') ), secretin( newCapillary->FindSubstance("secretin", '-') ), chylomicrons( newCapillary->FindSubstance("chylomicrons", '-')), proteinSolid( newIntestine->FindSubstance("proteinSolid", '-') ), proteinChyme( newIntestine->FindSubstance("proteinChyme", '-') ), hcl( newIntestine->FindSubstance("hcl", 'r' ) ), pepsin(newIntestine->FindSubstance("pepsin", '-' ) ), peptides( newIntestine->FindSubstance("peptides", '-' ) ), trypsin( newIntestine->FindSubstance("trypsin", '-' ) ), chymotrypsin( newIntestine->FindSubstance("chymotrypsin", '-' ) ), carboxypeptidase( newIntestine->FindSubstance("carboxypeptidase", '-' ) ), aminopeptidase(newIntestine->FindSubstance("aminopeptidase", '-' ) ), aminoAcids(newIntestine->FindSubstance("aminoAcids", '-' ) ), fats( newIntestine->FindSubstance("fats", '-' ) ), triglycerides( newIntestine->FindSubstance("triglycerides", '-' ) ), bileSalts( newIntestine->FindSubstance("bileSalts", '-' ) ), bicarbonate( newIntestine->FindSubstance("bicarbonate", '-' ) ), carbohydrates( newIntestine->FindSubstance("carbohydrates", '-' ) ), lipase(newIntestine->FindSubstance("lipase", '-' ) ), amylase( newIntestine->FindSubstance("amylase", '-' ) ) { jejunum = newJejunum; intestine = newIntestine; capillary = newCapillary ; organName = newOrganName; k2Hcl = 2.5e-6 ; k2Peptides = 3.0e-4 ; kmPeptides = 435.0 ; k2AminoAcids = 1.2e-3 ; k2cAminoAcids = 1.2e-3 ; kmAminoAcids = 1740.0 ; k2Triglycerides = 6.4e-7 ; kmTriglycerides = 23.0 ; k2Aminopeptidase = 0.15 ; kmAminopeptidase = 1.5e-6 * VOLUMEHACK ; k2BloodAminoAcids = 0.024 ; kmBloodAminoAcids = 17000.0 ; k2Cck = 1.4e-8 ; kmcck = 1.0e5 ; kmfcck = 1.91e4 ; kbcck = 1.65e-009 ; k2Gip = 1.0e-8 ; kmGip = 1.0e4 ; kmfGip = 191.0 ; kbGip = 2.1e-8 ; k2Secretin = 1.57e-008 ; kmSecretin = 1.31 ; k2Chylomicrons = 1.79e-3 ; kmChylomicrons = 2290.0 ; k2Glucose = 4.0e-3 ; kmGlucose = 2224.0 ; } private: char *organName; VesselSegment *capillary; VesselSegment *intestine ; VesselSegment *jejunum ; double &bloodBileSalts; double &bloodAminoAcids; double &cck; double &gip; double &glucose; double &secretin; double &chylomicrons; double &proteinSolid; double &proteinChyme; double &hcl; double &pepsin; double &peptides; double &trypsin; double &chymotrypsin; double &carboxypeptidase; double &aminopeptidase; double &aminoAcids; double &fats; double &triglycerides; double &bileSalts; double &bicarbonate; double &carbohydrates; double &lipase; double &amylase; double k2Hcl; double k2Peptides; double kmPeptides; double k2AminoAcids; double k2cAminoAcids; double kmAminoAcids; double k2Triglycerides; double kmTriglycerides; double k2Aminopeptidase; double kmAminopeptidase; double k2BloodAminoAcids; double kmBloodAminoAcids; double k2Cck; double kmcck; double kmfcck; double kbcck; double k2Gip; double kmGip; double kmfGip; double kbGip; double k2Secretin; double kmSecretin; double k2Chylomicrons; double kmChylomicrons; double k2Glucose; double kmGlucose; }; class GenericEsophagus { public: void Run() ; GenericEsophagus(VesselSegment *newIntestine, double newFlowConstant,char *newOrganName, double dTime){intestine = newIntestine; flowConstant = newFlowConstant; organName = newOrganName;} private: char *organName; VesselSegment *intestine ; double flowConstant; }; class GenericMouth { public: void Run() ; GenericMouth(VesselSegment *newIntestine, char *newOrganName, double dTime) { intestine = newIntestine; organName = newOrganName; protein = intestine->FindSubstanceIndex("proteinSolid") ; fats = intestine->FindSubstanceIndex("fats") ; carbohydrates = intestine->FindSubstanceIndex("carbohydrates") ; } private: char *organName; VesselSegment *intestine ; int protein; int fats; int carbohydrates; }; class GenericThyroid { public: void Run() ; void PrintValues (); GenericThyroid(VesselSegment *newCapillary,char *newOrganName, double dTime ) : t4( newCapillary->FindSubstance("t4", '-') ), t3( newCapillary->FindSubstance("t3", '-') ), tsh( newCapillary->FindSubstance("tsh", '-') ), iodine( newCapillary->FindSubstance("iodine", '-') ) { double capillaryVolume; capillary = newCapillary; organName = newOrganName; printFlag = 0; capillaryVolume = capillary->ReadVolume('P'); internalIodine = 9000.0 / 127.0; /* qcf = 127.0 */ k2T4 = 5.36e-9 /* umoles/msec */ * dTime ; kaT4 = 1.0e-3 /* umoles/mm3 */ * capillaryVolume ; kmT4 = 1.31e-5 * capillaryVolume ; k2Iodine = 1.34e-8 * dTime ; kmIodine = 4.8e-8 * capillaryVolume ; } private: char *organName; VesselSegment *capillary ; double &t4; double &t3; double &tsh; double &iodine; double internalIodine; double k2T4; double kaT4; double kmT4; double k2Iodine; double kmIodine; int printFlag; }; class GenericAdrenal { public: void Run() ; void PrintValues (){printFlag = 1;} GenericAdrenal(VesselSegment *newCapillary,char *newOrganName, double dTime ) : acth( newCapillary->FindSubstance("acth", '-') ), cortisol( newCapillary->FindSubstance("cortisol", '-') ) { double capillaryVolume; capillary = newCapillary; organName = newOrganName; printFlag = 0; capillaryVolume = capillary->ReadVolume('P'); k2Cortisol = 2.15e-4/500.0 /* umoles/msec */ * dTime; kmCortisol = 1.11e-11 /* umoles/mm3 */ * capillaryVolume; } private: char *organName; VesselSegment *capillary ; double &acth; double &cortisol; double k2Cortisol; double kmCortisol; int printFlag; }; class GenericHypothalamus { public: void Run() ; void PrintValues (){printFlag = 1;} GenericHypothalamus(VesselSegment *newCapillary,VesselSegment *portal,char *newOrganName, double dTime ) : t3( newCapillary->FindSubstance("t3", '-') ), acth( newCapillary->FindSubstance("acth", '-') ), cortisol( newCapillary->FindSubstance("cortisol", '-') ), crh( portal->FindSubstance("crh", '-') ) , trh( portal->FindSubstance("trh", '-') ) { double capillaryVolume; capillary = newCapillary; organName = newOrganName; printFlag = 0; capillaryVolume = capillary->ReadVolume('P'); k2Trh = 4.0e-7 /* umoles/msec */ * dTime ; kiTrh = 6.48e8 /* mm3/umoles */ * 1.0 / capillaryVolume; k2Crh = 4.64e-8/500.0 /* umoles/msec */ * dTime ; ki1Crh = 9.0e10 /* mm3/umoles */ * 1.0 / capillaryVolume; ki2Crh = 3.62e6 /* mm3/umoles */ * 1.0 / capillaryVolume; } private: char *organName; VesselSegment *capillary ; double &acth; double &cortisol; double &crh; double &t3; double &trh; double k2Trh; double kiTrh; double k2Crh; double ki1Crh; double ki2Crh; int printFlag; }; class GenericPituitary { public: void Run() ; void PrintValues (){printFlag = 1;} GenericPituitary(VesselSegment *newCapillary,VesselSegment *portal,char *newOrganName, double dTime ) : t3( newCapillary->FindSubstance("t3", '-') ), tsh( newCapillary->FindSubstance("tsh", '-') ), acth( newCapillary->FindSubstance("acth", '-') ), crh( portal->FindSubstance("crh", '-') ) , trh( portal->FindSubstance("trh", '-') ) { double capillaryVolume,portalVolume; capillary = newCapillary; organName = newOrganName; printFlag = 0; capillaryVolume = capillary->ReadVolume('P'); portalVolume = portal->ReadVolume('P'); internalTsh = 165000.0 ; k2Tsh = .136 /* umoles/msec */ * dTime ; kaTsh = 2.28e-8 /* (umoles/mm3)^2 */ * portalVolume * portalVolume ; kiTsh = 2.61e26 /* (mm3/umoles)^3 */ * 1.0 / (capillaryVolume * capillaryVolume * capillaryVolume) ; k2Acth = 6.9e-8/500.0 /* umoles/msec */ * dTime ; kmActh = 2.32e-9 /* umoles/mm3 */ * portalVolume ; } private: char *organName; VesselSegment *capillary ; double &acth; double &crh; double &t3; double &tsh; double &trh; double k2Tsh; double kaTsh; double kiTsh; double k2Acth; double kmActh; double internalTsh; int printFlag; }; class GenericKidney { public: void PrintValues (){printFlag = 1;} void Run() ; GenericKidney(VesselSegment *newCapillary,char *newOrganName, double dTime ) : acth( newCapillary->FindSubstance("acth", '-') ), cortisol( newCapillary->FindSubstance("cortisol", '-') ), crh( newCapillary->FindSubstance("crh", '-') ) , t4( newCapillary->FindSubstance("t4", '-') ), t3( newCapillary->FindSubstance("t3", '-') ), tsh( newCapillary->FindSubstance("tsh", '-') ), trh( newCapillary->FindSubstance("trh", '-') ), iodine( newCapillary->FindSubstance("iodine", '-') ), gastrin( newCapillary->FindSubstance("gastrin", '-') ), cck( newCapillary->FindSubstance("cck", '-') ), gip( newCapillary->FindSubstance("gip", '-') ), secretin( newCapillary->FindSubstance("secretin", '-') ), insulin( newCapillary->FindSubstance("insulin", '-') ), somatostatin( newCapillary->FindSubstance("somatostatin", '-') ), glucagon( newCapillary->FindSubstance("glucagon", '-') ) { double capillaryVolume,adjustValue; capillary = newCapillary; organName = newOrganName; organVolume = 1.0; capillaryVolume = capillary->ReadVolume('P'); adjustValue = dTime / capillaryVolume; kGastrin = 4.0 /* mm3/msec */ * adjustValue; kcck = 19.96 * adjustValue; kGip = 5.0 * adjustValue; kSecretin = 19.96 * adjustValue; kInsulin = 19.96 * adjustValue; kSomatostatin = 19.96 * adjustValue; kGlucagon = 19.96 * adjustValue; kT4 = 2.8E-3 * adjustValue; kT3 = .405 * adjustValue; kTsh = 1.188 * adjustValue; kTrh = 19.96 * adjustValue; kIodine = .145 * adjustValue; kCrh = 1.04 * adjustValue ; kActh = 6.23 * adjustValue ; kCortisol = .78 * adjustValue; } private: char *organName; VesselSegment *capillary ; double organVolume; double &gastrin; double &cck; double &gip; double &secretin; double &insulin; double &somatostatin; double &glucagon; double &t4; double &t3; double &tsh; double &trh; double &iodine; double &acth; double &cortisol; double &crh; double kT4; double kT3; double kTsh; double kTrh; double kIodine; double kGastrin; double kcck; double kGip; double kSecretin; double kInsulin; double kSomatostatin; double kGlucagon; double kCrh; double kActh; double kCortisol; int printFlag; }; class GenericPancreas { public: void Run() ; void PrintValues (){printFlag = 1;} GenericPancreas(VesselSegment *newBileDuct, VesselSegment *newCapillary, char *newOrganName, double dTime ) : cck( newCapillary->FindSubstance("cck", '-') ), insulin( newCapillary->FindSubstance("insulin", '-') ), glucose( newCapillary->FindSubstance("glucose", '-') ), secretin( newCapillary->FindSubstance("secretin", '-')), somatostatin( newCapillary->FindSubstance("somatostatin", '-')), glucagon( newCapillary->FindSubstance("glucagon", '-')), trypsin( newBileDuct->FindSubstance("trypsin", '-' ) ), chymotrypsin( newBileDuct->FindSubstance("chymotrypsin", '-' )), carboxypeptidase( newBileDuct->FindSubstance("carboxypeptidase", '-' )), bileSalts( newBileDuct->FindSubstance("bileSalts", '-' )), bicarbonate( newBileDuct->FindSubstance("bicarbonate", '-' ) ), lipase(newBileDuct->FindSubstance("lipase", '-' ) ), amylase( newBileDuct->FindSubstance("amylase", '-' ) ) { double capillaryVolume; bileDuct = newBileDuct; capillary = newCapillary ; organName = newOrganName; capillaryVolume = capillary->ReadVolume('P'); k2Insulin = (0.0054)/500.0 /* (1/msec) */ * dTime ; kmInsulin = 1.0/(62355.0e-6) /* mm3/umole */ * 1.0/capillaryVolume ; kbInsulin = (2.0e-7)/500.0 /* (1/msec) */ * dTime ; // k2Glucagon = 4 * 1.51e-7 ; k2Glucagon = (2.82e-6)/500.0 /* (1/msec) */ * dTime ; kmGlucagon = 1.0/(2242.0e-6) /* mm3/umole */ * 1.0/capillaryVolume ; k2Somatostatin = 7.0e-5 ; kmSomatostatin = 7500.0 * VOLUMEHACK ; k2Bicarbonate = 8.0e5 / VOLUMEHACK ; kmBicarbonate = -3.0 ; k2Trypsin = 1.0 ; kmTrypsin = 1.5e-5 * VOLUMEHACK ; k2Chymotrypsin = 1.0 ; kmChymotrypsin = 1.5e-5 * VOLUMEHACK ; k2Carboxypeptidase = 1.0 ; kmCarboxypeptidase = 1.5e-5 * VOLUMEHACK ; k2Lipase = 1.0 ; kmLipase = 1.5e-5 * VOLUMEHACK ; k2Amylase = 0.5 ; kmAmylase = 1.5e-5 * VOLUMEHACK ; } private: char *organName; VesselSegment *capillary; VesselSegment *bileDuct ; double &cck; double &insulin; double &glucose; double &secretin; double &somatostatin; double &glucagon; double &trypsin; double &chymotrypsin; double &carboxypeptidase; double &bileSalts; double &bicarbonate; double &lipase; double &amylase; double k2Insulin; double kmInsulin; double kbInsulin; double k2Somatostatin; double kmSomatostatin; double kmGlucagon; double k2Glucagon; double k2Bicarbonate; double kmBicarbonate; double k2Trypsin; double kmTrypsin; double k2Chymotrypsin; double kmChymotrypsin; double k2Carboxypeptidase; double kmCarboxypeptidase; double k2Lipase; double kmLipase; double k2Amylase; double kmAmylase; int printFlag; }; class GenericOrgan { public: // accessible by all void PrintValues (int snapFlag); private: // accessible by this class only protected: // accessible by subclass void Run() ; void ResetGenericOrgan(); void EvaluateHexokinase() /* glucose uptake glucose -> glucose6Phosphate */ { double rate = k2Hexokinase * hexokinase * glucose / ((kmHexokinase * (1.0 + kiHexokinase * glucose6Phosphate) + glucose) ); glucose6Phosphate += rate ; glucose -= rate * numberOfCells; atp -= rate ; adp += rate; #if METABOLISMDEBUG if (printFlag) { printf(" %s: hexokinase rate: %g (glucose uptake %g)\n",organName,rate,rate * numberOfCells); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); printf(" %s: hexokinase rate: %g (glucose uptake %g)\n",organName,rate,rate * numberOfCells); PrintValues(); exit(1); } /* if */ #endif } void EvaluatePhosphofructokinase () { double x1,rate ; x1 = kmPhosphofructokinase / (1.0 + adp * kaPhosphofructokinase) ; x1 = glucose6Phosphate / x1 ; x1 = x1 * x1 ; x1 = x1 * x1 ; rate = k2Phosphofructokinase * phosphofructokinase * x1 / (1.0 + x1) ; glucose6Phosphate -= rate ; atp -= rate ; adp += rate ; gap += rate + rate ; #if METABOLISMDEBUG if (printFlag) { printf(" %s: phosphofructokinase rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); PrintValues(); printf(" %s: phosphofructokinase rate: %g\n",organName,rate); exit(1); } /* if */ #endif } void EvaluatePyruvateKinase() { double rate = k2PyruvateKinase * pyruvateKinase * gap / ((kmPyruvateKinase * (1.0 + kiPyruvateKinase * atp) + gap) ); pyruvate += rate ; gap -= rate; atp += rate + rate ; adp -= rate + rate; nadh += rate; nad -= rate; #if METABOLISMDEBUG if (printFlag) { printf(" %s: pyruvateKinase rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); PrintValues(); printf(" %s: pyruvateKinase rate: %g\n",organName,rate); exit(1); } /* if */ #endif } void EvaluatePyruvateDehydrogenase () { double x1,rate ; x1 = kmcPyruvateDehydrogenase + kPyruvatePyruvateDehydrogenase * nad + kNadPyruvateDehydrogenase * pyruvate * (1.0 + nadh * kiNadhPyruvateDehydrogenase) ; x1 = pyruvate * nad / x1 ; rate = k2PyruvateDehydrogenase * pyruvateDehydrogenase * x1 / (1.0 + x1) ; pyruvate -= rate ; nadh += rate; nad -= rate; acetylCoenzymeA += rate ; #if METABOLISMDEBUG if (printFlag) { printf(" %s: pyruvateDehydrogenase rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); PrintValues(); printf(" %s: pyruvateDehydrogenase rate: %g\n",organName,rate); exit(1); } /* if */ #endif } void EvaluateIsocitrateDehydrogenase () { double x1,rate ; x1 = kNadIsocitrateDehydrogenase * acetylCoenzymeA + kAcoaIsocitrateDehydrogenase * nad * (1.0 + nadh * kiNadhIsocitrateDehydrogenase) ; x1 = acetylCoenzymeA * nad / x1 ; rate = k2IsocitrateDehydrogenase * isocitrateDehydrogenase * x1 / (1.0 + x1) ; acetylCoenzymeA -= rate ; nadh += 3 * rate; nad -= 3 * rate; fadh += rate; fad -= rate; adp -= rate ; atp += rate ; #if METABOLISMDEBUG if (printFlag) { printf(" %s: isocitrateDehydrogenase rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); PrintValues(); printf(" %s: isocitrateDehydrogenase rate: %g\n",organName,rate); exit(1); } /* if */ #endif } void EvaluateAtpSynthase () { double rate ; rate = k2AtpSynthase * atpSynthase * fadh * adp * oxygen ; #if METABOLISMDEBUG if (printFlag) { printf(" %s: atpSynthase(fadh) rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR (oxygen:%g)\n",organName,oxygen); PrintValues(); printf(" %s: atpSynthase(fadh) rate: %g\n",organName,rate); exit(1); } /* if */ #endif fadh -= rate; fad += rate; atp += 3 * rate; adp -= 3 * rate; oxygen -= 0.5 * numberOfCells * rate ; CO2 += 0.5 * numberOfCells * rate ; rate = k2AtpSynthase * atpSynthase * nadh * adp * oxygen ; #if METABOLISMDEBUG if (printFlag) { printf(" %s: atpSynthase(nadh) rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR (oxygen:%g)\n",organName,oxygen); PrintValues(); printf(" %s: atpSynthase(nadh) rate: %g\n",organName,rate); exit(1); } /* if */ #endif nadh -= rate; nad += rate; atp += 3 * rate; adp -= 3 * rate; oxygen -= 0.5 * numberOfCells * rate ; CO2 += 0.5 * numberOfCells * rate ; } void EvaluateAtpAse () { double rate = k2AtpAse * atpAse; atp -= rate; adp += rate; #if METABOLISMDEBUG if (printFlag) { printf(" %s: ATPase rate: %g\n",organName,rate); } /* if */ if (rate < 0) { printf("%s: ERROR\n",organName); PrintValues(); printf(" %s: ATPase rate: %g\n",organName,rate); exit(1); } /* if */ #endif } GenericOrgan(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : t4( newCapillary->FindSubstance("t4", '-') ), t3( newCapillary->FindSubstance("t3", '-') ), glucose(newCapillary->FindSubstance("glucose", '-') ), oxygen(newCapillary->FindSubstance("oxygen", '-') ), CO2(newCapillary->FindSubstance("CO2", '-') ), insulin(newCapillary->FindSubstance("insulin", '-') ), glucagon( newCapillary->FindSubstance("glucagon", '-') ), lactate(newCapillary->FindSubstance("lactate", '-') ), vldl( newCapillary->FindSubstance("vldl", '-') ), ldl(newCapillary->FindSubstance("ldl", '-') ), idl(newCapillary->FindSubstance("idl", '-') ), glycerol( newCapillary->FindSubstance("glycerol", '-') ), aminoAcids( newCapillary->FindSubstance("aminoAcids", '-' ) ), ketones(newCapillary->FindSubstance("ketones", '-' ) ), fattyAcids( newCapillary->FindSubstance("fattyAcids", '-') ), plasmaProteins( newCapillary->FindSubstance("plasmaProteins", '-') ) { double plasmaVolume,bloodVolume; capillary = newCapillary; organName = newOrganName; numberOfCells = newNumberOfCells ; cellVolume = newCellVolume; plasmaVolume = capillary->ReadVolume('P'); bloodVolume = capillary->ReadVolume('T'); k2Hexokinase = 5.8e-3 /* 1/msec */ * dTime ; kmHexokinase = 1500.0e-6 /* umoles/mm3 */ * plasmaVolume ; kiHexokinase = 1.0/83.0e-6 /* mm3/umoles */ * 1.0 / (cellVolume) ; k2Phosphofructokinase = 640.0e-3 /* 1/msec */ * dTime ; kmPhosphofructokinase = 600.0e-6 /* umoles/mm3 */ * cellVolume ; kaPhosphofructokinase = 1.0/(107.0e-6 * 5.0) /* mm3/umoles */ * 1.0 / (cellVolume) ; k2PyruvateKinase = 1375.0e-3 /* 1/msec */ * dTime ; kmPyruvateKinase = 2390.0e-6 /* umoles/mm3 */ * cellVolume ; kiPyruvateKinase = 1.0/(1850.0e-6) /* mm3/umoles */ * 1.0 / (cellVolume) ; k2PyruvateDehydrogenase = 1900.0e-3 /* 1/msec */ * dTime ; kmcPyruvateDehydrogenase = 99.0e-6 * 99.0e-6 /* (umoles/mm3)^2 */ * cellVolume * cellVolume ; kPyruvatePyruvateDehydrogenase = 140.0e-6 /* umoles/mm3 */ * cellVolume ; kNadPyruvateDehydrogenase = 110.0e-6 /* umoles/mm3 */ * cellVolume ; kiNadhPyruvateDehydrogenase = 1.0/(50.0e-6) /* mm3/umoles */ * 1.0 / (cellVolume) ; k2IsocitrateDehydrogenase = 2053.0e-3 /* 1/msec */ * dTime ; kNadIsocitrateDehydrogenase = 340.0e-6 /* umoles/mm3 */ * cellVolume ; kAcoaIsocitrateDehydrogenase = 780.0e-6 /* umoles/mm3 */ * cellVolume ; kiNadhIsocitrateDehydrogenase = 1.0/(20.0e-6) /* mm3/umoles */ * 1.0 / (cellVolume) ; k2AtpSynthase = 100.0e-3 / (180.0e-6 * 138.0e-6 * 8900.0e-6) /* 1/msec */ * dTime / (cellVolume * cellVolume * bloodVolume); k2AtpAse = 20.0e-3 /* 1/msec */ * dTime ; // ResetGenericOrgan(); } int printFlag; char *organName; VesselSegment *capillary ; double cellVolume; double numberOfCells; double glucose6Phosphate ; double gap; double pyruvate; double acetylCoenzymeA ; double atp ; double adp ; double fad ; double fadh ; double nad ; double nadh ; double glycogen; double internalFattyAcids ; double triglycerides ; double protein ; double internalAminoAcids; double malonylCoA; double cholesterol; double hexokinase; double phosphofructokinase; double pyruvateKinase; double pyruvateDehydrogenase; double isocitrateDehydrogenase; double atpSynthase; double atpAse; double &glucose; double &oxygen; double &CO2; double &insulin; double &glucagon; double &lactate; double &vldl; double &ldl; double &idl; double &glycerol; double &ketones; double &aminoAcids; double &fattyAcids; double &plasmaProteins; double &t4; double &t3; double k2Hexokinase ; double kmHexokinase ; double kiHexokinase ; double k2Phosphofructokinase ; double kmPhosphofructokinase ; double kaPhosphofructokinase ; double k2PyruvateKinase ; double kmPyruvateKinase ; double kiPyruvateKinase ; double k2PyruvateDehydrogenase ; double kmcPyruvateDehydrogenase ; double kPyruvatePyruvateDehydrogenase ; double kNadPyruvateDehydrogenase ; double kiNadhPyruvateDehydrogenase ; double k2IsocitrateDehydrogenase ; double kNadIsocitrateDehydrogenase ; double kAcoaIsocitrateDehydrogenase ; double kiNadhIsocitrateDehydrogenase ; double k2AtpSynthase ; double k2AtpAse ; }; class GenericBrain : public GenericOrgan{ public: void Run() ; void Reset () { ResetGenericOrgan(); atpAse = 6.9e-6 * cellVolume; // atpAse = 1.1 * 6.9e-6 * cellVolume; } GenericBrain(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ) { Reset(); } private: }; class GenericLungs : public GenericOrgan{ public: void Run() ; void Reset () { ResetGenericOrgan(); } GenericLungs(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ) { Reset(); } private: }; class GenericMuscle : public GenericOrgan{ public: void Run() ; void Reset () { ResetGenericOrgan(); } GenericMuscle(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ) { Reset(); } private: }; class GenericAdiposeTissue : public GenericOrgan{ public: void Run() ; void Reset () { ResetGenericOrgan(); } GenericAdiposeTissue(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ) { Reset(); } private: }; class GenericTissue : public GenericOrgan { public: void Run() ; void Reset () { ResetGenericOrgan(); } GenericTissue(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ) { Reset(); } private: }; #if 0 class GenericLiver : public GenericOrgan{ public: void Run() ; void PrintValuesTop(int snapFlag) { kupffer.PrintValues(snapFlag) ; PrintValues(snapFlag); } void Reset () { ResetGenericOrgan(); } GenericLiver(VesselSegment *newCapillary, double newCellVolume, double newNumberOfCells, char *newOrganName, double dTime, VesselSegment *newBileDuct, VesselSegment *newOutputLymphDuct, VesselSegment *newInputLymphDuct, double numberOfTCells, double fractionTNaive, double fractionT2Memory, double *newTCellStrain, double numberOfBCells, double fractionBNaive, double fractionBRecirculate, double fractionBMemory, double fractionBCentroblast, double fractionBPlasmaG, double fractionBPlasmaM, double fractionBPlasmaA, double fractionBMarginalZone , double *newBCellStrain, double numberOfAntigen, double *newAntigenStrain, double numberOfDendritic, double *newEmptyStrain, double newk2Input, double newk2LymphInput ,double newk2Output , double numberOfFollicles, double numberOfMacrophages, double newk2Dendritic,double newk2Macrophage, double newk2platelets,double newk2rbc,double newk2macrophageReplicate,double newk2rbcAdjust,double newk2plateletsAdjust ) : GenericOrgan(newCapillary, newCellVolume, newNumberOfCells, newOrganName, dTime ), kupffer(newCapillary, newOutputLymphDuct, newInputLymphDuct, numberOfTCells, fractionTNaive, fractionT2Memory, newTCellStrain, numberOfBCells, fractionBNaive, fractionBRecirculate, fractionBMemory, fractionBCentroblast, fractionBPlasmaG, fractionBPlasmaM, fractionBPlasmaA, fractionBMarginalZone , newBCellStrain, numberOfAntigen, newAntigenStrain, numberOfDendritic, newEmptyStrain, newk2Input, newk2LymphInput, newk2Output , numberOfFollicles, numberOfMacrophages, newk2Dendritic, newk2Macrophage, newk2platelets,newk2rbc,newk2macrophageReplicate,newk2rbcAdjust,newk2plateletsAdjust, newOrganName , dTime ) { bileDuct = newBileDuct; Reset(); } private: VesselSegment *bileDuct; GenericImmuneTissue kupffer; }; #endif class GenericImmuneCell { public: // accessible by all inline void ApcActivateWithoutStrain ( double &source,GenericImmuneCell &control ,double k2, double km, double kn ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * source / (km + control.value[i]) ; value[i] += rate; source -= rate; control.value[i] -= rate * kn; } /* iForLoop */ } inline void ApcActivateWithoutStrain ( GenericImmuneCell &destination,GenericImmuneCell &control, double &controlDestination ,double k2, double km, double kn ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * value[i] / (km + control.value[i]) ; destination.SetProfile(i,profile,rate); value[i] -= rate; destination.value[i] += rate; control.value[i] -= rate * kn; controlDestination += rate * kn; } /* iForLoop */ } inline void ApcActivate ( GenericImmuneCell &destination,GenericImmuneCell &control ,double k2, double km ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * value[i] / (km + control.value[i]) ; destination.SetProfile(i,profile,rate); value[i] -= rate; destination.value[i] += rate; } /* iForLoop */ } inline void ApcDeActivate ( GenericImmuneCell &destination,GenericImmuneCell &control ,double k2, double km ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * value[i] / (1.0 + control.value[i] / km) ; destination.SetProfile(i,profile,rate); value[i] -= rate; destination.value[i] += rate; } /* iForLoop */ } inline void ApcActivate ( GenericImmuneCell &destination,GenericImmuneCell &control ,double k2, double km, double kn1, double kn2 ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * value[i] / (km + control.value[i]) ; destination.SetProfile(i,profile,rate); value[i] -= kn1 * rate; control.value[i] -= kn2 * rate; destination.value[i] += rate; } /* iForLoop */ } inline void Polarization ( GenericImmuneCell &control, double k2PolarizationTh1, double kmPolarizationTh1, double k2PolarizationTh2, double kmPolarizationTh2 ) /* simple for now, just il12 */ { int i; double rate,il12,notil12; for (i = 0; i < TOTALSTRAINS; i++) { il12 = control.value[i] * control.profile[i].value[D_IL12] ; rate = k2PolarizationTh1 * profile[i].value[TH0] * il12 / (kmPolarizationTh1 + il12) ; profile[i].value[TH0] -= rate; profile[i].value[TH1] += rate; notil12 = control.value[i] * (1.0 - control.profile[i].value[D_IL12]) ; rate = k2PolarizationTh2 * profile[i].value[TH0] * notil12 / (kmPolarizationTh2 + notil12) ; profile[i].value[TH0] -= rate; profile[i].value[TH2] += rate; } /* iForLoop */ } inline void RePolarization ( GenericImmuneCell &control, double k2PolarizationTh1, double kmPolarizationTh1, double k2PolarizationTh2, double kmPolarizationTh2 ) /* simple hack for now, just il12 */ { int i; double rate,il12; for (i = 0; i < TOTALSTRAINS; i++) { il12 = control.value[i] * control.profile[i].value[D_IL12] ; rate = k2PolarizationTh1 * profile[i].value[TH2] * il12 / (kmPolarizationTh1 + il12) ; profile[i].value[TH2] -= rate; profile[i].value[TH1] += rate; rate = k2PolarizationTh2 * profile[i].value[TH1] / (kmPolarizationTh2 + il12) ; profile[i].value[TH1] -= rate; profile[i].value[TH2] += rate; } /* iForLoop */ } inline void ClassSwitches ( GenericImmuneCell &tCell, GenericImmuneCell &dendritic, double k2SwitchesIgg, double kmSwitchesIgg, double k2SwitchesIga, double kmSwitchesIga, double kiSwitchesIga, double k2SwitchesIgg1, double kmSwitchesIgg1, double k2SwitchesIge, double kmSwitchesIge) { int i; double rate,il10, interferonGamma,il4; for (i = 0; i < TOTALSTRAINS; i++) { interferonGamma = tCell.value[i] * tCell.profile[i].value[TH1] ; il4 = tCell.value[i] * tCell.profile[i].value[TH2] ; il10 = dendritic.value[i] * dendritic.profile[i].value[D_IL10] ; rate = k2SwitchesIgg * profile[i].value[IGM] * interferonGamma / (kmSwitchesIgg + interferonGamma) ; profile[i].value[IGM] -= rate; profile[i].value[IGG] += rate; rate = k2SwitchesIga * profile[i].value[IGM] * il10 / ((kmSwitchesIga + il10) * (1.0 + il4 / kiSwitchesIga) ) ; profile[i].value[IGM] -= rate; profile[i].value[IGA] += rate; rate = k2SwitchesIgg1 * profile[i].value[IGM] * il4 / (kmSwitchesIgg1 + il4) ; profile[i].value[IGM] -= rate; profile[i].value[IGG] += rate; rate = k2SwitchesIge * profile[i].value[IGG] * il4 / (kmSwitchesIge + il4) ; profile[i].value[IGG] -= rate; profile[i].value[IGE] += rate; } /* iForLoop */ } inline void ActivatePrecursor (GenericImmuneCell &destination, GenericImmuneCell &control, GenericImmuneCell &anergy, double k2, double km ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * value[i] / (km + control.value[i]) ; destination.SetProfile(i,profile,rate); destination.value[i] += rate; anergy.value[i] += value[i] - rate; } /* iForLoop */ ClearValues(); } inline void MigrateCentroblastWithProfile ( GenericImmuneCell &destination,GenericImmuneCell &remains ,double k2) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * value[i] ; if (rate > remains.value[i]) { rate = remains.value[i]; } /* if */ remains.value[i] = 0.0; destination.SetProfile(i,profile,rate); value[i] -= rate; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateAicd ( GenericImmuneCell &control ,double k2, double km, double k0 ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { // rate = value[i] * (k0 + k2 * control.value[i] / (km + control.value[i])) ; rate = value[i] * (k0 ) ; value[i] -= rate; } /* iForLoop */ } inline void Replicate (GenericImmuneCell &destination, double k2, double kReplicate ) { MigrateOutputWithProfile(destination, kReplicate * k2, 1.0 / kReplicate); } inline void ReplicateSpecial (GenericImmuneCell &destination1,GenericImmuneCell &destination2, double k2 ,double kn ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 ; destination1.SetProfile(i,profile,rate * kn); destination2.SetProfile(i,profile,rate * (2.0 - kn)); destination1.value[i] += rate * kn; destination2.value[i] += rate * (2.0 - kn); value[i] -= rate; } /* iForLoop */ } inline void CopyOutputWithProfile (GenericImmuneCell &destination, double k2 ) { MigrateOutputWithProfile(destination, k2, 0.0); } inline void CopyOutputExtractProfile (GenericImmuneCell &destination, double k2, int profileIndex ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 * profile[i].value[profileIndex] ; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateOutputWithProfile (GenericImmuneCell &destination, double k2 ,double kn ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 ; destination.SetProfile(i,profile,rate); value[i] -= kn * rate; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateOutputWithProfile (GenericImmuneCell &destination, double k2 ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 ; destination.SetProfile(i,profile,rate); value[i] -= rate; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateOutputWithProfile ( GenericImmuneCell &destination,GenericImmuneCell &control ,double k2, double kn ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = k2 * control.value[i] * value[i]; destination.SetProfile(i,profile,rate); value[i] -= rate; control.value[i] -= kn * rate; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateOutput (GenericImmuneCell &destination, double k2 ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 ; value[i] -= rate; destination.value[i] += rate; } /* iForLoop */ } inline void MigrateOutput (double k2 ) { int i; double rate; for (i = 0; i < TOTALSTRAINS; i++) { rate = value[i] * k2 ; value[i] -= rate; } /* iForLoop */ } inline void ClearValues () { int i,j; for (i = 0; i < TOTALSTRAINS; i++) { value[i] = 0.0 ; for (j = 0; j < TOTALPROFILES; j++) { profile[i].value[j] = 0.0; } /* jForLoop */ } /* iForLoop */ } inline double ReadTotal ( ) { int i; double rate = 0; for (i = 0; i < TOTALSTRAINS; i++) { rate += value[i]; } /* iForLoop */ return(rate) ; } inline double ReadTotal (int profileIndex ) { int i; double rate = 0; for (i = 0; i < TOTALSTRAINS; i++) { rate += value[i] * profile[i].value[profileIndex]; } /* iForLoop */ return(rate) ; } inline void AddStrain (int index, double rate ) { value[index] += rate; #if 0 if (value[index] < 0.0) { printf("ERROR AddStrain: %s %s: value[%d]:%g rate:%g\n",organName,cellName,index,value[index],rate); exit(1); } /* if */ #endif } inline void SetProfile (int index, profileData *newProfile, double rate ) { int i ; double xTotal,xCurrent,xNew; xTotal = rate + value[index]; if (xTotal) { xCurrent = value[index] / xTotal ; xNew = rate / xTotal ; for (i = 0; i < TOTALPROFILES; i++) { profile[index].value[i] = profile[index].value[i] * xCurrent + newProfile[index].value[i] * xNew; } /* iForLoop */ } /* if */ } inline void AddStrain (int index, profileData *newProfile, double rate ) { SetProfile(index,newProfile,rate); value[index] += rate; } inline double ReadValue (int index) { return(value[index]) ; } inline double ReadValueWithProfile (int index, int profileIndex) { return(value[index] * profile[index].value[profileIndex]) ; } inline char *ReadName () { return(cellName) ; } static void ResetPrint(int val){printFlag = val;} static void CopyProfile(profileData *destinationProfile, profileData *initialProfile) { int i,j; for (i = 0; i < TOTALSTRAINS; i++) { for (j = 0; j < TOTALPROFILES; j++) { destinationProfile[i].value[j] = initialProfile[i].value[j]; } /* jForLoop */ } /* iForLoop */ } void ResetImmuneCell(ImmuneSubstance numberOfCells, profileData *initialProfile, char *newCellName,char *newOrganName) { int i; printFlag = 0; cellName = newCellName; organName = newOrganName; if (value == 0) { value = new double[TOTALSTRAINS ]; } /* if */ for (i = 0; i < TOTALSTRAINS; i++) { value[i] = numberOfCells[i]; } /* iForLoop */ CopyProfile(profile, initialProfile); } void PrintValues (int snapFlag){ Snapshot(); } void Snapshot ( ) { int i,j ; double totalValue; printf("%s %s {",organName,cellName); for (i = 0, totalValue = 0.0; i < TOTALSTRAINS; i++) { printf(" %g(",value[i]); totalValue += value[i]; for (j = 0; j < TOTALPROFILES; j++) { printf(" %g",profile[i].value[j]); } /* jForLoop */ printf(" )"); } /* iForLoop */ printf(" } totalValue:%g\n",totalValue); } GenericImmuneCell( ) { static double temporary[TOTALSTRAINS]; static profileData temporaryprofile[TOTALSTRAINS]; value = 0; ResetImmuneCell(temporary,temporaryprofile,"x","x"); } private: // accessible by this class only static int printFlag; char *cellName; char *organName; ImmuneSubstance value ; profileData profile[TOTALSTRAINS]; protected: // accessible by subclass }; int GenericImmuneCell::printFlag = 0; class GenericImmuneTissue { public: // accessible by all void PrintValues (int snapFlag); void GenericImmuneTissue::ExecuteLymphJunction (); void GenericImmuneTissue::ExecuteBoneMarrow (); void GenericImmuneTissue::ExecuteLymphNode ( ); void GenericImmuneTissue::ExecuteSpleen (); void GenericImmuneTissue::ExecuteLiver (); void GenericImmuneTissue::ExecuteLungs () ; void GenericImmuneTissue::ExecuteIntestines () ; void GenericImmuneTissue::ExecuteBronchialTest (); void GenericImmuneTissue::ExecuteGeneralTissue (); void GenericImmuneTissue::ExecuteLymphNodeGeneral (); void GenericImmuneTissue::ExecuteLymphNodeInternal () ; void GenericImmuneTissue::ExecuteInfusion (int infusionFlag); void GenericImmuneTissue::ExecutePeyersPatch (); void GenericImmuneTissue::ExecuteLaminaProperia (); GenericImmuneTissue(VesselSegment *newCapillary, VesselSegment *newInputLymphDuct, VesselSegment *newOutputLymphDuct, VesselSegment *newbloodReservoir, double newWeight, double newVolume, char *newModelName, char *newOrganName ,double newdTime ); private: // accessible by this class only static ImmuneSubstance BuildStrain(ImmuneSubstance input, double value) { static double temporary[TOTALSTRAINS] ; int i ; for (i = 0; i < TOTALSTRAINS; i++) { temporary[i] = input[i] * value; } /* iForLoop */ return(temporary) ; } static int FindTissueIndex (char *s); static double CalculateHalfLifeConstant(double value) /* value = half life in hours */ { double x1 ; x1 = value * 3.6e6 / stepTime ; x1 = 1.0 / x1 ; return(1.0 - pow(.5,x1)) ; } static double CalculateMigrateFlowConstant(double value, double volume) /* value = ul/sec, volume = ul */ { return(CalculateK2Constant(value) / volume) ; } static double CalculateKmConstant(double value, double volume, char *volumeUnits) /* value = umoles/volumeUnits, volume = ul, volumeUnits: "ml" or "ul" */ { if (volumeUnits[0] == 'm') { return(value * volume / 1000.0) ; } /* if */ if (volumeUnits[0] == 'u') { return(value * volume) ; } /* if */ fprintf(stderr,"CalculateKmConstant: error: volumeUnits:%s\n",volumeUnits); exit(1) ; return(0) ; } static double CalculateK2Constant(double value) /* value = 1/sec */ { return(value * stepTime / (1000.0)) ; } int printFlag; char *organName; char *modelName; static double stepTime ; VesselSegment *outputLymphDuct ; VesselSegment *inputLymphDuct ; VesselSegment *capillary ; VesselSegment *bloodReservoir ; /* hack: for now: speeds up blood flow Calculations */ /* t half life */ double k2MacrophageDie ; double k2DendriticDie; double kibCellRecirculateDie; double k2bCellRecirculateDie ; double k2bCellNaiveFollicle; double kibCellNaiveFollicle; double k2bCellNaiveDie ; double k2thNaiveDie; double k2tcNaiveDie; double kHalfLifeIgA; double kHalfLifeGmcsf; double kHalfLifeTnfAlpha; /* generation constants */ double kGenerateTnfAlpha; double kGenerateTcCells; double kGenerateBCells; double kGenerateThCells; double kGeneratePlatelets ; double kGenerateRbc; double kGenerateMonocyte ; double knGenerateMonocyte; double kmGenerateMonocyte; double k2LymphJunction; double kGenerateGmcsf; /* external migration constants */ double k2BloodInput_bCellNaiveRecirculate; double k2BloodInput_bCellNaive; double k2BloodInput_thNaive; double k2BloodInput_tcNaive; double k2BloodInput_tcEffector; double k2BloodInput_Dendritic; double k2BloodInput_Macrophage; double k2BloodInput_rbc; double k2BloodInput_platelets; double k2BloodInput_thEffector; double k2BloodOutput_bCellNaive; double k2BloodOutput_bCellNaiveRecirculate; double k2BloodOutput_thNaive; double k2BloodOutput_tcNaive; double k2LymphInput_bCellNaiveRecirculate; double k2LymphInput_macrophageApc; double k2LymphInput_dendriticApc; double k2LymphOutput_bCellNaiveRecirculate; double k2LymphOutput_tcEffector; double k2LymphOutput_macrophageApc; double k2LymphOutput_dendriticApc; double k2LymphOutput_thNaive; double k2LymphOutput_tcNaive; double k2LymphOutput_thEffector; double k2LymphOutput_igM; /* influenza constants */ double k2MucociliaryClearance; double k2InfluenzaNeutralize; double knInfluenzaNeutralize; double k2EpitheliaReplication; double k2EpitheliaInfection; double knEpitheliaInfection; double k2EpitheliaResistive; double knEpitheliaResistive; double k2EpitheliaDie; double k2EpitheliaResistiveDie; double k2EpitheliaApcDie; double k2VirusReplication; double k2EffectorKill; double knEffectorKill; double k2MacrophageInfection; double knMacrophageInfection; double k2GenerateInterferonAlpha; double kHalfLifeInterferonAlpha; double k2DendriticInfection; double knDendriticInfection; double knInflammatory ; double knMonocyteInflammatory ; double kmInflammatory; double knInflammatoryOutput ; double kmInflammatoryOutput; double k2tcAicd; double kmtcAicd; double k0tcAicd; double k2thAicd; double kmthAicd; double k0thAicd; double k2DendriticReplicate; /* Internal lymphNode constants */ double k2TcNaiveActivate; double kmTcNaiveActivate; double kHalfLifeIl2; double k2BlastIl2; double k2TcBlastPrecursorActivate; double kmTcBlastPrecursorActivate; double k2TcPrecursorCount; double kmTcPrecursorCount; double kTcBlastReplicate; double k2EffectorPrecursorIl2; double k2EffectorPrecursorIl2Autocrine; double kHalfLifeDendriticApc; double k2macrophageReplicate; double knbCellCentrocyteInitialActivate; double k2Centrocyte2PlasmaCell; double knFdcApc; double k2immuneComplex; double knimmuneComplex; double kHalfLifeMacrophageApc; double k2EffectorKillDendritic; double knMacrophageApc; double k2Centrocyte2Centroblast; double k2Effector2GerminalCenter ; double kHalfLifeThGerminalCenter ; double kHalfLifePlasmaCell ; double k2FdcApc; double kmFdcApc; double k2PolarizationTh1; double kmPolarizationTh1; double k2PolarizationTh2; double kmPolarizationTh2; double k2SwitchesIgg; double kmSwitchesIgg; double k2SwitchesIga; double kmSwitchesIga; double kiSwitchesIga; double k2SwitchesIgg1; double kmSwitchesIgg1; double k2SwitchesIge; double kmSwitchesIge; double k2BloodInputPlasmaCell; double k2IgaProduction; double k2ThNaiveActivate; double kmThNaiveActivate; double k2thBlastPrecursorActivate; double kmthBlastPrecursorActivate; double k2thPrecursorCount; double kmthPrecursorCount; double kthBlastReplicate; double k2bCellNaiveRecirculateActivate; double kmbCellNaiveRecirculateActivate; double kHalfLifebCellApc; double k2bCellApcActivate; double kmbCellApcActivate; double kbCentroblastReplicate; double kbCentroblastReplicateInitial; double kHalfLifebCellCentroblast; double k2Centroblast2Centrocyte; double k2bCellCentrocyteInitialActivate; double kmbCellCentrocyteInitialActivate; double k2bCellCentrocyteActivate; double kmbCellCentrocyteActivate; double kHalfLifebCellCentrocyteInitial; double kHalfLifebCellCentrocyteApc; double kHalfLifebCellCentrocyte; double k2LymphOutput_plasmaCell; double kbPlasmaReplicateInitial; double kbPlasmaReplicate; double k2PlasmaMedullary2IgM; double kHalfLifebCellPlasmaMedullary; double k2TcEffector2Memory; double kmTcEffector2Memory; double k2ThEffector2Memory; double kmThEffector2Memory; double k2LymphOutput_bCellMemory; double k2LymphOutput_thMemory; double k2LymphOutput_tcMemory; double k2BloodInput_bCellMemory; double k2BloodInput_thMemory; double k2BloodInput_tcMemory; double k2LymphInput_bCellMemory; double k2LymphInput_thMemory; double k2LymphInput_tcMemory; double k2BloodOutput_bCellMemory; double k2BloodOutput_thMemory; double k2BloodOutput_tcMemory; double k2TcMemoryActivate; double kmTcMemoryActivate; double k2TcPrecursorCountMemory; double kmTcPrecursorCountMemory; double kTcBlastReplicateMemory; double k2ThMemoryActivate; double kmThMemoryActivate; double k2thPrecursorCountMemory; double kmthPrecursorCountMemory; double kthBlastReplicateMemory; double k2bCellMemoryMarginalActivate; double kmbCellMemoryMarginalActivate; double k2bCellMemoryActivate; double kmbCellMemoryActivate; double kHalfLifebCellApcMemory; double k2bCellApcMemoryActivate; double kmbCellApcMemoryActivate; double kbCentroblastReplicateInitialMemory; double k2Centrocyte2bCellMemory; double k2Centrocyte2bCellMemoryMarginal; double kbPlasmaReplicateInitialMemory; double k2ThPrecursorCountMemory; double kmThPrecursorCountMemory; double &bloodmonocyte; double &bloodplatelets; double &bloodrbc; double &bloodgmcsf; GenericImmuneCell &bloodigM; GenericImmuneCell &bloodigA; GenericImmuneCell &bloodigG; GenericImmuneCell &bloodThNaive ; GenericImmuneCell &bloodTcNaive ; GenericImmuneCell &bloodtcEffector ; GenericImmuneCell &bloodthEffector ; GenericImmuneCell &bloodbCellNaive ; GenericImmuneCell &bloodbCellNaiveRecirculate ; GenericImmuneCell &bloodplasmaCell; GenericImmuneCell &lymphInputmacrophageApc ; GenericImmuneCell &lymphInputdendriticApc ; GenericImmuneCell &lymphInputbCellNaiveRecirculate ; GenericImmuneCell &lymphInputtcEffector ; GenericImmuneCell &lymphInputthEffector ; GenericImmuneCell &lymphOutputigM; GenericImmuneCell &lymphOutputigA; GenericImmuneCell &lymphOutputigG; GenericImmuneCell &lymphOutputmacrophageApc ; GenericImmuneCell &lymphOutputdendriticApc ; GenericImmuneCell &lymphOutputbCellNaiveRecirculate ; GenericImmuneCell &lymphOutputplasmaCell; GenericImmuneCell &lymphOutputThNaive ; GenericImmuneCell &lymphOutputTcNaive ; GenericImmuneCell &lymphOutputtcEffector ; GenericImmuneCell &lymphOutputthEffector ; GenericImmuneCell &bloodbCellMemory; GenericImmuneCell &bloodthMemory; GenericImmuneCell &bloodtcMemory; GenericImmuneCell &lymphInputbCellMemory; GenericImmuneCell &lymphInputthMemory; GenericImmuneCell &lymphInputtcMemory; GenericImmuneCell &lymphOutputbCellMemory; GenericImmuneCell &lymphOutputtcMemory; GenericImmuneCell &lymphOutputthMemory; double adjustTcBlast; double adjustTcBlastMemory; double bPlasmaCount; double bPlasmaDCount; double bBlastCount; double bBlastDCount; double numberOfGerminalCenters; double tcBlastCount; double tcBlastDCount; double tcPrecursorCount; double thEffectorPrecursorTotal; double th2EffectorPrecursorTotal; double tcBlastPrecursorTotal ; double thBlastPrecursorTotal ; double thBlastCount; double thBlastDCount; double thPrecursorCount; double tZoneVolume; double epitheliumvolume; GenericImmuneCell antigen; GenericImmuneCell antigenBal; GenericImmuneCell bCellBlast; GenericImmuneCell bCellCentrocyteApc; GenericImmuneCell bCentroblastPrecursor[NUMBEROFBCENTROBLASTPRECURSOR]; GenericImmuneCell bCellDeadCentroblast; GenericImmuneCell bCellNaive; GenericImmuneCell bCellNaiveMarginalZone; GenericImmuneCell bCellNaiveRecirculate; GenericImmuneCell bCellCentroblast; GenericImmuneCell bCellCentrocyteInitial; GenericImmuneCell bCellCentrocyte; GenericImmuneCell bPlasmaPrecursor[NUMBEROFBPLASMAPRECURSOR]; GenericImmuneCell bCellPlasmaMedullary; GenericImmuneCell bCellApc; GenericImmuneCell dendriticApc; double dendriticImmature; double dendriticImmatureInitial; double epitheliaResistive; double epitheliaApc; double epitheliaCell; double epitheliaDead; double fdcGerminalCenters; GenericImmuneCell fdcApc; double interferonAlpha; double il2; double inflammatoryRate; double inflammatoryMonocyteRate; double inflammatoryOutputRate; double inflammatoryDendriticOutputRate; GenericImmuneCell igM; GenericImmuneCell igaBal; GenericImmuneCell immuneComplex; double macrophage; double macrophageInitial; GenericImmuneCell macrophageApc; GenericImmuneCell plasmaCell; GenericImmuneCell tcEffector; GenericImmuneCell tcNaive; GenericImmuneCell tcBlastPrecursor[NUMBEROFTCBLASTPRECURSOR]; GenericImmuneCell tcBlast; GenericImmuneCell tcAnergy; GenericImmuneCell tcEffectorPrecursor[NUMBEROFTCEFFECTORPRECURSOR]; GenericImmuneCell thBlastPrecursor[NUMBEROFTHBLASTPRECURSOR]; GenericImmuneCell thGerminalCenter; GenericImmuneCell thNaive; GenericImmuneCell thBlast ; GenericImmuneCell thAnergy; GenericImmuneCell thEffectorPrecursor[NUMBEROFTHEFFECTORPRECURSOR]; GenericImmuneCell thEffector; double tnfAlpha; GenericImmuneCell virtualThEffector; double thEffectorPrecursorTotalMemory; double th2EffectorPrecursorTotalMemory; double tcPrecursorCountMemory; double thPrecursorCountMemory; GenericImmuneCell bCellMemory; GenericImmuneCell bCellMemoryMarginal; GenericImmuneCell thMemory; GenericImmuneCell tcMemory; GenericImmuneCell tcBlastMemory; GenericImmuneCell tcEffectorPrecursorMemory[NUMBEROFTCEFFECTORPRECURSORMEMORY]; GenericImmuneCell thBlastMemory; GenericImmuneCell thEffectorPrecursorMemory[NUMBEROFTHEFFECTORPRECURSORMEMORY]; GenericImmuneCell virtualThEffectorMemory; GenericImmuneCell bCellApcMemory; GenericImmuneCell bCellBlastMemory; profileData kDendriticInfectionProfile[TOTALSTRAINS]; /* --------------------------------------- */ double &bloodil3; double &bloodil5; double &bloodeosinophil; double &bloodmastCell; double il3inflammatoryRate; double il5inflammatoryRate; double thMemoryActivateCount; double dthMemoryActivateCount; double histamine; double mastCellNaive; double eosinophil; double ltc4; double fev1; double il3; double il5; GenericImmuneCell mastCell; GenericImmuneCell mastCellDegranulate; GenericImmuneCell ige; GenericImmuneCell thMemoryBlast[NUMBEROFTHMEMORYACTIVATE]; double kbPlasmaReplicateDecision; double knInflammatoryDendriticOutput; double kHalfLifeil3; double kHalfLifeil5; double kGenerateeosinophil; double knGenerateeosinophil; double kmGenerateeosinophil; double kGeneratemastCell; double knGeneratemastCell; double kmGeneratemastCell; double kHalfLifeIgE; double knInflammatoryil3; double knInflammatoryil5; double k2IgeProduction; double kGenerateIl3; double kGenerateIl5; double kHalfLifehistamine; double k2mastCellAllergy; double kn1mastCellAllergy; double kn2mastCellAllergy; double k2mastCellNaive; double knmastCellNaive; double kHalfLifemastCellNaive; double kHalfLifemastCellDegranulate; double kHalfLifemastCell; double k2BloodInput_mastCell; double k2BloodInput_eosinophil; double k2eosinophilLtc4; double kmeosinophilLtc4; double kHalfLifeltc4; double kHalfLifeeosinophil; double kltc4multiplier; double k2fev1; double kmfev1; profileData kDendriticAllergyProfile[TOTALSTRAINS]; double kthBlastActivateMemory ; double kTransferil3; double kTransferil5; protected: // accessible by subclass }; class GenericBody { public: void Run() ; GenericBody(double stepTime1,double maximumTime,double plotInterval); private: void GenericBody::ExecuteInfusion (); void GenericBody::ResetSystem (); void GenericBody::Snapshot (double temp2); void GenericBody::PrintSubstances (double temp2); void GenericBody::PrintValues (int snapFlag); void GenericBody::PlotValues (double temp2); double stepTime; double maximumTime ; double plotInterval ; int numberOfBloodVessels; GenericImmuneTissue *hepaticLymphNode; GenericImmuneTissue *subcutaneousLymphNode; GenericImmuneTissue *miscellaneousLymphNode; GenericImmuneTissue *mediastinalLymphNode; GenericImmuneTissue *mesentericLymphNode; GenericImmuneTissue *mesentericTestLymphNode; GenericImmuneTissue *spleen; GenericImmuneTissue *boneMarrow; GenericImmuneTissue *lymphJunction; GenericImmuneTissue *liver; GenericImmuneTissue *skin; GenericImmuneTissue *miscellaneousTissue; GenericImmuneTissue *respiratoryTract; GenericImmuneTissue *intestines; GenericImmuneTissue *bronchialTest; GenericImmuneTissue *bronchialLymphNode; GenericImmuneTissue *peyersPatchTest; GenericImmuneTissue *laminaProperiaTest; GenericMouth *mouth; GenericEsophagus *esophagus; GenericSmallIntestine *smallIntestine; GenericStomach *stomach; GenericKidney *kidney; GenericSphincterOfOddi *sphincterOfOddi; // GenericLiver *liver; GenericTissue *otherTissue; GenericAdiposeTissue *adiposeTissue; GenericMuscle *muscle; GenericBrain *brain; GenericLungs *lungs; GenericPancreas *pancreas; GenericHypothalamus *hypothalamus; GenericPituitary *pituitary; GenericThyroid *thyroid; GenericAdrenal *adrenal; VesselSegment *vessels ; };