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

A base class for summary outputs. More...

#include <VolePopulationManager.h>

Public Member Functions

 VoleSummaryOutput (const char *a_filename, Landscape *a_land, int a_numdataINT, int a_numdataDOUBLE)
 
virtual ~VoleSummaryOutput ()
 
virtual void OPrint ()
 
virtual void OPrint (int a_value)
 
virtual void OPrint (double a_value)
 
virtual void OPrint (const char *a_value)
 
virtual void OPrintEndl ()
 
void ResetData ()
 
void ChangeData (int a_data, int a_value)
 
void ChangeData (int a_data, double a_value)
 

Protected Member Functions

void OpenOutput (const char *a_filename)
 
void CloseOutput () const
 

Protected Attributes

ofstream * m_File
 
Landscapem_landscape
 
int m_ndInt
 
int m_ndDouble
 
int m_dataI [100]
 
double m_dataD [100]
 

Detailed Description

A base class for summary outputs.

Constructor & Destructor Documentation

◆ VoleSummaryOutput()

VoleSummaryOutput::VoleSummaryOutput ( const char *  a_filename,
Landscape a_land,
int  a_numdataINT,
int  a_numdataDOUBLE 
)
3275  {
3276  m_landscape = a_land;
3277  OpenOutput(a_filename);
3278  m_ndInt = a_numdataINT;
3279  m_ndDouble = a_numdataDOUBLE;
3280  ResetData();
3281 }

References m_landscape, m_ndDouble, m_ndInt, OpenOutput(), and ResetData().

◆ ~VoleSummaryOutput()

VoleSummaryOutput::~VoleSummaryOutput ( )
virtual
3282 { CloseOutput(); }

References CloseOutput().

Member Function Documentation

◆ ChangeData() [1/2]

void VoleSummaryOutput::ChangeData ( int  a_data,
double  a_value 
)
3303 { m_dataD[a_data] += a_value; }

References m_dataD.

◆ ChangeData() [2/2]

◆ CloseOutput()

void VoleSummaryOutput::CloseOutput ( ) const
protected
3294  {
3295  m_File->close();
3296  delete m_File;
3297 }

References m_File.

Referenced by ~VoleSummaryOutput().

◆ OpenOutput()

void VoleSummaryOutput::OpenOutput ( const char *  a_filename)
protected
3293 { m_File = new ofstream(a_filename, ios::out); }

References m_File.

Referenced by VoleSummaryOutput().

◆ OPrint() [1/4]

void VoleSummaryOutput::OPrint ( )
virtual
3283  {
3285  for (int i = 0; i < m_ndInt; i++) *m_File << '\t' << m_dataI[i];
3286  for (int i = 0; i < m_ndDouble; i++) *m_File << '\t' << m_dataD[i];
3287  *m_File << endl;
3288 }

References m_dataD, m_dataI, m_File, m_landscape, m_ndDouble, m_ndInt, Landscape::SupplyDayInYear(), and Landscape::SupplyYearNumber().

Referenced by Vole_Population_Manager::DoFirst(), Vole_Population_Manager::Init(), and Vole_Population_Manager::~Vole_Population_Manager().

◆ OPrint() [2/4]

void VoleSummaryOutput::OPrint ( const char *  a_value)
virtual
3291 { *m_File << a_value << '\t'; }

References m_File.

◆ OPrint() [3/4]

void VoleSummaryOutput::OPrint ( double  a_value)
virtual
3290 { *m_File << a_value << '\t'; }

References m_File.

◆ OPrint() [4/4]

void VoleSummaryOutput::OPrint ( int  a_value)
virtual
3289 { *m_File << a_value << '\t'; }

References m_File.

◆ OPrintEndl()

void VoleSummaryOutput::OPrintEndl ( )
virtual
3292 { *m_File << endl; }

References m_File.

Referenced by Vole_Population_Manager::Init().

◆ ResetData()

void VoleSummaryOutput::ResetData ( )
3298  {
3299  for (int i = 0; i < m_ndInt; i++) m_dataI[i] = 0;
3300  for (int i = 0; i < m_ndDouble; i++) m_dataD[i] = 0.0;
3301 }

References m_dataD, m_dataI, m_ndDouble, and m_ndInt.

Referenced by Vole_Population_Manager::DoFirst(), and VoleSummaryOutput().

Member Data Documentation

◆ m_dataD

double VoleSummaryOutput::m_dataD[100]
protected

Referenced by ChangeData(), OPrint(), and ResetData().

◆ m_dataI

int VoleSummaryOutput::m_dataI[100]
protected

Referenced by ChangeData(), OPrint(), and ResetData().

◆ m_File

ofstream* VoleSummaryOutput::m_File
protected

◆ m_landscape

Landscape* VoleSummaryOutput::m_landscape
protected

Referenced by OPrint(), and VoleSummaryOutput().

◆ m_ndDouble

int VoleSummaryOutput::m_ndDouble
protected

◆ m_ndInt

int VoleSummaryOutput::m_ndInt
protected

The documentation for this class was generated from the following files:
VoleSummaryOutput::CloseOutput
void CloseOutput() const
Definition: VolePopulationManager.cpp:3294
VoleSummaryOutput::OpenOutput
void OpenOutput(const char *a_filename)
Definition: VolePopulationManager.cpp:3293
VoleSummaryOutput::m_dataI
int m_dataI[100]
Definition: VolePopulationManager.h:138
VoleSummaryOutput::m_ndInt
int m_ndInt
Definition: VolePopulationManager.h:136
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
VoleSummaryOutput::ResetData
void ResetData()
Definition: VolePopulationManager.cpp:3298
VoleSummaryOutput::m_File
ofstream * m_File
Definition: VolePopulationManager.h:134
VoleSummaryOutput::m_landscape
Landscape * m_landscape
Definition: VolePopulationManager.h:135
VoleSummaryOutput::m_ndDouble
int m_ndDouble
Definition: VolePopulationManager.h:137
VoleSummaryOutput::m_dataD
double m_dataD[100]
Definition: VolePopulationManager.h:139