User Tools

Site Tools


tutorials:radiation-model-in-crop_model7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:radiation-model-in-crop_model7 [2025/05/27 18:18] – created barley1965tutorials:radiation-model-in-crop_model7 [2025/05/27 18:26] (current) barley1965
Line 2: Line 2:
  
 //Open FlowerAging.gsz.//  //Open FlowerAging.gsz.// 
-As you know flowers do not stay on the plant for a long time after blooming; in fact, they perish rather quickly and are dropped altogether or are replaced by a growing fruit after successful pollination. In our model, we can very simply introduce aging and dropping of flowers. First, the Flower requires two new parameters, age and max_age (L. 20): 
  
 +As you know flowers do not stay on the plant for a long time after blooming; in fact, they perish rather quickly and are dropped altogether or are replaced by a growing fruit after successful pollination. In our model, we can very simply introduce aging and dropping of flowers. First, the Flower requires two new parameters, ''age'' and ''max_age'' (L. 20):
 +<code java>
 +module Flower(int age, int max_age)  ==> //insert two new parameters for Flower
 +RU(180) Cone(0.3, 0.3).(setShader(internodemat))  ...
 +</code> 
    
-When the Flower is introduced in the run method for the first time it is initiated like this:+When the Flower is introduced in the ''run'' method for the first time it is initiated like this:
  
 +<code java>
 +Bud(r, p, o), (r == 10) ==> RV(-0.1) Internode(0.05, 1) RV(-0.1) Internode(0.05, 1) Flower(1, irandom(10, 15)); 
 +...
 +</code> 
    
-The initial age is thus 1, whereas the maximum age that the flower can attain is between 10 and 15 days, as determined by this command, irandom(10, 15), which will draw a number between 10 and 15, with equal probability. +The initial age is thus 1, whereas the maximum age that the flower can attain is between 10 and 15 days, as determined by this command, ''irandom(10, 15)'', which will draw a number between 10 and 15, with equal probability.  
 As long as age has not attained max_age, it is incremented by one, i.e. the flower ages: As long as age has not attained max_age, it is incremented by one, i.e. the flower ages:
  
- +<code java> 
 +//increment flower age as long as max age is not reached: 
 +Flower(t, m), (t<m) ==> Flower(t+1, m); 
 +</code>  
 When age is equal to max_age the flower is dropped: When age is equal to max_age the flower is dropped:
  
 +<code java>
 +//shed flower when max age is reached:
 +Flower(t,m), (t>=m) ==>  ;
 +</code> 
    
 Next, we could let the flower be transformed into a fruit (module already declared), with a certain probability, instead of letting it die: In order for this to work you need to write instead of Next, we could let the flower be transformed into a fruit (module already declared), with a certain probability, instead of letting it die: In order for this to work you need to write instead of
-Flower(t, m), (t >= m) ==> ; +<code java> 
- +//shed flower when max age is reached: 
-Flower(t, m), (t >= m) ==> if(probability(0.5)) (Fruit); +Flower(t,m), (t>=m) ==>  
- +</code>  
-  +this: 
 +<code java> 
 +//shed flower when max age is reached: 
 +//Flower(t,m), (t>=m) ==>  ; 
 +Flower(t,m), (t>=m) ==>  if(probability(0.5)) (Fruit) ; 
 +</code> 
  
-Task: Introduce leaf shedding after 20 steps!+//Task: Introduce leaf shedding after 20 steps!//
  
tutorials/radiation-model-in-crop_model7.1748362710.txt.gz · Last modified: 2025/05/27 18:18 by barley1965