Rev 1114 | Rev 1117 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1114 | Rev 1115 | ||
---|---|---|---|
Line 517... | Line 517... | ||
517 | if (settings().regenerationEnabled) { |
517 | if (settings().regenerationEnabled) { |
518 | foreach(SpeciesSet *ss, mSpeciesSets) |
518 | foreach(SpeciesSet *ss, mSpeciesSets) |
519 | ss->setupRegeneration(); |
519 | ss->setupRegeneration(); |
520 | }
|
520 | }
|
521 | Sapling::setRecruitmentVariation(xml.valueDouble("model.settings.seedDispersal.recruitmentDimensionVariation",0.1)); |
521 | Sapling::setRecruitmentVariation(xml.valueDouble("model.settings.seedDispersal.recruitmentDimensionVariation",0.1)); |
- | 522 | Saplings::setRecruitmentVariation(xml.valueDouble("model.settings.seedDispersal.recruitmentDimensionVariation",0.1)); |
|
522 | 523 | ||
523 | // (3.3) management
|
524 | // (3.3) management
|
524 | bool use_abe = xml.valueBool("model.management.abeEnabled"); |
525 | bool use_abe = xml.valueBool("model.management.abeEnabled"); |
525 | if (use_abe) { |
526 | if (use_abe) { |
526 | // use the agent based forest management engine
|
527 | // use the agent based forest management engine
|
Line 581... | Line 582... | ||
581 | // setup final path
|
582 | // setup final path
|
582 | g->setupDatabaseConnection("out", dbPath, false); |
583 | g->setupDatabaseConnection("out", dbPath, false); |
583 | 584 | ||
584 | }
|
585 | }
|
585 | 586 | ||
- | 587 | /// multithreaded running function for the resource unit level establishment
|
|
- | 588 | ResourceUnit *nc_establishment(ResourceUnit *unit) |
|
- | 589 | {
|
|
- | 590 | Saplings *s = GlobalSettings::instance()->model()->saplings(); |
|
- | 591 | try { |
|
- | 592 | s->establishment(unit); |
|
- | 593 | s->saplingGrowth(unit); |
|
- | 594 | ||
- | 595 | ||
- | 596 | } catch (const IException& e) { |
|
- | 597 | GlobalSettings::instance()->controller()->throwError(e.message()); |
|
- | 598 | }
|
|
- | 599 | ||
- | 600 | return unit; |
|
- | 601 | ||
- | 602 | }
|
|
- | 603 | ||
- | 604 | /// multithreaded running function for the resource unit level establishment
|
|
- | 605 | ResourceUnit *nc_sapling_growth(ResourceUnit *unit) |
|
- | 606 | {
|
|
- | 607 | Saplings *s = GlobalSettings::instance()->model()->saplings(); |
|
- | 608 | try { |
|
- | 609 | s->saplingGrowth(unit); |
|
- | 610 | ||
- | 611 | } catch (const IException& e) { |
|
- | 612 | GlobalSettings::instance()->controller()->throwError(e.message()); |
|
- | 613 | }
|
|
- | 614 | ||
- | 615 | return unit; |
|
- | 616 | ||
- | 617 | }
|
|
586 | 618 | ||
587 | /// multithreaded running function for the resource unit level establishment
|
619 | /// multithreaded running function for the resource unit level establishment
|
588 | ResourceUnit *nc_sapling_growth_establishment(ResourceUnit *unit) |
- | |
- | 620 | ResourceUnit *nc_sapling_growth_establishment_old(ResourceUnit *unit) |
|
589 | {
|
621 | {
|
590 | try { |
622 | try { |
591 | { // DebugTimer t("nc_saplingGrowth"); t.setSilent(); |
623 | { // DebugTimer t("nc_saplingGrowth"); t.setSilent(); |
592 | // define a height map for the current resource unit on the stack
|
624 | // define a height map for the current resource unit on the stack
|
593 | float sapling_map[cPxPerRU*cPxPerRU]; |
625 | float sapling_map[cPxPerRU*cPxPerRU]; |
Line 764... | Line 796... | ||
764 | mGrassCover->execute(); // evaluate the grass / herb cover (and its effect on regeneration) |
796 | mGrassCover->execute(); // evaluate the grass / herb cover (and its effect on regeneration) |
765 | 797 | ||
766 | // regeneration
|
798 | // regeneration
|
767 | if (settings().regenerationEnabled) { |
799 | if (settings().regenerationEnabled) { |
768 | // seed dispersal
|
800 | // seed dispersal
|
769 | DebugTimer tseed("Regeneration and Establishment"); |
- | |
- | 801 | DebugTimer tseed("Regeneration and Establishment old"); |
|
770 | foreach(SpeciesSet *set, mSpeciesSets) |
802 | foreach(SpeciesSet *set, mSpeciesSets) |
771 | set->regeneration(); // parallel execution for each species set |
803 | set->regeneration(); // parallel execution for each species set |
772 | 804 | ||
773 | GlobalSettings::instance()->systemStatistics()->tSeedDistribution+=tseed.elapsed(); |
805 | GlobalSettings::instance()->systemStatistics()->tSeedDistribution+=tseed.elapsed(); |
774 | // establishment
|
806 | // establishment
|
775 | Sapling::updateBrowsingPressure(); |
807 | Sapling::updateBrowsingPressure(); |
- | 808 | Saplings::updateBrowsingPressure(); |
|
776 | 809 | ||
777 | { DebugTimer t("saplingGrowthEstablishment"); |
- | |
778 | executePerResourceUnit( nc_sapling_growth_establishment, false /* true: force single thraeded operation */); |
- | |
- | 810 | { DebugTimer t("saplingGrowthEstablishment old"); |
|
- | 811 | executePerResourceUnit( nc_sapling_growth_establishment_old, false /* true: force single thraeded operation */); |
|
- | 812 | GlobalSettings::instance()->systemStatistics()->tSaplingAndEstablishment+=t.elapsed(); |
|
- | 813 | }
|
|
- | 814 | ||
- | 815 | DebugTimer t28("Regeneration and Establishment"); |
|
- | 816 | { DebugTimer t("establishment"); |
|
- | 817 | executePerResourceUnit( nc_establishment, false /* true: force single thraeded operation */); |
|
- | 818 | GlobalSettings::instance()->systemStatistics()->tSaplingAndEstablishment+=t.elapsed(); |
|
- | 819 | }
|
|
- | 820 | { DebugTimer t("sapling growth"); |
|
- | 821 | executePerResourceUnit( nc_sapling_growth, false /* true: force single thraeded operation */); |
|
779 | GlobalSettings::instance()->systemStatistics()->tSaplingAndEstablishment+=t.elapsed(); |
822 | GlobalSettings::instance()->systemStatistics()->tSaplingAndEstablishment+=t.elapsed(); |
780 | }
|
823 | }
|
781 | 824 | ||
782 | Establishment::debugInfo(); // debug test |
825 | Establishment::debugInfo(); // debug test |
783 | 826 |