ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
CfgFloat Class Reference

Double configurator entry class. More...

#include <Configurator.h>

Inheritance diagram for CfgFloat:
CfgBase

Public Member Functions

 CfgFloat (const std::string &, CfgSecureLevel a_level, double a_defval)
 
 CfgFloat (const std::string &, CfgSecureLevel a_level, double a_defval, bool a_definconf)
 
 CfgFloat (std::string, CfgSecureLevel a_level, double a_defval, double a_min, double a_max)
 Constructor with max min checking enabled. More...
 
double value () const
 
void set (double a_newval)
 
CfgType gettype () override
 
double getmax () const
 
double getmin () const
 
- Public Member Functions inherited from CfgBase
 CfgBase (const std::string &a_key, CfgSecureLevel a_level)
 
 CfgBase (const std::string &a_key, CfgSecureLevel a_level, bool a_definedinconfig)
 
virtual ~CfgBase ()
 
std::string getkey ()
 
CfgSecureLevel getlevel (void)
 
void set_definedinconfig (bool flag)
 
bool get_definedinconfig () const
 
bool get_rangetest () const
 

Protected Member Functions

 CfgFloat (const std::string a_key, CfgSecureLevel a_level, double a_defval, double a_min, double a_max, bool a_definconf)
 

Protected Attributes

double m_float
 
double m_min {}
 
double m_max {}
 
- Protected Attributes inherited from CfgBase
std::string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 
bool m_definedinconfig {false}
 

Detailed Description

Double configurator entry class.

Constructor & Destructor Documentation

◆ CfgFloat() [1/4]

CfgFloat::CfgFloat ( const std::string  a_key,
CfgSecureLevel  a_level,
double  a_defval,
double  a_min,
double  a_max,
bool  a_definconf 
)
protected
176  : CfgBase(a_key, a_level)
177 {
178  m_min = a_min;
179  m_max = a_max;
180  m_rangetest = true;
181  g_cfg->Register( this, a_key );
182 }

References g_cfg, m_max, m_min, and CfgBase::m_rangetest.

◆ CfgFloat() [2/4]

CfgFloat::CfgFloat ( const std::string &  a_key,
CfgSecureLevel  a_level,
double  a_defval 
)
158  :CfgBase(a_key, a_level)
159 {
160  m_float = a_defval;
161  g_cfg->Register( this, a_key );
162 }

References g_cfg, and m_float.

◆ CfgFloat() [3/4]

CfgFloat::CfgFloat ( const std::string &  a_key,
CfgSecureLevel  a_level,
double  a_defval,
bool  a_definconf 
)
163  :CfgBase{a_key, a_level,a_definconf}
164 {
165  m_float = a_defval;
166 }

◆ CfgFloat() [4/4]

CfgFloat::CfgFloat ( std::string  a_key,
CfgSecureLevel  a_level,
double  a_defval,
double  a_min,
double  a_max 
)

Constructor with max min checking enabled.

168  : CfgBase(a_key, a_level)
169 {
170  m_min = a_min;
171  m_max = a_max;
172  m_rangetest = true;
173  m_float = a_defval;
174  g_cfg->Register( this, a_key );
175 }

References g_cfg, m_float, m_max, m_min, and CfgBase::m_rangetest.

Member Function Documentation

◆ getmax()

double CfgFloat::getmax ( ) const
inline
145 {return m_max;}

References m_max.

◆ getmin()

double CfgFloat::getmin ( ) const
inline
146 {return m_min;}

References m_min.

◆ gettype()

CfgType CfgFloat::gettype ( void  )
inlineoverridevirtual

Reimplemented from CfgBase.

144 { return CFG_FLOAT; }

References CFG_FLOAT.

◆ set()

void CfgFloat::set ( double  a_newval)
184  {
185  if (m_rangetest) {
186  if ((a_newval<m_min) || (a_newval>m_max))
187  {
188  g_msg->Warn("CfgFloat::set Value out of range: ", a_newval);
189  g_msg->Warn("Name: ", m_key);
190  g_msg->Warn("CfgFloat::set Max allowed: ", m_max);
191  g_msg->Warn("CfgFloat::set Min allowed: ", m_min);
192  }
193  }
194  m_float = a_newval;
195 }

References g_msg, m_float, CfgBase::m_key, m_max, m_min, CfgBase::m_rangetest, and MapErrorMsg::Warn().

◆ value()

double CfgFloat::value ( ) const
inline
142 { return m_float; }

References m_float.

Referenced by PoecilusCupreus_Adult::Ageing(), Spider_Juvenile::AssessFood(), Beetle_Population_Manager::Beetle_Population_Manager(), BeetleBank::BeetleBank(), Ladybird_Adult::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), Farm::BiocideTreat(), PoecilusCupreus_Population_Manager::CalcDailyEggFormationProgress(), Erigone_Juvenile::CalcDrought(), Oedothorax_Juvenile::CalcDrought(), Oedothorax_Female::CalcDrought(), Erigone_Female::CalcDrought(), VegElement::CalcGooseForageResources(), Pond::CalcLarvalFood(), PoecilusCupreus_Population_Manager::CalcOvipositionLength(), Pond::CalcPondPesticide(), VegElement::CalculateInsectBiomass(), Osmia_Population_Manager::CalForageHours(), SubPopulation_Population_Manager::calNextStage(), Aphid::calPopuDensity(), Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleIsOutLow2(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Farm::CutOrch(), Orchard::Cutting(), MownGrassStrip::Cutting(), Ladybird_Population_Manager::DayDegreeCalculations(), OrchardCrop::Do(), WinterRapeStrigling::Do(), OCloverGrassGrazed2::Do(), BroadBeans::Do(), PermanentGrassLowYield::Do(), OCloverGrassGrazed1::Do(), DK_GrassLowYield_Perm::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), CloverGrassGrazed2::Do(), DK_OLegume_Peas_CC::Do(), OWinterBarleyExt::Do(), DK_OLegume_Beans_CC::Do(), OWinterBarley::Do(), SeedGrass2::Do(), CloverGrassGrazed1::Do(), OWinterRye::Do(), DK_SpringOats_CC::Do(), OOats::Do(), DE_OOats::Do(), DE_OSpringRye::Do(), DK_OLegume_Whole_CC::Do(), DK_OWinterRye_CC::Do(), DK_OSpringBarley_CC::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), Oats::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), SpringBarleySeed::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersownExt::Do(), OWinterWheatUndersown::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), NLMaize::Do(), Carrots::Do(), DK_OSpringOats_CC::Do(), DK_SpringBarley_CC::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DE_OPotatoes::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), DKOBroadBeans_test::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), DK_WinterRye_CC::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), TestCrop::Do(), NLWinterWheat::Do(), DK_WinterWheat_CC::Do(), PTCabbage_Hort::Do(), SpringBarley::Do(), SpringRape::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), PTMaize_Hort::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), OSpringBarleyPigs::Do(), WinterBarley::Do(), DK_OWinterWheat_CC::Do(), PLWinterWheat::Do(), WinterWheat::Do(), PesticideToxicity::doContact(), PesticideStore::doDecay(), VegElement::DoDevelopment(), BeetleBank::DoDevelopment(), FlowerStrip::DoDevelopment(), Orchard::DoDevelopment(), OrchardBand::DoDevelopment(), Ladybird_Population_Manager::DoExtremeTempActions(), Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Ladybird_Population_Manager::DoFirst(), THare_Population_Manager::DoFirst(), PesticideToxicity::doOverspray(), Configurator::DumpSymbols(), Spider_Egg::EndStep(), Spider_Juvenile::EndStep(), Spider_Female::EndStep(), FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), FarmManager::FindClosestFarmOpennessProbSmallIsBest(), Osmia_Female::Forage(), THare::ForageSquare(), THare::ForageSquareP(), Farm::FungicideTreat(), Hare_Male::GeneralOrganoPhosphate(), Hare_Female::GeneralOrganoPhosphate(), Landscape::GeneratePolyIDMapWithinDist(), Ladybird_Adult::GetExtremeTempMin(), Ladybird_Population_Manager::GetFlyingWeather(), Ladybird_Base::GetTempMortRange(), Ladybird_Population_Manager::GetTempMortRange(), Skylark_Adult::GetVegHindrance(), Hare_Female::GiveBirth(), Farm::GrowthRegulator(), Landscape::hb_Add(), Landscape::hb_MarkTheBresenhamWay(), Farm::HerbicideTreat(), WinterRape::HerbiZero(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingDifferentiatedBeetleBankArea(), THare_Population_Manager::HuntingGrid(), Beetle_Adult::IncNegDegrees(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Vole_Base::Init(), Osmia_Population_Manager::Init(), Osmia_Female::Init(), THare_Population_Manager::Init(), Aphid_Population_Manager::initialisePopulation(), Farm::InitiateManagement(), Farm::InsecticideTreat(), Hare_Male::InternalPesticideHandlingAndResponse(), Hare_Female::InternalPesticideHandlingAndResponse(), Ladybird_Population_Manager::Ladybird_Population_Manager(), Landscape::Landscape(), Osmia_Female::LayEgg(), Skylark_Population_Manager::LoadParameters(), Pesticide::MainMapDecay(), Farm::Molluscicide(), MownGrassStrip::MownGrassStrip(), Oedothorax_Egg::OnFarmEvent(), Erigone_Egg::OnFarmEvent(), Erigone_Juvenile::OnFarmEvent(), Oedothorax_Juvenile::OnFarmEvent(), Erigone_Female::OnFarmEvent(), Oedothorax_Female::OnFarmEvent(), Bembidion_Population_Manager::OnFarmEvent(), PoecilusCupreus_Population_Manager::OnFarmEvent(), Ladybird_Population_Manager::OnFarmEvent(), Osmia_Female::OnFarmEvent(), Osmia_Population_Manager::Osmia_Population_Manager(), PermanentSetaside::PermanentSetaside(), Farm::PigsAreOutForced(), Farm::PigsOut(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), PollenNectarDevelopmentData::PollenNectarDevelopmentData(), SkTerritories::PrePolyNQual(), SkTerritories::PreProcessLandscape2(), Farm::ProductApplication(), Farm::ProductApplication_DateLimited(), VegElement::RecalculateBugsNStuff(), Skylark_Nestling::ReInit(), Skylark_Male::ReInit(), Osmia_Female::SetCocoonToProvisionMass(), VegElement::SetInterestedBiomassFractionForCrop(), PoecilusCupreus_Population_Manager::SetMeanDistance(), Osmia_Base::SetParameterValues(), VegElement::SetVegGrowthScalerRand(), Field::SetVegGrowthScalerRand(), Ladybird_Adult::ShouldStartAggregating(), Skylark_Male::Skylark_Male(), Skylark_Nestling::Skylark_Nestling(), SkTerritories::Split(), Skylark_Clutch::st_Developing(), Skylark_Nestling::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), Hare_Female::st_Developing(), Ladybird_Adult::St_Dispersal(), Skylark_Female::st_Emigrating(), Skylark_Male::st_Emigrating(), Ladybird_Adult::St_Forage(), Hare_Young::st_Foraging(), Hare_Juvenile::st_Foraging(), Hare_Male::st_Foraging(), Hare_Female::st_Foraging(), Vole_Female::st_GiveBirth(), Ladybird_Adult::St_Hibernate(), Skylark_Female::st_Immigrating(), Vole_Male::st_Infanticide(), Vole_Female::st_Lactating(), Skylark_Female::st_Laying(), Osmia_Female::st_ReproductiveBehaviour(), Hare_Juvenile::Step(), Hare_Male::Step(), Hare_Female::Step(), THare::THareInit(), Hare_Female::UpdateGestation(), Hare_Female::UpdateOestrous(), THare::WasPredated(), and Weather::Weather().

Member Data Documentation

◆ m_float

double CfgFloat::m_float
protected

Referenced by CfgFloat(), set(), and value().

◆ m_max

double CfgFloat::m_max {}
protected

Referenced by CfgFloat(), getmax(), and set().

◆ m_min

double CfgFloat::m_min {}
protected

Referenced by CfgFloat(), getmin(), and set().


The documentation for this class was generated from the following files:
CfgFloat::m_min
double m_min
Definition: Configurator.h:133
g_cfg
std::shared_ptr< Configurator > g_cfg
Definition: Configurator.cpp:56
CfgBase::CfgBase
CfgBase(const std::string &a_key, CfgSecureLevel a_level)
Definition: Configurator.cpp:84
CfgFloat::m_max
double m_max
Definition: Configurator.h:134
CfgFloat::m_float
double m_float
Definition: Configurator.h:132
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
CfgBase::m_key
std::string m_key
Definition: Configurator.h:81
CfgBase::m_rangetest
bool m_rangetest
Definition: Configurator.h:83
CFG_FLOAT
Definition: Configurator.h:61
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
CfgBase
Base class for a configurator entry.
Definition: Configurator.h:79