02_new_tutorials:parameterfile
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 02_new_tutorials:parameterfile [2025/10/14 12:23] – gaetan | 02_new_tutorials:parameterfile [2025/11/16 10:32] (current) – gaetan | ||
|---|---|---|---|
| Line 82: | Line 82: | ||
| [RU(-30) RH(90) pBud(b[radius]).($[age]=b[age], | [RU(-30) RH(90) pBud(b[radius]).($[age]=b[age], | ||
| ] | ] | ||
| + | |||
| + | boolean tooOld(BaseBud n){ | ||
| + | return n[age]> | ||
| + | } | ||
| </ | </ | ||
| Line 115: | Line 119: | ||
| {{: | {{: | ||
| + | |||
| + | ===== Check parameter " | ||
| + | |||
| + | In order to simulate how these parameters could impact the resulting tree (not only from a 3d view perspective) we can compute a simple descriptor: the total volume of the buds with the method: | ||
| + | |||
| + | <code java> | ||
| + | public void compute_vol() { | ||
| + | double s = sum( (*Sphere*).getVolume() ); | ||
| + | println(" | ||
| + | } | ||
| + | |||
| + | public void complete(){ | ||
| + | for (applyUntilFinished()){ | ||
| + | run(); | ||
| + | } | ||
| + | compute_vol(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Save parameters in file ===== | ||
| + | |||
| + | Let's save the current set of parameter values in a file. In the parameter manager editor click on "save parameters" | ||
| + | |||
| + | |||
| + | ===== Command line & headless ===== | ||
| + | |||
| + | Now we can also set up the project to be run-able in headless and modify parameters from outside of GroIMP, with either: | ||
| + | * Command lines args: to give parameter value, or a parameter file to use | ||
| + | * Modify the parameter file in the project | ||
| + | |||
| + | Add the following to setup the headless to run the '' | ||
| + | |||
| + | <code java> | ||
| + | protected void startup() | ||
| + | { | ||
| + | super.startup(); | ||
| + | if (de.grogra.pf.boot.Main.getProperty(" | ||
| + | { | ||
| + | runLater(null); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | protected void run(Object info) | ||
| + | { | ||
| + | loadPMs(); | ||
| + | complete(); | ||
| + | System.exit(0); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Now run the project in headless with: | ||
| + | < | ||
| + | java -jar core.jar --headless Model.gsz | ||
| + | </ | ||
| + | |||
| + | This will print in the terminal the output value of '' | ||
| + | '' | ||
| + | |||
| + | ==== Command line arg ==== | ||
| + | |||
| + | Let's change some parameter value for the run: | ||
| + | < | ||
| + | java -jar core.jar -PModel.ageLimit=15 -PModel.aging=1 | ||
| + | </ | ||
| + | |||
| + | This should display in the terminal: '' | ||
| + | |||
| + | ==== Change the parameter file ==== | ||
| + | |||
| + | It is also possible to simply change the content of the parameter file by simply opening the file and changing its content. | ||
| + | The file is called '' | ||
| + | |||
| + | < | ||
| + | Model.budType=0 | ||
| + | Model.ageLimit=7 | ||
| + | Model.initialLength=0.5 | ||
| + | Model.aging=0 | ||
| + | </ | ||
| + | |||
| + | And running in headless again: '' | ||
| + | |||
| + | I get the value: '' | ||
| + | |||
| + | |||
| + | ====== QSM Project ====== | ||
| + | |||
| + | Now let's see how these parameters can be fit into a bigger project, the [[:todo|QSM project example]] | ||
| + | |||
02_new_tutorials/parameterfile.1760437439.txt.gz · Last modified: 2025/10/14 12:23 by gaetan
