BundledTurtles3

No preview image

1 collaborator

Default-person Marcelo Worsley (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 4.1 • Viewed 108 times • Downloaded 7 times • Run 0 times
Download the 'BundledTurtles3' modelDownload this modelEmbed this model

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


WHAT IS IT?

Bundling turtles is a simulation that allows for students to explore why it's best to huddle up when you're code. The simulation also has sensor based components that can work with a GoGo Board. The model was designed to approach this problem from a altogether non-scientifically rigorous perspective. It does not contain any mathematical equations. Instead it provides a space for students to learn about heat transfer outside of the formulaic work that they see in school.

HOW IT WORKS

The simulation allows the user to adjust the number of people, size of the room, level of activity, the presence of a fire, the amount of heat generated by the fire, and the amount of heat radiated by each individual. It also has build in features for doing automatic people clustering. The user can adjust these different sliders to get a better understanding of how certain aspects of heat radiation and absorption work. Additionally, there is a bifocal modeling component that leverages a temperature probe. Using this probe students can get a group of their friends and try to create a computer model that matches their behavior.

HOW TO USE IT

Press the gogo-setup button, select the appropriate port.

Adjust the parameters as you please and then press go.

THINGS TO NOTICE

One thing to notice is that all of the parameters have different impacts on how warm people feel.

THINGS TO TRY

Try making a change to a single slider while holding everything else constant to see how the different parameters affecting the model. You may also like to set up something in behaviorspace that allows you to easily watch what's taking place.

EXTENDING THE MODEL

1. Adding a more accurate unit comparison for temperature and time. These would help in the bifocal modeling aspect and allow you to go more in depth on the numerical differences that may occur in the real world but are omitted from the simulation.

2. Add a fan to the room so that it can start to cool off if things get to hot. This would be quite easy to also add to the gogo board.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

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

Click to Run Model

extensions [gogo]
breed [persons person]
breed [heats hot]
patches-own [ pheat border outside]
persons-own [ heat ]
heats-own [life]
globals [ serial-port max_heat raw_height raw_width xlist ylist sum_heat room_heat room_size gogo_in_use]

to setup-gogo
   set serial-port user-one-of "Select a port:" gogo:ports
  gogo:open serial-port
  repeat 5
  [ if not gogo:ping
    [ user-message "The GoGo Board is not responding." ] ]
  gogo:talk-to-output-ports [ "a" "b" "c" "d" ]
  set gogo_in_use true
end 

to setup
  clear-all
  set room_size (room-width * room-width)
  set xlist []
  set ylist []
  set sum_heat 0
  set room_heat 0
  create-campfire-people
  create-fire
  set raw_height (room-width / 2)
  set raw_width (room-width / 2)
  set gogo_in_use false
  draw-box
  initiate-people
  ;;show-heat
end 

to add-people
   create-persons 1[
    set shape "person"
    set size 2
    set color brown
    set-random-direction
    set heat human-heat
    forward distance_from_center
    ]
   set people (count persons)
end 

to go
  if (use-light-sensor) [set fire (gogo:sensor 1 > light-threshold)]
  find-people
  add-fire-heat
  ifelse activity[
  move-people
  radiate-heat
  absorb-heat]
  [add-heat
  radiate-heat
  absorb-heat]
  do-sums
  if (sum_heat < auto-cluster-threshold)
  [
    if (auto-cluster)
    [cluster-people]
  ]
  if room_heat < 0 [set fire true]
  do-plot
end 

to cluster-people
  ask persons[
    facexy 0 0
    forward 1
  ]
end 

to create-campfire-people
  create-persons people[
    set shape "person"
    set size 2
    set color brown
    facexy xcor max-pycor
    set heat human-heat
    ]
end 

to create-fire
  if fire[
  ask patch 0 0 [ 
    set pheat 100
    set pcolor 15
  ]]
end 

to draw-box
;;creating a bounding box based on the size of input
ask patches[ 
  if ((abs pxcor = raw_width and abs pycor <= raw_height) or (abs pycor = raw_height and abs pxcor <= raw_width))
  [set pcolor white
    set border true]
]
end 

to initiate-people
  let angle (360 / people)
  let cpeople 0
  ask turtles[
    rt ( angle * cpeople )
     forward distance_from_center
     set cpeople (cpeople + 1)
    ]
end 

to find-people
;;used to keep track of different turtle locations in the form of two lists
  ask persons[
    set xlist lput xcor xlist
    set ylist lput ycor ylist
  ]
end 

to add-fire-heat
ifelse fire
[
  create-heats fire_heat [
    set shape "dot"
    set size 1
    set life 4
    set xcor 0
    set ycor 0
    set color blue
    ]
  ]
  [
    if gogo_in_use[carefully [
      create-heats (1028 - gogo:sensor 1) [
        set shape "dot"
        set size 1
        set life 4
        set xcor ((random room-width) + (0 - raw_width)) 
        set ycor ((random room-width) + (0 - raw_height)) 
        set color blue
        ]
    ]
    []
    ]
   ]
end 

to add-heat
  ;; add up the heat of each person and see how long it takes for the temperature in the room to change
  let iter 0
  
  repeat people
  [
    create-heats heat_rad[
    set shape "dot"
    set size 1
    set life 3
    set xcor (item iter xlist )
    set ycor (item iter ylist)
    set color blue
    ]
    set iter (iter + 1)
  ]
end 

to radiate-heat
  ask heats [
    if (color != orange and color != white) 
    [set-random-direction]
    check-border
    if (color = white) [set life (life - 1)]
    if (life = 0) [die]
    if color = orange [set color white]
    if color = blue [ set color orange]
    ]
  ask persons [set heat (heat - (heat_rad))]
  ;; have each turtle emit some heat to the room
end 

to absorb-heat
  ask persons [ 
    let hcount 0 
    ask patch-here [ask heats-here [ 
        if color = blue[set hcount (hcount + 1)]
        if color = orange [ set hcount (hcount + 0.9)]
        if color = white [set hcount (hcount + 0.75)]
        die
        ]]
    ifelse activity[set heat (heat + hcount + (activity_level * room_heat))]
    [ set heat (heat + hcount + room_heat)]
  ]
  ifelse activity[set room_heat ((room_heat * room_size) - (count persons * room_heat * activity_level))]
  [set room_heat ((room_heat * room_size) - (count persons * room_size))]
  ;;have turtles absorb heat if the current patch has more heat than they do?
end 

to set-random-direction
  facexy ((random 32) + -16)  ((random 32) + -16)
end 

to check-border
  let checkcolor false
    ask patch-ahead 1[set checkcolor (pcolor = white)]
    ifelse checkcolor = false
    [forward 1]
    [set-random-direction]
end 

to move-people 
  repeat activity_level [
    add-heat
    ask persons 
    [
      if activity[set-random-direction
      check-border]
      absorb-heat
     ]
    find-people
  ]
end 

to do-sums
set sum_heat 0
set room_heat 0
set room_heat (room_heat * room_size)

ask persons[
  set sum_heat (sum_heat + heat)
]
ask heats[
  ifelse color = orange
  [set room_heat (room_heat + 1)]
  [set room_heat (room_heat + 0.5)]
]

set sum_heat (sum_heat / people)
set room_heat (room_heat / room_size)
end 

to do-plot
  set-current-plot "people-heat"
  plot sum_heat
  set-current-plot "room-heat"
  plot room_heat
  set-current-plot "actual_heat"
  plot gogo:sensor 8
end 

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

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.