Subversion Repositories public iLand

Rev

Rev 967 | Rev 999 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 967 Rev 998
Line 520... Line 520...
520
520
521
/// multithreaded running function for the resource unit level establishment
521
/// multithreaded running function for the resource unit level establishment
522
ResourceUnit *nc_sapling_growth_establishment(ResourceUnit *unit)
522
ResourceUnit *nc_sapling_growth_establishment(ResourceUnit *unit)
523
{
523
{
524
    try {
524
    try {
-
 
525
        { DebugTimer t("nc_saplingGrowth");
525
        // define a height map for the current resource unit on the stack
526
        // define a height map for the current resource unit on the stack
526
        float sapling_map[cPxPerRU*cPxPerRU];
527
        float sapling_map[cPxPerRU*cPxPerRU];
527
        // set the map and initialize it:
528
        // set the map and initialize it:
528
        unit->setSaplingHeightMap(sapling_map);
529
        unit->setSaplingHeightMap(sapling_map);
529
530
530
531
531
        // (1) calculate the growth of (already established) saplings (populate sapling map)
532
        // (1) calculate the growth of (already established) saplings (populate sapling map)
532
        QList<ResourceUnitSpecies*>::const_iterator rus;
533
        QList<ResourceUnitSpecies*>::const_iterator rus;
533
        for (rus=unit->ruSpecies().cbegin(); rus!=unit->ruSpecies().cend(); ++rus)
534
        for (rus=unit->ruSpecies().cbegin(); rus!=unit->ruSpecies().cend(); ++rus)
534
            (*rus)->calclulateSaplingGrowth();
535
            (*rus)->calclulateSaplingGrowth();
-
 
536
-
 
537
        } { DebugTimer t("nc_Establishment");
535
538
536
        // (2) calculate the establishment probabilities of new saplings
539
        // (2) calculate the establishment probabilities of new saplings
537
        for (rus=unit->ruSpecies().cbegin(); rus!=unit->ruSpecies().cend(); ++rus)
-
 
-
 
540
        for (QList<ResourceUnitSpecies*>::const_iterator rus=unit->ruSpecies().cbegin(); rus!=unit->ruSpecies().cend(); ++rus)
538
            (*rus)->calculateEstablishment();
541
            (*rus)->calculateEstablishment();
539
542
-
 
543
        }
540
544
541
    } catch (const IException& e) {
545
    } catch (const IException& e) {
542
        GlobalSettings::instance()->controller()->throwError(e.message());
546
        GlobalSettings::instance()->controller()->throwError(e.message());
543
    }
547
    }
544
548