Subversion Repositories public iLand

Rev

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

Rev 393 Rev 431
Line 42... Line 42...
42
            newtree.setPosition(tree.position()+(*p)->boundingBox().topLeft());
42
            newtree.setPosition(tree.position()+(*p)->boundingBox().topLeft());
43
            newtree.setRU(*p);
43
            newtree.setRU(*p);
44
            newtree.setNewId();
44
            newtree.setNewId();
45
        }
45
        }
46
    }
46
    }
47
    qDebug() << Tree::statCreated() << "trees loaded / copied.";
-
 
-
 
47
    if (logLevelInfo()) qDebug() << Tree::statCreated() << "trees loaded / copied.";
48
}
48
}
49
49
50
/** main routine of the stand setup.
50
/** main routine of the stand setup.
51
*/
51
*/
52
void StandLoader::processInit()
52
void StandLoader::processInit()
Line 84... Line 84...
84
            type = xml.value("type", "");
84
            type = xml.value("type", "");
85
            fileName = xml.value("file", "");
85
            fileName = xml.value("file", "");
86
            if (fileName.isEmpty())
86
            if (fileName.isEmpty())
87
                continue;
87
                continue;
88
            loadInitFile(fileName, type, ru);
88
            loadInitFile(fileName, type, ru);
89
            qDebug() << "loaded" << fileName << "on" << ru->boundingBox() << "," << ru->trees().count() << "trees.";
-
 
-
 
89
            if (logLevelInfo()) qDebug() << "loaded" << fileName << "on" << ru->boundingBox() << "," << ru->trees().count() << "trees.";
90
        }
90
        }
91
        evaluateDebugTrees();
91
        evaluateDebugTrees();
92
        return;
92
        return;
93
    }
93
    }
94
94
Line 264... Line 264...
264
        ru = mModel->ru();
264
        ru = mModel->ru();
265
    Q_ASSERT(ru!=0);
265
    Q_ASSERT(ru!=0);
266
    SpeciesSet *speciesSet = ru->speciesSet(); // of default RU
266
    SpeciesSet *speciesSet = ru->speciesSet(); // of default RU
267
    Q_ASSERT(speciesSet!=0);
267
    Q_ASSERT(speciesSet!=0);
268
268
269
    DebugTimer t("StandLoader::loadiLandFile");
-
 
-
 
269
    //DebugTimer t("StandLoader::loadiLandFile");
270
    CSVFile infile;
270
    CSVFile infile;
271
    infile.loadFromString(content);
271
    infile.loadFromString(content);
272
272
273
    int icount = infile.columnIndex("count");
273
    int icount = infile.columnIndex("count");
274
    int ispecies = infile.columnIndex("species");
274
    int ispecies = infile.columnIndex("species");
Line 314... Line 314...
314
         }
314
         }
315
         mInitItems.push_back(item);
315
         mInitItems.push_back(item);
316
    }
316
    }
317
    // setup the random distribution
317
    // setup the random distribution
318
    QString density_func = GlobalSettings::instance()->settings().value("model.initialization.randomFunction", "1-x^2");
318
    QString density_func = GlobalSettings::instance()->settings().value("model.initialization.randomFunction", "1-x^2");
319
    qDebug() << "density function:" << density_func;
-
 
-
 
319
    if (logLevelInfo())  qDebug() << "density function:" << density_func;
320
    if (!mRandom || (mRandom->densityFunction()!= density_func)) {
320
    if (!mRandom || (mRandom->densityFunction()!= density_func)) {
321
        if (mRandom)
321
        if (mRandom)
322
            delete mRandom;
322
            delete mRandom;
323
        mRandom=new RandomCustomPDF(density_func);
323
        mRandom=new RandomCustomPDF(density_func);
324
        qDebug() << "new probabilty density function:" << density_func;
-
 
-
 
324
        if (logLevelInfo()) qDebug() << "new probabilty density function:" << density_func;
325
    }
325
    }
326
326
327
    // exeucte the
327
    // exeucte the
328
    executeiLandInit(ru);
328
    executeiLandInit(ru);
329
    ru->cleanTreeList();
329
    ru->cleanTreeList();