3a4
> #include <cassert>
6a8,12
> #include "FssimApp.h"
> #include "AUStruct.h"
> #include "ZoneStruct.h"
> #include "TimberClassStruct.h"
> 
8a15
> 
11c18
<     void age(int period)
---
>     void age()
13,17c20
<         ZONE	*zone;
<         AU	*au;
<         TIMBER_CLASS* timber_class;
<         BLOCK	*block;
<         HASHREC	*hashrec;
---
>         FssimApp* pApp = FssimApp::getApp();
19c22
<         printf("\nPeriod : %3d - Aging", period);
---
>         int period = pApp->m_currentPeriod;
21,24c24,27
<         FssimApp* pApp = FssimApp::getApp();;
<         pApp->m_zoneList = (LIST_PTR *)List::reset(pApp->m_zoneList);
<         zone = (ZONE *)List::next(pApp->m_zoneList);
<         while (zone != 0)
---
>         cout << "Period : " << period << " - Aging" << endl;
> 
>         typedef vector<ZoneStruct*>::iterator ZI;
>         for (ZI zoneIter = pApp->m_zoneList.begin(); zoneIter != pApp->m_zoneList.end(); ++zoneIter)
26,28c29,30
<             zone->aulist = (LIST_PTR *)List::reset(zone->aulist);
<             au = static_cast<AU*>(List::next(zone->aulist));
<             while (au != 0)
---
>             typedef vector<AUStruct*>::iterator AI;
>             for (AI auIter = (*zoneIter)->aulist.begin(); auIter != (*zoneIter)->aulist.end(); ++auIter)
30,32c32,33
<                 au->classlist = (LIST_PTR *)List::reset(au->classlist);
<                 timber_class = (TIMBER_CLASS *)List::next(au->classlist);
<                 while (timber_class != 0)
---
>                 typedef multimap<int, TimberClassStruct*>::iterator CI;
>                 for (CI classIter = (*auIter)->classlist.begin(); classIter != (*auIter)->classlist.end(); ++classIter)
34c35,39
<                     if (timber_class->class_type != FssimApp::INACTIVE)
---
>                     TimberClassStruct* pCurrentTimberClass = classIter->second;
> 
>                     assert(pCurrentTimberClass->parent_au != 0);
> 
>                     if (pCurrentTimberClass->class_type != GroupDefStruct::INACTIVE)
36c41,47
<                         timber_class->age += pApp->m_periodLength[period];
---
> #ifdef _TSB_AGE_DEBUG
>                 		cout << endl << "age(1): " << pCurrentTimberClass->age << endl;
> #endif
>                         pCurrentTimberClass->age += pApp->m_periodLength[period];
> #ifdef _TSB_AGE_DEBUG
>                 		cout << endl << "age(2): " << pCurrentTimberClass->age << endl;
> #endif
38,39c49,50
<                     timber_class->ReEntryLag -= pApp->m_periodLength[period];
<                     if (timber_class->ReEntryLag < 0)
---
>                     pCurrentTimberClass->ReEntryLag -= pApp->m_periodLength[period];
>                     if (pCurrentTimberClass->ReEntryLag < 0)
41c52
<                         timber_class->ReEntryLag = 0;
---
>                         pCurrentTimberClass->ReEntryLag = 0;
44c55
<                     cout << endl << "age: ReEntryLag: " << timber_class->ReEntryLag << endl;
---
>                 	cout << endl << "age: ReEntryLag: " << pCurrentTimberClass->ReEntryLag << endl;
46d56
<                     timber_class = (TIMBER_CLASS *)List::next(au->classlist);
48c58
<                 au = static_cast<AU*>(List::next(zone->aulist));
---
> 
50c60
<             zone = (ZONE *)List::next(pApp->m_zoneList);
---
> 
53,55c63,64
<         pApp->m_blockList = (LIST_PTR *)List::reset(pApp->m_blockList);
<         hashrec = (HASHREC *)List::next(pApp->m_blockList);
<         while (hashrec!= 0)
---
>         typedef multimap<int, BlockStruct*>::iterator BI;
>         for (BI blockIter = pApp->m_blockList.begin(); blockIter != pApp->m_blockList.end(); ++blockIter)
57,59c66,70
<             hashrec->candidates = (LIST_PTR *)List::reset(hashrec->candidates);
<             block = (BLOCK *)List::next(hashrec->candidates);
<             while (block!= 0)
---
>             blockIter->second->AdjacencyDelay -= pApp->m_periodLength[period];
> #ifdef _TSB_AGE_DEBUG
>             cout << endl << "age: AdjacencyDelay: " << blockIter->second->AdjacencyDelay << endl;
> #endif
>             if (blockIter->second->AdjacencyDelay < 0)
61,63c72
<                 block->AdjacencyDelay -= pApp->m_periodLength[period];
<                 if (block->AdjacencyDelay<0) block->AdjacencyDelay=0;
<                 block = (BLOCK *)List::next(hashrec->candidates);
---
>                 blockIter->second->AdjacencyDelay = 0;
65c74
<             hashrec = (HASHREC *)List::next(pApp->m_blockList);
---
> 
