Page MenuHomec4science

collierSignaling.hpp
No OneTemporary

File Metadata

Created
Sat, Nov 16, 16:32

collierSignaling.hpp

#ifndef __COLLIER_SIGNALING_HPP__
#define __COLLIER_SIGNALING_HPP__
#include "cellInteraction.hpp"
class CollierCoupling{
protected:
struct fparams {
double amp;
double hdeg;//a^deg
double deg;
public:
void init_hill(double amp, double half,double deg){
this->amp=amp;this->deg=deg;this->hdeg=pow(half,deg);}
void init_cauchy(double amp, double half,double deg){
this->amp=amp;this->deg=deg;this->hdeg=half;}
} fhp,ghp;
public:
virtual void init(){}
virtual double f_func(double x){}
virtual double g_func(double x){}
void init_fhill(double amp, double half, double deg){fhp.init_hill(amp,half,deg);}
void init_ghill(double amp, double half, double deg){ghp.init_hill(amp,half,deg);}
double f_hill(double x)
{double xh = pow(x,fhp.deg);return fhp.amp*xh/(xh+fhp.hdeg);}
double g_hill(double x)
{double xh = pow(x,ghp.deg);return ghp.amp*ghp.hdeg/(xh+ghp.hdeg);}
double f_cauchy(double x){return fhp.amp*(0.5+1/PI*atan((x-fhp.hdeg)/fhp.deg));};
double g_cauchy(double x){return ghp.amp*(0.5-1/PI*atan((x-ghp.hdeg)/ghp.deg));};
void set_hill_params(double amp, double half,double deg)
{fhp.amp=amp;fhp.deg=deg;fhp.hdeg=pow(half,deg);}
};
class HillCoupling : public CollierCoupling{
public:
virtual void init(){fhp.init_hill(1.0,0.2,3.0);ghp = fhp;}
virtual double f_func(double x){return f_hill(x);}
virtual double g_func(double x){return g_hill(x);}
};
class HillCauchyCoupling : public CollierCoupling{
public:
virtual void init(){
fhp.init_hill(pow(10,0.6139),pow(10,-3.8524),pow(10,-0.2898));
ghp.init_cauchy(pow(10,-1.0172),pow(10,-0.3977),0.0001);}
// fhp.init_hill(pow(10,0.4776),pow(10,0.3368),pow(10,-0.0255));
// ghp.init_cauchy(pow(10,3.4735),pow(10,-1.1613),pow(10,-3.9395));}
// fhp.init_hill(pow(10,0.6451),pow(10,-2.1288),pow(10,-0.0841));
// ghp.init_cauchy(pow(10,-1.5871),pow(10,-0.8284),pow(10,-1.4132));}
virtual double f_func(double x){return f_hill(x);}
virtual double g_func(double x){return g_cauchy(x);}
};
template<class Coupling>
class CollierSignaling : public CellInteraction {
protected:
std::vector<double> m_notch; // notch level for each cell
std::vector<double> m_delta; //delta level for each cell
double v;
Coupling coupling;
public:
CollierSignaling();
virtual void operator() (const state_type &y, state_type &dydt,double t);
float getWeight(Boundary *b,const state_type &y);
// void initState(double *signal);
void initState(state_type &state, double *signal);
void fromState(const state_type& state);
virtual void updateState(state_type& s);
virtual void setLattice(Lattice *lat){lattice=lat;
m_delta.resize(lat->getNbCells());m_notch.resize(lat->getNbCells());}
virtual void updateSignal(const state_type& state);
virtual void fillVector(double *v,int i)const;
virtual uint getOutputNumber()const{return 1;}
virtual std::pair<int,int> getOutputSize(int i=0)const{
return std::make_pair(2,m_delta.size());}
virtual uint cellStateDim()const;
virtual double delaminationScore(Boundary *bo);
};
#endif

Event Timeline