00001 #ifndef NG_ENVIRONMENT_HH_
00002 #define NG_ENVIRONMENT_HH_
00003
00004 #include <math.h>
00005
00006 #include "../cell/cell.hh"
00007
00008
00009 class AgentCell;
00010
00011 class Environment
00012 {
00013 public:
00014
00015 Environment();
00016 virtual ~Environment() {};
00017
00018 virtual double getLigConc(double xPos, double yPos, double zPos, double time);
00019
00020 virtual void getStartPosition(int cellNumber, double pos[3]);
00021
00022
00023 virtual void tryToMove(
00024 double p[3],
00025 double p2[3],
00026 double u[3],
00027 double up[3]);
00028
00029 virtual bool isInCap(AgentCell *c) { return false; };
00030
00031 protected:
00032
00033 };
00034
00035 class ConstantEnvironment : public Environment
00036 {
00037 public:
00038
00039 ConstantEnvironment(double ligandConc);
00040 ~ConstantEnvironment() {};
00041
00042 virtual double getLigConc(double xPos, double yPos, double zPos, double time);
00043 virtual void tryToMove(
00044 double p[3],
00045 double p2[3],
00046 double u[3],
00047 double up[3]);
00048 void setLigConc(double ligandConc) {this->ligandConc=ligandConc;};
00049
00050 protected:
00051 double ligandConc;
00052 };
00053
00054
00055
00056
00057 class LinearEnvironment : public Environment
00058 {
00059 public:
00060 LinearEnvironment() {
00061 this->slope=pow(10,-6.5);
00062 this->intercept=0;
00063 };
00064 LinearEnvironment(double slope, double intercept) {
00065 this->slope=slope;
00066 this->intercept=intercept;
00067 };
00068 ~LinearEnvironment() {};
00069
00070 virtual double getLigConc(double xPos, double yPos, double zPos, double time) {
00071
00072 double conc = slope*zPos+intercept;
00073 if(conc<0) return 0;
00074 return conc;
00075 };
00076
00077 virtual void getStartPosition(int cellNumber, double pos[3]);
00078
00079 virtual void tryToMove(
00080 double p[3],
00081 double p2[3],
00082 double u[3],
00083 double up[3]) {};
00084
00085
00086 protected:
00087 double slope;
00088 double intercept;
00089 };
00090
00091
00092
00093 #endif
00094