1 #ifndef CRMINROBOTAGENT_H
2 #define CRMINROBOTAGENT_H
10 #include "featurevector.h"
12 #include "robotagent.h"
17 #define CELLLOWERBOUND 1e-3 //todo: set as percentage instead of absolute value
20 #define CONJUGATION_OVERFLOW_LIMIT 1.0e-15 //todo: set as percentage instead of absolute value
42 virtual double GetCurrE(
unsigned thtype);
43 virtual double GetCurrR(
unsigned thtype);
45 virtual void SetCurrE(
unsigned thtype,
double f_currE);
46 virtual void SetCurrR(
unsigned thtype,
double f_currR);
48 virtual double GetAPC(
unsigned apctype);
50 virtual double FreeThCells(
double* E,
double* R,
double** C,
unsigned int thtype);
51 virtual double AvailableBindingSites(
double** C,
unsigned int apctype);
53 virtual double Factorial(
double val);
54 virtual double Combination(
double N,
double R);
55 virtual double Hyp(
double N,
double No,
double M,
double L);
57 virtual void ConjugatesQSS(
double* E,
double* R,
double** C);
58 virtual void Derivative(
double* E,
double* R,
double** C,
double* deltaE,
double* deltaR);
60 virtual double GetFVtoApcScaling();
62 virtual bool GetConvergenceFlag();
64 virtual double GetConvergenceError();
65 virtual double GetConvergenceError_Perc();
67 virtual void PrintCRMDetails(
unsigned id);
69 virtual void SimulationStepUpdatePosition();
71 void ScaleDownConjugates(
double** f_Conjugates);
73 double* m_pfSumEffectorsWeightedbyAffinity;
74 double* m_pfSumRegulatorsWeightedbyAffinity;
77 static unsigned int GetNumberOfSetBits(
unsigned int x);
83 static double NormalizedAffinity(
unsigned int v1,
unsigned int v2);
84 static double NegExpDistAffinity(
unsigned int v1,
unsigned int v2,
double k);
86 virtual void UpdateState();
94 virtual double GetWeight();
97 double step_h;
double conjstep_h;
111 double m_fTryExchangeProbability;
114 double* m_pfEffectors;
115 double* m_pfRegulators;
116 double* m_pfEffectors_prev;
117 double* m_pfRegulators_prev;
123 double* m_pfEffectors_Eu;
124 double* m_pfRegulators_Eu;
126 double* m_pfEffectors_Hu;
127 double* m_pfRegulators_Hu;
129 double* m_pfDeltaEffectors_k0;
130 double* m_pfDeltaRegulators_k0;
131 double* m_pfDeltaEffectors_k1;
132 double* m_pfDeltaRegulators_k1;
135 double** m_pfDeltaConjugates_k0;
136 double** m_pfDeltaConjugates_k1;
137 double** m_pfConj_tmp_Eu;
138 double** m_pfConj_tmp_Hu;
141 unsigned int m_unNumberOfReceptors;
143 double** m_pfConjugates;
144 double** m_pfConjugates_tmp;
145 double** m_pfConjugates_Eu;
147 double** m_pfEffectorConjugates;
148 double** m_pfRegulatorConjugates;
149 double* m_pfEffectorConjugatesPerAPC;
150 double* m_pfRegulatorConjugatesPerAPC;
152 double** m_pfAffinities;
157 double m_fAttackProbability;
159 double m_fcross_affinity;
165 double m_fFVtoApcscaling;
167 bool m_bConvergenceFlag;
168 double m_dconvergence_error;
169 double m_dpercconvergence_error;
176 #endif // CRMINROBOTAGENT_H