Subversion Repositories public iLand

Rev

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

Rev 1111 Rev 1114
Line 807... Line 807...
807
    OutputManager *om = GlobalSettings::instance()->outputManager();
807
    OutputManager *om = GlobalSettings::instance()->outputManager();
808
    om->execute("tree"); // single tree output
808
    om->execute("tree"); // single tree output
809
    om->execute("treeremoval"); // single removed tree output
809
    om->execute("treeremoval"); // single removed tree output
810
    om->execute("stand"); //resource unit level x species
810
    om->execute("stand"); //resource unit level x species
811
    om->execute("landscape"); //landscape x species
811
    om->execute("landscape"); //landscape x species
-
 
812
    om->execute("landscape_removed"); //removed trees on landscape x species
812
    om->execute("sapling"); // sapling layer per RU x species
813
    om->execute("sapling"); // sapling layer per RU x species
813
    om->execute("production_month"); // 3pg responses growth per species x RU x month
814
    om->execute("production_month"); // 3pg responses growth per species x RU x month
814
    om->execute("dynamicstand"); // output with user-defined columns (based on species x RU)
815
    om->execute("dynamicstand"); // output with user-defined columns (based on species x RU)
815
    om->execute("standdead"); // resource unit level x species
816
    om->execute("standdead"); // resource unit level x species
816
    om->execute("management"); // resource unit level x species
817
    om->execute("management"); // resource unit level x species
Line 1034... Line 1035...
1034
  is derived from stand grid values.
1035
  is derived from stand grid values.
1035
  */
1036
  */
1036
void Model::calculateStockableArea()
1037
void Model::calculateStockableArea()
1037
{
1038
{
1038
1039
-
 
1040
    mTotalStockableArea = 0.;
1039
    foreach(ResourceUnit *ru, mRU) {
1041
    foreach(ResourceUnit *ru, mRU) {
1040
        // //
1042
        // //
1041
        //        if (ru->id()==-1) {
1043
        //        if (ru->id()==-1) {
1042
        //            ru->setStockableArea(0.);
1044
        //            ru->setStockableArea(0.);
1043
        //            continue;
1045
        //            continue;
Line 1048... Line 1050...
1048
            if ( runner.current()->isValid() )
1050
            if ( runner.current()->isValid() )
1049
                valid++;
1051
                valid++;
1050
            total++;
1052
            total++;
1051
        }
1053
        }
1052
        if (total) {
1054
        if (total) {
1053
            ru->setStockableArea( cHeightPixelArea * valid);
-
 
-
 
1055
            ru->setStockableArea( cHeightPixelArea * valid); // in m2
-
 
1056
            mTotalStockableArea += cHeightPixelArea * valid / 10000.; // in ha
1054
            if (valid==0 && ru->id()>-1) {
1057
            if (valid==0 && ru->id()>-1) {
1055
                // invalidate this resource unit
1058
                // invalidate this resource unit
1056
                ru->setID(-1);
1059
                ru->setID(-1);
1057
            }
1060
            }
1058
            if (valid>0 && ru->id()==-1) {
1061
            if (valid>0 && ru->id()==-1) {
Line 1081... Line 1084...
1081
                if (neighbors[i] &&  neighbors[i]->isValid())
1084
                if (neighbors[i] &&  neighbors[i]->isValid())
1082
                    runner.current()->setIsRadiating();
1085
                    runner.current()->setIsRadiating();
1083
1086
1084
        }
1087
        }
1085
    }
1088
    }
-
 
1089
-
 
1090
    qDebug() << "Total stockable area of the landscape is" << mTotalStockableArea << "ha.";
1086
1091
1087
}
1092
}
1088
1093
1089
void Model::initializeGrid()
1094
void Model::initializeGrid()
1090
{
1095
{