; creating all variables used other than sliders that are present on interface globals[ StepSize ; how far photon moves with each tick rods-stimulated ; how many rods were stimulated by a burst of photons ystart ; starting y coordinate of yellow photons at the lefthand side of the screen ycell ; default y coordinate for retinal cells in zoomed in window yline ; starting y coordinate of green photons along white line cycles ; one cycle is one run of the simulation (i.e. one burst) number_photons ; the number of photons sent out per burst decays ; number of photons that have been absorbed in a cycle (gets updated continuously) CorneaDecay ; absorption value for cornea per pixel AqueousHumourDecay ; absorption value for aqueous humour per pixel VitreousHumourDecay ; absorption value for vitreous humour per pixel LensDecay ; absorption value for lens per pixel RetinaDecay ; absorption value for lens per pixel nwater ; absorption value for water per pixel with respect to depth irisMin ; magnitude of y coordinate of inside of iris (radius of pupil) bkgdcolor ; a number is assigned to represent a given background colour beamradius ; variable to convert beamwidth slider value (in mm) to pixels photoncount ; a list of the number of photons at each tick from 0 to 600 currentphotons ; variable used to create blue line on the photon vs time graph ; it is the average of the number of photons at a given tick value over the cycles that have occurred gphotons ; the number of green photons that have appeared in the zoomed in retinal panel on the right side of interface ] breed [photons photon] ; breed for turtles that act as photons to allow for easier breed [bolts bolt] ; breed for turtles shaped like lightning bolts that represent the signal that is sent when enough rods are stimulated ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; setup procedures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; regular simulation setup procedure. must be activated after sliders are changed and before any other button to setup clear-all ; set up standard background colour by filling entire interface with grey ask patches [ if pxcor <= max-pxcor [ set pcolor grey ] ] ; create white line to split interface ask patches with [pxcor = 100] [ set pcolor white ] ; the number of pixels a photon will move by on each tick set StepSize 1 ; set variables/lists to 0 and will later be given values set bkgdcolor 0 ; variable to check background colour: 0 if grey, 1 if blue set cycles 0 set gphotons 0 set decays 0 set rods-stimulated 0 set photoncount (n-values 601 [0]) ; set up list to have 601 entries of zero so they can be identified and replaced later ; set decay/absorption rates to match literature values (references outlined in info tab) set CorneaDecay 0.0084929 set AqueousHumourDecay 0.0013648 set VitreousHumourDecay 0.00050404 set LensDecay 0.0010123 set RetinaDecay 0.001358 set nwater 0.002 ; call set scale procedure that creates the scale bars setscale ; call procedures that draw the parts of the eye ; size and distances are scaled version of actual eye layer dimensions sclera VitreousHumour aqueoushumour lens cornea irisStructure retina ; add labels for temporal and nasal sides of the eye ask patch (-60) (175) [set plabel-color 9.9 set plabel "Temporal"] ask patch (-60) (-175) [set plabel-color 9.9 set plabel "Nasal"] ; write "loading ..." in output on interface which will later announce if a visual response has occurred output-write "Loading ..." reset-ticks ; call procedure that makes photons so there are photons when the simulation starts make-photons end ; procedure to create scale bars to setscale ; scale bar for left side of interface ; this scale was calculated to be 12 pixels/mm ask patches with [pxcor >= -290 and pxcor < (-290 + 120) and -180 >= pycor and pycor >= -190] [set pcolor 0] ; draw a 10 mm-long scale bar in the lower left corner ask patch (-215) (-170) [set plabel-color 0 set plabel "10 mm"] ; add the label for the scale bar ; scale bar for right side of interface (zoomed in retinal window) ; this scale was calculated to be 1 pixels/μm ask patches with [pxcor >= 288 and pxcor < (298) and (-190 + 40) >= pycor and pycor >= -190] [set pcolor 0] ; draw a 40 μm-long scale bar in the lower right corner ask patch (298) (-130) [set plabel-color 0 set plabel "40"] ; add the label for the scale bar ask patch (298) (-140) [set plabel-color 0 set plabel "μm"] end ; experimental setup procedure which is the same as standard setup but without calling "clear-all" first as that would clear all plot data on the interface to setupexp ; the following clear procedures are still necessary to reset the interface and variables for each run clear-drawing clear-turtles ; set up standard background colour by filling entire interface with grey ask patches [ if pxcor <= max-pxcor [ set pcolor grey ] ] ; create white line to split interface ask patches with [pxcor = 100] [ set pcolor white ] ; the number of pixels a photon will move by on each tick set StepSize 1 ; set variables/lists to 0 and will later be given values set bkgdcolor 0 ; variable to check background colour: 0 if grey, 1 if blue set cycles 0 set gphotons 0 set decays 0 set rods-stimulated 0 set photoncount (n-values 601 [0]) ; set up list to have 601 entries of zero so they can be identified and replaced later ; set decay/absorption rates to match literature values (references outlined in info tab) set CorneaDecay 0.0084929 set AqueousHumourDecay 0.0013648 set VitreousHumourDecay 0.00050404 set LensDecay 0.0010123 set RetinaDecay 0.001358 set nwater 0.002 ; call set scale procedure that creates the scale bars setscale ; call procedures that draw the parts of the eye. size and distances are scaled version of actual eye layer dimensions sclera VitreousHumour aqueoushumour lens cornea irisStructure retina ; add labels for temporal and nasal sides of the eye ask patch (-60) (175) [set plabel-color 9.9 set plabel "Temporal"] ask patch (-60) (-175) [set plabel-color 9.9 set plabel "Nasal"] ; write "loading ..." in output on interface which will later announce if a visual response has occurred output-write "Loading ..." reset-ticks ; call procedure that makes photons so there are photons when the simulation starts make-photons end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; draw eye layers & cells ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; procedure to draw cornea to Cornea ; draw cornea by filling in the region between a circle and ellipse ; the outer circle has the same radius of curvature as the cornea ; the inner ellipse is placed at the literature distance from the outer layer ask patches with [(pxcor + 144) ^ 2 + (pycor) ^ 2 < 8761 and (pxcor + 140 ) ^ 2 + (pycor / 1.05) ^ 2 > 8661] [ set pcolor pink ] end ; procedure to draw sclera to Sclera ; fill in region between concentric circles ; circle size was determined so that the distance between the cornea and the back of the sclera would be equivalent to 24 mm ask patches with [(pxcor + 80 ) ^ 2 + (pycor) ^ 2 < 20000 and (pxcor + 80 ) ^ 2 + (pycor) ^ 2 > 19000] [ set pcolor red ] ; call procedures to replace region of sclera with the retinal test patch RetinaPatch end ; procedure to create test patch region on retina to RetinaPatch ; fills in a region of the retina 2 pixels out from either side of a line that passes from the centre of the light beam through the centre of the lens (line of no refraction for photons) ; this region is the smaller depiction of the zoomed in window on the right-side of interface in which the number of rods stimulated will be recorded ask patches [ if pcolor = red and (((47 / 130)* pxcor + (31)) >= pycor and pycor >= ((47 / 130)* pxcor + 27) and pxcor >= 0) [set pcolor 94] ] end ; procedure to draw aqueous humour to AqueousHumour ; fill in region between cornea and lens with white (representing the humour) ask patches with [(pxcor + 140) ^ 2 + (pycor) ^ 2 < 8761 and -200 >= pxcor] [ set pcolor white ] end ; procedure to draw lens to Lens ; lens drawn as region contained by two circles with radii equivalent to the anterior and posterior radii of curvature of the lens ask patches with [(pxcor + 79) ^ 2 + (pycor) ^ 2 < 14400 and (pxcor + 211) ^ 2 + (pycor) ^ 2 < 5184] [ set pcolor 88 ] end ; procedure to draw vitreous humour to VitreousHumour ; fill in any grey region within the sclera with white (representing humour) ask patches with [(pxcor + 80 ) ^ 2 + (pycor) ^ 2 < 20000 and pcolor = grey] [ set pcolor white ] end ; procedure to draw iris and pupil structure to irisStructure ; first relate pupil slider to size of iris ; set the magnitude for the inner y coordinate of the iris to be the radius of the pupil in pixels set irisMin ((12 * (Pupil / 2))) ; create top half of iris ask patches with [(72 >= pycor and pycor >= irisMin and -200 >= pxcor and pxcor >= -203)] [ set pcolor 34 ] ; create bottom half of iris ask patches with [((- irisMin) >= pycor and pycor >= -72 and -200 >= pxcor and pxcor >= -203)] [ set pcolor 34 ] end ; procedure to draw retinal cells using rectangles to retina ; set default y coordinates for retinal cells set ycell 195 ask patches [ if ycell >= pycor and pycor >= -195 [ ; create retinal ganglion cells which are the lightest blue ones furthest to left ask patches with [190 >= pxcor and pxcor >= 175 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 98 ] ; create bipolar cells wihch are the next cells to the right of the retinal ganglion cells ask patches with [210 >= pxcor and pxcor >= 195 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 97 ] ; create rods which are the longer cells to the right of the bipolar cells ask patches with [265 >= pxcor and pxcor >= 215 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 96 ] ; create retinal pigment epithelium cells ; goes all the way across since they're densely packed and are the last layer which then absorbs scattered light ask patches with [280 >= pxcor and pxcor >= 270 and 200 >= pycor and pycor >= -200] [ set pcolor 95 ] ; decrease y values of the retinal ganglion cells, bipolar cells, and rods by 5 on each loop to create evenly spaced cells set ycell (ycell - 5) ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; underwater setup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; underwater setup procedure that alters the started setup to underwater clear-turtles clear-drawing set bkgdcolor 1 ; set this variable to 1 to indicate that the background is now blue set avgphotons 1000 ; assuming that 1000 photons are entering the water at sea level ; set background colour to be blue to represent water ask patches with [pcolor = grey and 100 > pxcor] [ set pcolor 105 ] ; call goggle procedures goggles ; reset the iris region to be white so it can be replaced by the appropriate pupil size ; for the given depth chosen on the slider prior to pressing the underwater button ask patches with [ 72 >= pycor and pycor >= -72 and -200 >= pxcor and pxcor >= -203] [ set pcolor white ] ; set pupil size to increase with depth (based on what is selected on slider) ; nwater values are also set according to literature values with respect to depth to simulate ; the decrease in light intensity as depth increases ; the size of the pupil increases with depth if 0 >= depth and depth > -2 [ set nwater 0 ; absorption values are based on the shallowest depth, in this case 0 m from sea level set pupil 2 irisStructure ] if -2 >= depth and depth > -4 [ set nwater 0.008355 set pupil 3 irisStructure ] if -4 >= depth and depth > -6 [ set nwater 0.01585 set pupil 4 irisStructure ] if -6 >= depth and depth > -8 [ set nwater 0.02332 set pupil 5 irisStructure ] if -8 >= depth and depth > -10 [ set nwater 0.0303 set pupil 6 irisStructure ] if -10 >= depth and depth > -12 [ set nwater 0.0394 set pupil 7 irisStructure ] if -12 >= depth and depth >= -14 [ set nwater 0.0461 set pupil 8 ; assuming the maximum dilation of the eye occurs at a depth between -12 m and -14 m irisStructure ] if -14 >= depth and depth >= -16 [ set nwater 0.0506 set pupil 8 irisStructure ] if -16 >= depth and depth >= -18 [ set nwater 0.6060 set pupil 8 irisStructure ] make-photons end ; draw goggles around eye to goggles ; create air pocket between goggle lens and eye ask patches with [ pcolor = 105 and 100 >= pxcor and pxcor >= -269 and 145 >= pycor and pycor >= -145] [ set pcolor grey ] ; lens of goggles ask patches with [ -267 >= pxcor and pxcor >= -271 and 145 >= pycor and pycor >= -145] [ set pcolor 89 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; make-photons ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; procedure to make intial photons to make-photons ; set the number of photons per burst with a Poisson distribution centred at the average photons chosen on the slider set number_photons (random-poisson avgphotons) create-photons Number_Photons [ ; translate mm to pixels and diameter of beam to radius set beamradius (0.5 * 12 * beamwidth) ; centre light beam around (-300, -564/23) which is the point on the line though the centre of the mens and to the retinal patch when x = -300 set ystart ((-564 / 23) - beamradius + random(2 * beamradius)) set shape "Arrow" set color 66 ; starting photons are green ; the starting y coordinate for the inital photons can be -564/23 +/- the beam radius setxy -300 ystart ; set up angle of beam (from up as 0°) if(bkgdcolor = 0) ; grey background (air) [ set heading 78 ; angle that causes centre of beam to pass through centre of lens and reach retina with no refraction ] if(bkgdcolor = 1) ; blue background (water) [ set heading 46 ; angle calculated using Snell's Law for refraction that occurs when light moves from air to water ] set size 15 pen-down ] reset-ticks end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; go procedures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to burst ask photons [ forward StepSize ; the photons move forward 1 pixel/tick ;;;;;;;; specifying the absorption values for each layer of the eye ;;;;;;;;; ; absorption and refraction at cornea if pcolor = pink [ facexy 55 48 ; focal point is just beyond retina absorbcornea ] ; absorption in humours if pcolor = white [absorbhumour] ; absorption and refraction at lens if pcolor = 88 [ ; call absorption absorblens ; if photons reach center of lens, refract if pxcor = -180 [ facexy 50 47 ; bend to focus light on retinal patch (correct cornea refraction) ] ] ; the iris is the structure that preventing photons from passing, except if they are within the pupil if pcolor = 34 [ set decays decays + 1 die ; when the photons hit the iris they die ] ; underwater media absorption for when underwater procedure activated by button if pcolor = 105 [waterabsorb] ; refraction at goggles if pcolor = 89 [ set heading 78 ; based on refraction values in air ] ;;;;;;;; absorption within right panel of the interface ;;;;;;;;;;;;;;;;;;;;;;;; ; absorption of photons by rods if 270 >= xcor and xcor >= 175 ; contains the entire area of the retina on the right panel of the interface [ absorbretina ] ;; if incident photon hits retinal test patch, moves to random y-coordinate at x = 105 in the retina if pcolor = 94 ; the colour of the retinal test patch [ set yline random-ycor ; provides variation along the y-axis of the retina pen-up set color 67 ; changes the photons to the colour green set size 10 set shape "circle" setxy 105 yline facexy 300 yline wait 0.03 ; create time delay between photon hitting patch and appearing in window, for cosmetic purposes pen-down ] if pcolor = 95 [die] ; absorbed by retinal epithelium layer if pcolor = red [die] ; absorbed by the sclera if pxcor = 100 [die] ; for initial photons that pass the eye, ensures they don't enter the retina ] ; if one of the patches changes to the yellow colour, all remaining blue rod pixels change to yellow ask patches [ if pcolor = 46 [ ask neighbors [ if pcolor = 96 [ set pcolor 46 ; changes final colour to yellow ] ] ] ] ; the following steps are called if the number of rods stimulated is at least equal to the number of photons needed to be ; absorbed by rods to elicit a visual response as chosen in the n slider if rods-stimulated >= n [ create-bolts 1 ; the presence of a bolt is a visual depiction of a light signal being sent to the brain [ set shape "lightning" set color 46 set size 75 setxy 140 0 ; the bolt forms to the left of the cells of the retina ] ] ; after all photons have died if any? photons = false [ ifelse rods-stimulated >= n [ ; if enough rods have been stimulated for a given burst, "visual response" is shown in the output monitor on interface clear-output output-write "Visual Response" ] [ ; if not enough rods have been stimulated for a given burst, "no visual response" is shown in the output monitor on interface clear-output output-write "No Visual Response" ] ] ; data for 'average' line of cycles in photons vs time graph ; photoncount updates the index with the current photons, in addition value of the array at that tick from past cycles ; photoncount is an array that indicates the total number of photons for a given time (tick) value set photoncount (replace-item ticks photoncount ((item ticks photoncount) + (count photons))) ; currentphotons is a running average of the photons at a given time (tick), across cycles set currentphotons ((item ticks photoncount) / (cycles + 1)) tick ; once the green photons enter the zoomed in retina window, but before the retina, gphotons is updated ; gphotons is used to calculate the number of photons that successfully entered the retinal patch if ticks = 390 [ set gphotons (count photons) ] if ticks = 600 [stop] ; a full cycles has been completed after 600 ticks end to rerun burst ; call the single go procedure (burst) ; allows 10x cycles each with 600 ticks to be run if ticks = 600 [ set cycles (cycles + 1) reset-ticks set gphotons 0 set decays 0 resetYellow ; reset the color and state of rods clear-drawing make-photons clear-output output-write "Loading ..." ] if cycles = 10 [stop] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; absorb ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; when within the pink-coloured cornea region, probabilistic absorption photons occurs to absorbcornea if random-float 1 < CorneaDecay ; calculated absorption/pixel for the cornea [ set decays decays + 1 ; allows for the number of absorbed ('decayed') photons to measured die ; these photons do not proceed towards the retina ] end ; when within the white-coloured aqueous and vitreous humour region, probabilistic absorption occurs to absorbhumour if -180 >= pxcor [ if random-float 1 < AqueousHumourDecay ; calculated absorption/pixel for aqueous humour [ set decays decays + 1 die ] ] if pxcor >= -180 [ if random-float 1 < VitreousHumourDecay ; calculated absorption/pixel for vitreous humour [ set decays decays + 1 die ] ] end ; when within the lens region, probabilistic absorption occurs to absorblens if random-float 1 < LensDecay ; calculated absorption/pixel for lens [ set decays decays + 1 die ] end ; account for the refractive index of water that surrounds the eye when underwater to waterabsorb if random-float 1 < nwater ; nwater changes based on depth, in "underwater setup" [ set decays decays + 1 die ] end ; when within the retina region, probabilistic absorption occurs to absorbretina if random-float 1 < RetinaDecay ; calculated absorption/pixel for the retina [ ; if in the blue rods, visually show activated rods with yellow ifelse pcolor = 96 [ set rods-stimulated (rods-stimulated + 1) ; shows that the rods have been stimulated if [pcolor] of patch-ahead 1 != 46 ; change pcolour, as long as the patch 1 ahead is not already yellow (activated) [ set pcolor 46 ; change pcolour to yellow to show activation ] die ] ; if not in the retina region, the same retina absorption rate will apply [ set decays decays + 1 die ] ] end ; used after each cycle to reset the patch colour and remove the lightning bolt to resetYellow ask patches [ if pcolor = 46 [ set pcolor 96 set rods-stimulated 0 ] ask bolts with [color = 46] [die] ] end ; ISCI 2A18 Enrichment Project 2023 ; More detailed information about model in the "Info" tab ; Authors: Jeremy Dykstra and Naya Davidson-Lindfors ; Supervisor: Dr. Cecile Fradin @#$#@#$#@ GRAPHICS-WINDOW 210 10 819 420 -1 -1 1.0 1 10 1 1 1 0 0 0 1 -300 300 -200 200 0 0 1 ticks 30.0 BUTTON 18 45 137 78 NIL Setup NIL 1 T OBSERVER NIL S NIL NIL 1 BUTTON 19 168 137 201 Repeat rerun T 1 T OBSERVER NIL R NIL NIL 1 MONITOR 18 538 191 583 Rods Stimulated rods-stimulated 17 1 11 PLOT 513 429 818 700 Rods Stimulated vs Average Photons Average Number of Photons Number of Rods Stimulated 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 2" "" PENS "pen-1" 1.0 0 -16777216 true "" "if ticks = 599 [ plotxy avgphotons rods-stimulated ]" PLOT 208 430 505 698 Photons vs Time Time (ticks) Number of Photons 0.0 600.0 0.0 200.0 true false "" "" PENS "default" 1.0 0 -4539718 true "" "plotxy ticks (count photons)\nif ticks = 0 [\nplot-pen-down\n]\nif ticks = 600 [\nplot-pen-up\n]" "pen-2" 1.0 0 -13791810 true "" "plotxy ticks currentphotons\nif ticks = 600 [\nplot-pen-reset \n]" MONITOR 19 430 191 475 Photons Absorbed decays 17 1 11 MONITOR 18 593 192 638 Cycles cycles 17 1 11 SLIDER 18 214 190 247 avgphotons avgphotons 0 600 1000.0 1 1 NIL HORIZONTAL SLIDER 18 260 190 293 beamwidth beamwidth 0 15 10.0 1 1 mm HORIZONTAL BUTTON 18 128 137 161 Burst burst T 1 T OBSERVER NIL B NIL NIL 1 SLIDER 18 306 190 339 Pupil Pupil 2 8 4.0 1 1 mm HORIZONTAL SLIDER 153 46 186 201 depth depth -18 0 -4.0 1 1 m VERTICAL BUTTON 18 86 136 119 Underwater underwater NIL 1 T OBSERVER NIL W NIL NIL 1 MONITOR 18 484 191 529 Photons at Retina gphotons 17 1 11 TEXTBOX 17 17 236 61 Light to Brain Simulation 14 0.0 1 SLIDER 19 348 191 381 n n 5 14 5.0 1 1 NIL HORIZONTAL TEXTBOX 23 386 189 408 n: number of rods required to be stimulated for a visual response 9 0.0 1 OUTPUT 18 648 193 694 12 @#$#@#$#@ ## WHAT IS IT? This simulation models the probability of the number of photons absorbed by rods within the retina. The threshold of human vision is characterized by the minimum number of photons required to elicit a visual effect in the brain. Photons must enter through the layers of the eye before probabilistically triggering the visual transduction pathway. Through modelling this pathway in NetLogo, a better understanding of the variables involved in this process can be obtained, allowing the simulation to be used as a teaching tool. Our model accounts for changes in vision underwater by enabling the user to manipulate depth which alters light intensity and pupil diameter. Our model was based on the Hecht et al. (1942) experiment, where the threshold energies for vision of the human eye were determined. Reference: Hecht, S., Shlaer, S. and Pirenne, M.H., 1942. Energy, Quanta, and Vision. _Journal of General Physiology_, 25(6), pp.819–840. https://doi.org/10.1085/jgp.25.6.819. ## HOW IT WORKS At each tick, the photons move forward and have a chance of being absorbed, depending on the layer of the eye they are situated in. When a photon gets absorbed by a rod, it turns the rod yellow, indicating it is stimulated. If the necessary number of rods are stimulated for a given burst of photons, there is a visual response. ## HOW TO USE IT Before clicking any buttons on the interface, adjust sliders as desired. Set the average number of photons sent per burst using the ‘avgphotons’ slider. Adjust the width of the light beam in millimetres using the ‘beamwidth’ slider. You can also adjust the pupil diameter in millimetres using the “Pupil’ slider, which can simulate how the eye responds to different light levels. The ‘n’ slider sets the minimum number of rods that must be stimulated for a visual response to occur. The eye will need to have n photons absorbed by the retina for the burst of light to be seen. For underwater mode exclusively, you can set the depth of the eye below sea level (in metres) using the ‘depth slider’ which will also adjust pupil size and the intensity of light that reaches the eye. Once the sliders have been adjusted, push the ‘Setup’ button to set up the model which includes drawing the structure of the eye and generating starting photons. If you would like to simulate underwater vision, select the ‘Underwater’ button after ensuring the depth is set. This button automatically sets the average number of photons to be 1000 to represent a high amount of photons from sunlight at sea level. It also sets the absorption value of the water and the pupil diameter to match the chosen depth. There are two different go procedure buttons on the interface: ‘Burst’ or ‘Repeat’. To run the model once, press the ‘Burst’ button. This sends a single burst of photons towards the retina, the number of which is determined by a Poisson distribution centred at the average photons set on the ‘avgphotons’ slider. If you want to run this procedure again, press ‘Setup’ first. To run the model for 10 cycles, press the ‘Repeat’ button. This will reset the simulation when ticks = 600 (the length of one cycle). It will clear all paths drawn by photons, stimulated rods and variables, while maintaining the plots to allow for the collection of data when resetting the world. This simulation also has an experiment set up using the ‘BehaviorSpace’ tool that mimics the Hecht et al., 1942 paper. First press ‘Setup’ and then go to Tools>BehaviorSpace (shift + command + B). You can then run the experiment labelled ‘Hecht et al. (150 runs)’ which runs 10 cycles of ‘Burst’ with the experimental setup. We will run 10 cycles of ‘burst’ with the experimental setup. The average photon count will start at 20 and increase by 40 until 300 photons. The diameter of the pupil was set to 8 mm, to simulate the ‘complete dark adaption’ for at least 30 minutes in the dark before the experimenters started to record data. The beam of light was set to 10 mm to simulate a large enough band of light that will consistently allow all the photons to enter the pupil. To view full plotting on the interface graphs change ‘simultaneous runs in parallel’ to 1, rather than the suggested number by NetLogo. This experiment uses the experimental setup procedure differs slightly from the regular ‘setup’ since it ‘clears-drawing’ and ‘clear-turtles’ after each burst of light sent. Within the experiment, the number of average photons was represented by ‘avgphotons’. You can tell if a signal has been sent if a lightning bolt appears on the right side of the screen. There will also be a message displayed in the output on the output monitor in the interface saying ‘Visual Response’ if a signal has been sent, or ‘No Visual Response’ if not enough rods were stimulated. The monitors on the interface help quantify what is occurring in the simulation. The ‘Photons Absorbed’ monitor indicates the number of photons that are absorbed and will increase during one run of the simulation. The ‘Photons at Retina’ monitor updates once the photons enter the zoomed-in retinal window on the right-side of the interface with the number of photons present. ‘Rods Stimulated’ updates with the number of rods stimulated per burst sent. When ‘Repeat’ is selected, the ‘Cycles’ monitor updates with how many cycles are completed. The ‘Photons vs Time’ plot displays the number of photons present with respect to time. When running ‘Repeat’, the plot continues to update with each run being represented in grey and a blue line traces out the average of the runs completed. The ‘Rods Stimulated vs Average Photons’ places a point at the number of rods stimulated for a given average number of photons at the end of each cycle. ## THINGS TO NOTICE **‘Setup’ Button** Notice how the ‘Photons Absorbed’ monitor changes as the beam moves across the interface. Why do some photons travel straight through the eye without refracting? Think about approximations that can apply to a lens. Given how it behaves in the model, what do you think is the purpose of the retinal epithelium layer (the darkest blue rectangle in the zoomed in window on the right)? Watch how the number of photons change with time on the ‘Photons vs Time’ graph. What does the blue line on the graph trace out? Think about how it changes as the simulation repeats with the ‘Repeat’ button. **‘Underwater’ Setup Button** Watch how the photons change direction as they enter different layers of the eye (ex. surrounding media, cornea, humours, lens). How does this vary between the regular setup and underwater setup? How does the number of photons absorbed in the water media change with depth? Does this increase or decrease? How do the goggles affect the incident beam of light? Why would you need so many more initial photons for the underwater setup? ## THINGS TO TRY Test different depths with the slider in the ‘underwater’ mode. What do you notice? How does the pupil or absorption of photons change with depth? Test different amounts of average photons. How does the number of photons emitted from the light source affect the production of a visual response? Change the ‘n’ slider. How does adjusting the number of rods activated to produce a visual response, change the frequency of visual responses? How does it change the number of average photons that are required to be emitted? ## EXTENDING THE MODEL Add cones to create a more accurate retinal mosaic to account for colour vision. Consider different wavelengths of light, by adding a slider to allow for the user to change the light conditions. Also, allow the refraction and absorption patterns to be changed by an adjustment in wavelength. Try a different test patch on the retina, with respective rod and cone densities, that may have a lower or higher sensitivity to light. Allow the user to change the angle of the light beam. Account for the case where two photons simultaneously stimulate the same rods. As of right now, it counts this as two rods stimulated. Try replacing the light beam with an object. This means the lens may have to change shape (different radii of curvature) depending on the object’s distance from the eye. Account for how the pupil diameter changes with depth according to literature values. ## RELATED MODELS **Models Referenced:** * Radioactivity: “Decay” * “Plotting Example” [NetLogo Library](https://ccl.northwestern.edu/netlogo/models/) ## CREDITS AND REFERENCES **This Model was Inspired by the Journal Article:** Hecht, S., Shlaer, S. and Pirenne, M.H., 1942. Energy, Quanta, and Vision. _Journal of General Physiology_, 25(6), pp.819–840. https://doi.org/10.1085/jgp.25.6.819. **NetLogo Simulation Citations:** Wilensky, U., 1999. NetLogo (6.3.0). [computer program] Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. Available at: http://ccl.northwestern.edu/netlogo/. For literature values, description of process, and full citation list: [Full Model Documentation](https://docs.google.com/document/d/e/2PACX-1vTtnStchPPc9VYzT0HuIEv7DSNlYoujIzPAwKuOrJW7B-Gd-u5BHWQNxfIkPgRbLHcbN9GZtlg2bQ5o/pub) ## HOW TO CITE For use of this NetLogo model, we ask that you cite the publication following the below format. **To cite the 'Light to Brain' model specifically:** Davidson-Lindfors, N. and Dykstra, J. (2023). NetLogo Light to Brain model. School of Interdisciplinary Science, McMaster University, Hamilton, ON. **To cite the NetLogo software:** Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 lightning false 0 Polygon -7500403 true true 120 135 90 195 135 195 105 300 225 165 180 165 210 105 165 105 195 0 75 135 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 6.3.0 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setupexp burst ticks = 600 avgphotons gphotons rods-stimulated any? bolts @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@