36 #include "RandomNumberGenerator.hpp" 37 #include "VesselSegment.hpp" 39 #include "Owen2011SproutingRule.hpp" 40 #include "Owen11Parameters.hpp" 42 template<
unsigned DIM>
45 mHalfMaxVegf(
Owen11Parameters::mpVegfConventrationAtHalfMaxProbSprouting->GetValue(
"Owen2011SproutingRule")),
56 template <
unsigned DIM>
63 template<
unsigned DIM>
69 template<
unsigned DIM>
75 template<
unsigned DIM>
80 EXCEPTION(
"A regular grid is required for this type of sprouting rule.");
85 EXCEPTION(
"A vessel network is required for this type of sprouting rule.");
92 std::vector<boost::shared_ptr<VesselNode<DIM> > > sprouts;
95 for(
unsigned idx = 0; idx < rNodes.size(); idx++)
97 if(rNodes[idx]->GetNumberOfSegments() != 2)
105 if(rNodes[idx]->GetSegment(0)->GetVessel()->GetClosestEndNodeDistance(rNodes[idx]->rGetLocation())< this->
mVesselEndCutoff)
109 if(rNodes[idx]->GetSegment(1)->GetVessel()->GetClosestEndNodeDistance(rNodes[idx]->rGetLocation())< this->
mVesselEndCutoff)
118 bool too_close =
false;
119 for(
unsigned jdx=0; jdx<sprouts.size(); jdx++)
133 unsigned grid_index = this->
mpGrid->GetNearestGridIndex(rNodes[idx]->rGetLocation());
134 units::quantity<unit::concentration> vegf_conc = this->
mVegfField[grid_index];
135 double vegf_fraction = vegf_conc/(vegf_conc +
mHalfMaxVegf);
137 double prob_tip_selection = max_prob_per_time_step*vegf_fraction;
139 if (RandomNumberGenerator::Instance()->ranf() < prob_tip_selection)
141 sprouts.push_back(rNodes[idx]);
static const boost::shared_ptr< ParameterInstance< unit::rate > > mpMaximumSproutingRate
std::vector< units::quantity< unit::concentration > > mVegfField
boost::shared_ptr< VesselNetwork< DIM > > mpVesselNetwork
units::quantity< unit::time > GetReferenceTimeScale()
virtual ~Owen2011SproutingRule()
boost::shared_ptr< AbstractDiscreteContinuumSolver< DIM > > mpSolver
units::quantity< unit::concentration > mHalfMaxVegf
static boost::shared_ptr< Owen2011SproutingRule< DIM > > Create()
boost::shared_ptr< RegularGrid< DIM > > mpGrid
virtual std::vector< boost::shared_ptr< VesselNode< DIM > > > GetSprouts(const std::vector< boost::shared_ptr< VesselNode< DIM > > > &rNodes)
units::quantity< unit::length > mVesselEndCutoff
units::quantity< unit::rate > mSproutingProbability
static BaseUnits * Instance()
void SetHalfMaxVegf(units::quantity< unit::concentration > halfMaxVegf)
units::quantity< unit::length > mTipExclusionRadius