*** data_flow.txt: 14. May 2001, Kevin Belanger, Programmer/Analyst, Timber Supply Branch, Ministry of Forests *** FSSIM v4.0 Data Structures and Flow of Control ============================================== see v3.0 Data Structures and Flow of Control for more detail (almost all of the fssim core processes are unchanged from v3.0 to v4.0) // main data structures (updated in v4.0) FssimApp object; // instantiated in the main - includes the following member lists: LIST_PTR* m_tablelist; LIST_PTR* m_zonelist; LIST_PTR* m_grouplist; LIST_PTR* m_blocklist; LIST_PTR* m_candidatelist; // design notes, v4.0 The FssimApp class represents the single object instance which holds together the various components of the fssim application: input data, model iteration, and report generation. In version 4.0, the FssimApp object controls how input is read. Input is either: 1) updated from ascii ".dat" files (as in version 3.0) 2) read from a binary file (for increased processing speed) // flow of control (updated in v4.0) int main() { // create the application object FssimApp theApp(dataDirectory, binaryFileName, updateBinary); // initialize & read data files, initialize group eligibility lists theApp.readData(); init_adjacency(); // enter simulation loop for(period = 1 ; period <= theApp.m_planHorizon ; period++) { revert(period); if ( 1 == period ) { aggregate(period); } populate_groups(period, FssimApp::BEFORE); // needs to be done before transfer() since transfer() is by group transfer(period); populate_areas(period); // update age/area distributions if (theApp.m_enableReports==TRUE) { // pre-harvest reporting report_constraints(period, FssimApp::BEFORE); report_inventory(period, FssimApp::BEFORE); } derive_percentage_target(period); candidate_create_candidate_list(period); reset_achieved(/*period*/); harvest(period); theApp.remove_null_classes(); // deletes inactive or zero area classes age(period); aggregate(period); if (theApp.m_enableReports == TRUE) { // need to repopulate groups to reflect harvest changes populate_groups(period, FssimApp::AFTER); // post harvest population is for reporting only report_inventory(period, FssimApp::AFTER); report_harvest_agedist(period); report_constraints(period, FssimApp::AFTER); } report_harvest_levels(period); } // simulation complete, clean up theApp object return 0; // application completed successfully }