Timber Company

Timber Company preview image

3 collaborators

Default-person Trevor Cickovski (Author)
Maggie Fenney (Author)
Keren Sangalaza (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 399 times • Downloaded 25 times • Run 0 times
Download the 'Timber Company' 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

turtles-own [myplant myharvest]


patches-own [height]

globals [totalplanted totalharvested totalfeet totalprofit totalhours]

to setup
  clear-all
  
ask patches 
  [set pcolor brown
    set height 0] ;; all patches are brown

ask n-of number_of_trees patches
   [set pcolor green
   set height random 35] ;; patches with a random height between 1-35 are green

  let planters workers_to_plant * planting_rate
  
  let harvesters workers_to_harvest * harvesting_rate
  
  let NumTurtles planters
  if harvesters > planters 
  [set NumTurtles harvesters]
  
  show NumTurtles
  create-turtles NumTurtles ;; create turtles based on the sliders and input boxes on the interface 
  [set size 3
  setxy random-xcor random-ycor
  set color 37
  set myharvest harvesting_rate / workers_to_harvest
  set myplant planting_rate / workers_to_plant
  ]
   set-default-shape turtles "person lumberjack"
   
   
   reset-ticks 
end 

to go
  

set totalplanted 0
set totalharvested 0
set totalfeet 0
   
 
 
  tick ;; tick every step
  if ticks >= 350
   [stop]
 
  
  
  ;; grow
  ask patches[
   if pcolor = green  
   [set height height + ( 1.25 )] ;; if the patches are green (trees), set their random height (between 1-35) to grow 1ft
   
   ]
  
  ;;harvest
  ask turtles[
    repeat myharvest[
     let tree one-of patches with  [height >= 30] 
     if tree = nobody [stop] move-to tree
     set pcolor brown
     set totalfeet totalfeet + height
     set height 0 
     set totalharvested totalharvested + 1]
    
    
    
  ]
  ;;plant
  ask turtles[
     repeat myplant[
     let dirt one-of patches with [pcolor = brown]
     if dirt = nobody [stop] move-to dirt
     set pcolor green
     set height 1
     set totalplanted totalplanted + 1]
 
  ]
  
     
    set totalprofit (hours_to_plant * workers_to_plant * wage * totalplanted) 
    - (hours_to_harvest * workers_to_harvest * wage * totalharvested) - (totalplanted * cost_of_seedling) 
    + (totalharvested * 600) + (totalfeet - totalharvested * 30) * (20)
    
    show totalprofit
    
    set totalhours (hours_to_harvest * harvesting_rate) + (hours_to_plant * planting_rate)
end 

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

Attached files

File Type Description Last updated
ODD.docx word ODD Documentation for Timber Company about 10 years ago, by Trevor Cickovski Download
Timber Company.png preview Preview for 'Timber Company' about 10 years ago, by Trevor Cickovski Download

This model does not have any ancestors.

This model does not have any descendants.