BioinstSim  2
 All Classes Functions Variables
celldatacontainers.h
1 #ifndef CELLDATACONTAINERS_H
2 #define CELLDATACONTAINERS_H
3 
4 /******************************************************************************/
5 /******************************************************************************/
6 #include <list>
7 //#include "robotagent_optimised.h"
8 #include "crminrobotagent_optimised.h"
9 /******************************************************************************/
10 /******************************************************************************/
11 
12 using namespace std;
13 
14 /******************************************************************************/
15 /******************************************************************************/
16 
18 
19 /******************************************************************************/
20 /******************************************************************************/
21 struct structTcell; struct structAPC;
22 enum ConjugationIntegrationPhase : unsigned;
23 enum TcellIntegrationPhase : unsigned;
24 /******************************************************************************/
25 /******************************************************************************/
26 
27 struct structConj
28 {
29  bool deadconjugate;
30  unsigned int utcellFV, uapcFV;
31 
32  double affinity;
33  double fConjugates, fEffectorConjugates, fRegulatorConjugates;
34 
35  double fConjugates_k0, fConjugates_k1; // for the computation of conjugates in QSS
36  double fDelta_k0, fDelta_k1; // for the computation of conjugates in QSS
37 
38  structTcell* ptrTcell;
39  structAPC* ptrAPC;
40 
41  structConj(structTcell* tc, structAPC* apc, double cross_affinity);
42 
43  double GetConjugate(ConjugationIntegrationPhase CONJK);
44  void SetConjugate(ConjugationIntegrationPhase CONJK, double conj);
45  double GetConjugateDelta(ConjugationIntegrationPhase CONJK);
46  void SetConjugateDelta(ConjugationIntegrationPhase CONJK, double conjdelta);
47 };
48 
49 /******************************************************************************/
50 /******************************************************************************/
51 
53 {
54  unsigned int uFV;
55 
56  double fE, fR;
57  double fE_prev, fR_prev;
58 
59  double fFreeTcells;
60 
61  // predicted number of cells at time t+step with Euler and Huen methods
62  double fE_Eu, fR_Eu, fE_Hu, fR_Hu;
63 
64  // the slopes at time = t and time = t+step
65  double fDeltaE_k0, fDeltaR_k0, fDeltaE_k1, fDeltaR_k1;
66  structAPC* ptrAPCWithAffinity1; // maintain a pointer to apc with highest affinity - for fast accesss when logging data
67 
68  list<structConj*> listPtrstoConjugatesofTcell;
69 
70  structTcell(unsigned int fv, double seedE, double seedR, structAPC* ptrAPC);
71  ~structTcell();
72 
73  double GetE(TcellIntegrationPhase K);
74  void SetE(TcellIntegrationPhase K, double e);
75 
76  double GetR(TcellIntegrationPhase K);
77  void SetR(TcellIntegrationPhase K, double r);
78 
79  void GetDelta(TcellIntegrationPhase K, double *deltaE, double *deltaR);
80  void SetDelta(TcellIntegrationPhase K, double deltaE, double deltaR);
81 };
82 
83 /******************************************************************************/
84 /******************************************************************************/
85 
86 struct structAPC
87 {
88  unsigned int uFV;
89  double fAPC;
90  double fAvailableSites, fTotalSites;
91  double fTotalConjugates; // total number of conjugates on apc. used to speed up rescaling of conjugates (upon overflow); and in its computation when assuming tcells in excess of apcs sites
92 
93  double fEffectorConjugatesPerAPC, fRegulatorConjugatesPerAPC;
94  double fE_weightedbyaffinity, fR_weightedbyaffinity;
95 
96  // used in the computation of conjugates when assuming excess of t-cells
97  double f_tcellsweightedaffinity_tmp, f_ecellsweightedaffinity_tmp, f_rcellsweightedaffinity_tmp;
98 
99  list<structConj> listConjugatesonAPC;
100 // unsigned int uMostWantedListState;
101 
102  structAPC(unsigned int fv, double apc, double sites);
103  ~structAPC();
104 
105  // updates the list of conjugates for a given apc
106  // returns the number of fp operations
107  unsigned UpdateConjugateList(list<structTcell>* tcells, double cross_affinity);
108 };
109 
110 /******************************************************************************/
111 /******************************************************************************/
112 
113 #endif // CELLDATACONTAINERS_H