function[b]=dyn_plant(x) // b = total biomass generated by the plant in one period //x = vegetative biomass b=r*x^{power} endfunction function[b]=dyn_plant_control(x,v,s) // Growth function, with control v and random term s // b = future vegetative biomass // x = vegetative biomass // v = fractiwe havellocated to growth (control) // s = survival factor (s=1 survival, s=0 death) // if s=0, x transits towards 0 // if s=1, x transits towards v*dyn\_plant(x) if v < 0 | v > 1, b = 'ERROR : control beyond bounds' else if s==0, b=0 //transition towards 0 if the survival factor is zero else b=v*dyn_plant(x) end end endfunction function [cost]=offspring(state,control,time) cost=(1-control)*ateb^{time}*dyn_plant(state); endfunction function[cost]=final_cost_zero(state,time) cost=0; endfunction function[v]=strategy_D(t,x) v=0 endfunction function[v]=strategy_R(t,x) v=rand() endfunction function[v]=strategy_G(t,x) if t