Redwood Forest

Redwood Forest preview image

4 collaborators

Default-person Trevor Cickovski (Author)
Elisabeth Thompson (Author)
Dante Sclafani (Author)
Zachary Zielinski (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.1.0 • Viewed 279 times • Downloaded 13 times • Run 0 times
Download the 'Redwood Forest' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  
  price-current
  price-1
  price-2
  price-3
  price-4
  price-5
  price-6
  
 tickH
 tickM
 
 profit
   ]

patches-own [tree]
turtles-own [  ]

to setup
  ca
  ask patches [set pcolor 35 ]
  ask patches with [(pxcor + pycor) mod 2 = 0] [set pcolor green set tree true]
  set-patch-size 4 

  
crt 1 
[ set size 3
 set heading 90
  setxy 15 165
  set color red
set shape "X"]


  let V (( high-price - low-price ) / 12 ) ^ 2
  let standarddev V ^ 2
set price-current random-normal average-price standarddev 
set price-1 random-normal average-price standarddev
set price-2 random-normal average-price standarddev
set price-3 random-normal average-price standarddev
set price-4 random-normal average-price standarddev
set price-5 random-normal average-price standarddev
set price-6 random-normal average-price standarddev



  reset-ticks
  
ifelse price-current > price-per-tree [set tickH ticks]
 [ifelse price-1 > price-per-tree [set tickH ticks + 1] 
 [ifelse price-2 > price-per-tree [set tickH ticks + 2] 
   [ifelse price-3 > price-per-tree [set tickH ticks + 3]
     [ifelse price-4 > price-per-tree [set tickH ticks + 4]
       [ifelse price-5 > price-per-tree [ set tickH ticks + 5]
         [ifelse price-6 > price-per-tree [ set tickH ticks + 6] [set tickH ticks + 7]]]]]]]
 
  ifelse price-current < price-per-tree and ticks > tickH [set tickM ticks]
[ifelse price-1 < price-per-tree and ticks + 1 > tickH [set tickM ticks + 1] 
 [ifelse price-2 < price-per-tree and ticks + 2 > tickH [set tickM ticks + 2] 
   [ifelse price-3 < price-per-tree and ticks + 3 > tickH[set tickM ticks + 3]
     [ifelse price-4 < price-per-tree and ticks + 4 > tickH [set tickM ticks + 4]
       [ifelse price-5 < price-per-tree and ticks + 5 > tickH [ set tickM ticks + 5]
         [ifelse price-6 < price-per-tree and ticks + 6 > tickH [ set tickM ticks + 6] [set tickM ticks + 7 ]]]]]]]
end  

to go

 let V (( high-price - low-price ) / 12 ) ^ 2
  let standarddev V ^ 2
 

 
 if ticks = tickH [ask turtles [harvest]]
 if [xcor] of turtle 0 + 30 > max-pxcor and [ycor] of turtle 0 - 30 < 0 [stop]
 if ticks = tickM [ask turtles [move]]
 

  
 ifelse price-current > price-per-tree [set tickH ticks]
 [ifelse price-1 > price-per-tree [set tickH ticks + 1] 
 [ifelse price-2 > price-per-tree [set tickH ticks + 2] 
   [ifelse price-3 > price-per-tree [set tickH ticks + 3]
     [ifelse price-4 > price-per-tree [set tickH ticks + 4]
       [ifelse price-5 > price-per-tree [ set tickH ticks + 5]
         [ifelse price-6 > price-per-tree [ set tickH ticks + 6] [set tickH ticks + 7]]]]]]]

 ifelse price-current < price-per-tree and ticks > tickH [set tickM ticks]
[ifelse price-1 < price-per-tree and ticks + 1 > tickH [set tickM ticks + 1] 
 [ifelse price-2 < price-per-tree and ticks + 2 > tickH [set tickM ticks + 2] 
   [ifelse price-3 < price-per-tree and ticks + 3 > tickH[set tickM ticks + 3]
     [ifelse price-4 < price-per-tree and ticks + 4 > tickH [set tickM ticks + 4]
       [ifelse price-5 < price-per-tree and ticks + 5 > tickH [ set tickM ticks + 5]
         [ifelse price-6 < price-per-tree and ticks + 6 > tickH [ set tickM ticks + 6] [set tickM ticks + 7 ]]]]]]]


set price-current price-1 
set price-1 price-2
set price-2 price-3
set price-3 price-4
set price-4 price-5
set price-5 price-6
set price-6 random-normal average-price standarddev
 
 plot-pen-down
 plotxy ticks profit


tick
end 

to move
 if xcor + 30 > max-pxcor and pycor - 30 < 0 [stop]
ifelse xcor + 30 > max-pxcor [set xcor 15 set ycor ycor - 30] [ set xcor xcor + 30]

set profit profit - moving-cost
end 

to harvest

  let harvest-rate (1 - ( retention)) 
  let turtlex xcor
  let turtley ycor             
  let harvestable-trees patches with 
  [ abs (turtlex - pxcor) <= 15 and abs (turtley - pycor) <= 15 and  tree = true ] 
    let num-harvestable-trees (count harvestable-trees)              
  let max-num-cut floor (harvest-rate * num-harvestable-trees)
 
  ask n-of max-num-cut harvestable-trees  [set pcolor brown]
  

  let V (( high-price - low-price ) / 12 ) ^ 2
  let standarddev V ^ 2
  
  set profit max-num-cut * (price-current - price-per-tree)
end  

There is only one version of this model, created almost 9 years ago by Trevor Cickovski.

Attached files

File Type Description Last updated
Redwood Forest.png preview Preview for 'Redwood Forest' almost 9 years ago, by Trevor Cickovski Download
Timber-ODD.docx word ODD Documentation For Redwood Forest almost 9 years ago, by Trevor Cickovski Download

This model does not have any ancestors.

This model does not have any descendants.