ALMaSS Partridge ODdox  1.1
The partridge model description following ODdox protocol
CfgFloat Class Reference

Double configurator entry class. More...

#include <configurator.h>

Inheritance diagram for CfgFloat:
CfgBase

Public Member Functions

 CfgFloat (const char *a_key, CfgSecureLevel a_level, double a_defval)
 
 CfgFloat (const char *a_key, CfgSecureLevel a_level, double a_defval, double a_min, double a_max)
 Constructor with max min checking enabled. More...
 
double value (void)
 
virtual void set (double a_newval)
 
virtual CfgType gettype (void)
 
- Public Member Functions inherited from CfgBase
 CfgBase (const char *a_key, CfgSecureLevel a_level)
 
virtual ~CfgBase (void)
 
const string getkey (void)
 
CfgSecureLevel getlevel (void)
 

Protected Attributes

double m_float
 
double m_min
 
double m_max
 
- Protected Attributes inherited from CfgBase
string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 

Detailed Description

Double configurator entry class.

Definition at line 106 of file configurator.h.

Constructor & Destructor Documentation

◆ CfgFloat() [1/2]

CfgFloat::CfgFloat ( const char *  a_key,
CfgSecureLevel  a_level,
double  a_defval 
)

Definition at line 121 of file configurator.cpp.

121  :CfgBase(a_key, a_level)
122 {
123  m_float = a_defval;
124 }

References m_float.

◆ CfgFloat() [2/2]

CfgFloat::CfgFloat ( const char *  a_key,
CfgSecureLevel  a_level,
double  a_defval,
double  a_min,
double  a_max 
)

Constructor with max min checking enabled.

Definition at line 126 of file configurator.cpp.

126  : CfgBase(a_key, a_level)
127 {
128  m_min = a_min;
129  m_max = a_max;
130  m_rangetest = true;
131  set(a_defval);
132 }

References m_max, m_min, CfgBase::m_rangetest, and set().

Member Function Documentation

◆ gettype()

virtual CfgType CfgFloat::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

Definition at line 120 of file configurator.h.

120 { return CFG_FLOAT; }

References CFG_FLOAT.

◆ set()

void CfgFloat::set ( double  a_newval)
virtual

Definition at line 134 of file configurator.cpp.

134  {
135  if (m_rangetest) {
136  if ((a_newval<m_min) || (a_newval>m_max))
137  {
138  g_msg->Warn("CfgFloat::set Value out of range: ", a_newval);
139  g_msg->Warn("CfgFloat::set Max allowed: ", m_max);
140  g_msg->Warn("CfgFloat::set Min allowed: ", m_min);
141  }
142  }
143  m_float = a_newval;
144 }

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

Referenced by CfgFloat().

◆ value()

double CfgFloat::value ( void  )
inline

Definition at line 118 of file configurator.h.

118 { return m_float; }

Referenced by OptimisingFarm::ActualProfit(), BeetleBank::BeetleBank(), Landscape::BeetleBankPossible(), VegElement::CalcGooseForageResources(), Pond::CalcLarvalFood(), Pond::CalcPondPesticide(), Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Partridge_Chick::ChDeveloping(), OptimisingFarm::ChooseDecisionMode(), Partridge_Clutch::ClDeveloping(), AnimalFarm::correctFodderDemand(), CoveyManager::CoveyManager(), Farm::CutOrch(), Orchard::Cutting(), MownGrass::Cutting(), Partridge_Chick::DailyMortality(), Partridge_Chick2::DailyMortality(), Partridge_Male::DailyMortality(), Partridge_Female::DailyMortality(), Pesticide::DiffusionFunction(), FarmManager::DistributeFarmerTypes(), VegElement::DoDevelopment(), BeetleBank::DoDevelopment(), Orchard::DoDevelopment(), OrchardBand::DoDevelopment(), Configurator::DumpSymbols(), FarmManager::FarmManagement(), Partridge_Population_Manager::FillInFoodArray(), Partridge_Female::FIncubating(), OptimisingFarm::findBIs(), FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), FarmManager::FindClosestFarmOpennessProbSmallIsBest(), OptimisingFarm::findFertilizer(), OptimisingFarm::findGrossMargin(), FarmManager::FindNeighbours(), Partridge_Female::FLaying(), Partridge_Covey::HabitatEvalPoly(), Landscape::hb_Add(), Landscape::hb_MarkTheBresenhamWay(), Heath::Heath(), Partridge_Population_Manager::Init(), Landscape::Landscape(), Pesticide::MainMapDecay(), Partridge_Covey::ManagerCheckMerge(), Partridge_Covey::ManagerDriftPos(), Partridge_Covey::ManagerRethinkPos(), Marsh::Marsh(), Partridge_Covey::MoveMagicVegToFood(), MownGrass::MownGrass(), NaturalGrassDry::NaturalGrassDry(), NaturalGrassWet::NaturalGrassWet(), Partridge_Female::OnClutchMown(), Partridge_Clutch::OnFarmEvent(), Partridge_Chick::OnFarmEvent(), Partridge_Chick2::OnFarmEvent(), Partridge_Male::OnFarmEvent(), Partridge_Female::OnFarmEvent(), OptimisingFarm::OptimiseFarm(), OptimisingFarm::optimizeCrops(), PermanentSetaside::PermanentSetaside(), PermPasture::PermPasture(), PermPastureLowYield::PermPastureLowYield(), PermPastureTussocky::PermPastureTussocky(), Pesticide::Pesticide(), Farm::PigsAreOutForced(), Farm::PigsOut(), Partridge_Covey::PressureLimitExceeded(), OptimisingFarm::Prob_multiplier(), Farm::ProductApplication(), Farm::ProductApplication_DateLimited(), RoadsideVerge::RoadsideVerge(), Saltmarsh::Saltmarsh(), Pesticide::Tick(), and WaterBufferZone::WaterBufferZone().

Member Data Documentation

◆ m_float

double CfgFloat::m_float
protected

Definition at line 109 of file configurator.h.

Referenced by CfgFloat(), and set().

◆ m_max

double CfgFloat::m_max
protected

Definition at line 111 of file configurator.h.

Referenced by CfgFloat(), and set().

◆ m_min

double CfgFloat::m_min
protected

Definition at line 110 of file configurator.h.

Referenced by CfgFloat(), and set().


The documentation for this class was generated from the following files:
CfgFloat::m_min
double m_min
Definition: configurator.h:110
g_msg
class MapErrorMsg * g_msg
Definition: maperrormsg.cpp:41
CfgFloat::m_max
double m_max
Definition: configurator.h:111
CfgFloat::set
virtual void set(double a_newval)
Definition: configurator.cpp:134
CfgBase::CfgBase
CfgBase(const char *a_key, CfgSecureLevel a_level)
Definition: configurator.cpp:73
CfgFloat::m_float
double m_float
Definition: configurator.h:109
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
CfgBase::m_rangetest
bool m_rangetest
Definition: configurator.h:73
CFG_FLOAT
Definition: configurator.h:54