3,4d2
< #include <cstdio>
< #include <ctime>
9d6
< //#include <fstream>
10a8,10
> #include <cstdio>
> #include <ctime>
> 
11a12,14
> #include "Candidate.h"
> #include "StandSet.h"
> #include "TimberClassStruct.h"
24a28
> #include "transfer_functions.h"
26d29
< #include "populate.h"
30,31d32
< #include "candidate.h"
< #include "aggregate.h"
33,35d33
< #include "util.h"
< #include "report.h"
< #include "transfer_functions.h"
39a38
> 
44,49d42
<         // synchronize i/o buffers; stdio and iostream use different
<     	// buffering schemes
<         // note: passing false as a parameter to sync_with_stdio may
<         // improve performance on some implementations (see Stroustrup 3rd Ed., p. 651)
<     	//std::ios::sync_with_stdio();
< 
54c47,51
< #ifdef _TSB_MAIN_DEBUG
---
> #ifdef _TSB_FIND_DEBUG
>         cerr << "_TSB_FIND_DEBUG" << endl;
>         cout << "_TSB_FIND_DEBUG" << endl;
> #endif
> #ifdef _TSB_DEBUG
85c82
<         const string binaryFileName = "FssimDump404a.bin";
---
>         const string binaryFileName = "FssimDump41a.bin";
91c88
<         theApp.m_zone0 = static_cast<ZONE *>(init_make_zone(zero, 0));
---
>         theApp.m_zone0 = init_make_zone(zero, 0);
97d93
<         // (each AU maintains list of groups that member area may belong to)
106,107c102,103
<         report_open_output_directory(dataDirectory);
<         cout << endl << "Generating reports..." << endl;
---
>         report_open_output_directory(dataDirectory.c_str());
>         cout << "Generating reports..." << endl;
113c109
<         cout << endl << "Entering simulation loop..." << endl;
---
>         cout << "Entering simulation loop..." << endl;
118,120c114,121
<             printf("\n\nPeriod : %3d - PeriodLength=%d", period, theApp.m_periodLength[period]);
<             revert(period);
<             if ( 1 == period )
---
>             theApp.m_currentPeriod = period;
>             theApp.m_doneHarvest = FssimApp::BEFORE;
> 
>             cout << endl << endl << "Period : " << period
>                  << " - PeriodLength = " << theApp.m_periodLength[period] << endl;
> 
>             revert();
>             if ( 1 == period ) // only aggregate before harvest the first time through
122c123
<                 aggregate(period);
---
>                 TimberClassStruct::aggregate();
123a125
> 
125,128c127,131
<             populate_groups(period, FssimApp::BEFORE);
<             transfer(period);
<             populate_areas(period);
<             if (theApp.m_enableReports==true)
---
>             StandSet::populate_groups();
>             transfer();
>             StandSet::populate_areas();
> 
>             if (theApp.m_enableReports == true)
130,131c133,134
<                 report_constraints(period, FssimApp::BEFORE);
<                 report_inventory(period, FssimApp::BEFORE);
---
>                 report_constraints();
>                 report_inventory();
133,136c136,143
<             derive_percentage_target(period);
<             candidate_create_candidate_list(period);
<             reset_achieved(/*period*/);
<             harvest(period);
---
> 
>             derive_percentage_target();
>             candidate_create_candidate_list();
>             reset_achieved();
> 
>             harvest();
>             theApp.m_doneHarvest = FssimApp::AFTER;
> 
138,139c145,147
<             age(period);
<             aggregate(period);
---
>             age();
>             TimberClassStruct::aggregate();
> 
143,146c151,154
<                 populate_groups(period, FssimApp::AFTER);
<                 report_inventory(period, FssimApp::AFTER);
<                 report_harvest_agedist(period);
<                 report_constraints(period, FssimApp::AFTER);
---
>                 StandSet::populate_groups();
>                 report_inventory();
>                 report_harvest_agedist();
>                 report_constraints();
148c156
<             report_harvest_levels(period);
---
>             report_harvest_levels();
151c159
<         cout << endl << "*** SIMULATION COMPLETE ***" << endl;
---
>         cout << endl << "*** SIMULATION COMPLETE ***" << endl << endl;
153c161
<         reset_achieved(/*period*/); // flush achieved->AgeDist structures
---
>         reset_achieved(); // flush achieved->AgeDist structures
154a163,164
> 
>     // catch any exceptions by type from most specific to most generic
