globals [ erase? draw? box-width j window1 window2 window3 window4 window5 window6 cat1 cat2 cat3 cat4 cat5 cat6 rank1 rank2 rank3 rank4 rank5 activ-c1 activ-c2 activ-c3 activ-c4 activ-c5 activ-w ranker columns d1 d2 d3 d4 d5 ch1 ch2 ch3 ch4 ch5 reset-sensors-during-match-process save-file condition answer-list ] patches-own [ activation weight-access ] ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: SETUP ::::::::::::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to Setup-inputs ca ifelse (inputs > sensors) [set columns inputs][set columns sensors] set box-width floor ( screen-size-x / (columns )) let i 1 set draw? true set erase? true ask patches [set weight-access true ] set reset-sensors-during-match-process false set window1 [ ] set window2 [ ] set window3 [ ] set window4 [ ] set window5 [ ] set window6 [ ] set cat1 [ ] set cat2 [ ] set cat3 [ ] set cat4 [ ] set cat5 [ ] set cat6 [ ] set ranker [ ] set d1 2 set d2 2 set d3 2 set d4 2 set d5 2 set ch1 0 set ch2 0 set ch3 0 set ch4 0 set ch5 0 set activ-c1 [ ] set activ-c2 [ ] set activ-c3 [ ] set activ-c4 [ ] set activ-c5 [ ] ;repeat (columns - 1 ) [ ask patches with [ pxcor = floor (- screen-edge-x + box-width * i ) ] [ set weight-access false] repeat (columns - 1) [ ask patches with [ pxcor = floor (- screen-edge-x + box-width * i ) ] [ set weight-access false] set i i + 1 ] ask patches with [ pycor = 0 or pxcor = screen-edge-x or pxcor = (- screen-edge-x) ] [ set weight-access false] set i 1 cct (columns + 1) [ set size 0 ] ask turtle 0 [ set xcor 0 set ycor 0 set heading 90 pd set pen-size 3 fd 2 * screen-size-x ] repeat (columns - 1) [ ask turtle i [ set xcor (floor ( - screen-edge-x + box-width * i )) set ycor 0 set heading 0 pd set pen-size 3 fd 2 * screen-size-x ] set i i + 1 ] ask patches with [ weight-access and pycor < 0 ] [set activation ((random 100 ) / 100 ) set pcolor scale-color blue activation 0 2] make-windows foreach cat1 [ set activ-c1 lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-c1] ifelse (sensors > 1 ) [ foreach cat2 [ set activ-c2 lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-c2] ] [ foreach cat2 [set activ-c2 lput 1.6 activ-c2 ask patch item 0 ?1 item 1 ?1 [set weight-access false]] ] ifelse (sensors > 2 ) [foreach cat3 [ set activ-c3 lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-c3] ] [ foreach cat3 [set activ-c3 lput 1.6 activ-c3 ask patch item 0 ?1 item 1 ?1 [set weight-access false]] ] ifelse (sensors > 3 ) [foreach cat4 [ set activ-c4 lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-c4] ] [ foreach cat4 [ set activ-c4 lput 1.6 activ-c4 ask patch item 0 ?1 item 1 ?1 [set weight-access false]] ] ifelse (sensors > 4 ) [foreach cat5 [ set activ-c5 lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-c5] ] [ foreach cat5 [ set activ-c5 lput 1.6 activ-c5 ask patch item 0 ?1 item 1 ?1 [set weight-access false]] ] update-patch-activation-levels ask patches with [weight-access and pycor < 0] [ set pcolor scale-color blue activation 0 2 ] if (inputs < 2 ) [ foreach window2 [ ask patch item 0 ?1 item 1 ?1 [set weight-access false] ] ] if (inputs < 3) [ foreach window3 [ ask patch item 0 ?1 item 1 ?1 [set weight-access false] ] ] if (inputs < 4 ) [ foreach window4 [ ask patch item 0 ?1 item 1 ?1 [set weight-access false] ] ] if (inputs < 5 ) [ foreach window5 [ ask patch item 0 ?1 item 1 ?1 [set weight-access false] ] ] ask patches [ if (not weight-access ) [set pcolor grey] ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: DRAW & ERASE :::::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to draw if (not select-current-input-with-mouse-click ) [ if mouse-down? [ ask patch round mouse-xcor round mouse-ycor [ if (weight-access) [set pcolor blue set activation 1] ] ] ] end to erase if mouse-down? [ ask patch round mouse-xcor round mouse-ycor [ if (weight-access) [set pcolor black set activation 0] ] ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: Match Categories ::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to match-sensors-to-inputs locals [random-window not-selected?] ; 1. pick window ifelse select-current-input-with-mouse-click [ set not-selected? true while [ not-selected? ] [ if ( mouse-down? and mouse-ycor > 0 ) [ set random-window ceiling ( ( mouse-xcor + screen-edge-x ) / box-width ) set not-selected? false ] if (not select-current-input-with-mouse-click ) [ set not-selected? false ] ] ] [ set random-window random inputs + 1 ] ; 2. rank cats to see who is closest to chosen window if (random-window = 1) [ rank-cats window1 ] if (random-window = 2) [ rank-cats window2 ] if (random-window = 3) [ rank-cats window3] if (random-window = 4) [ rank-cats window4] if (random-window = 5) [ rank-cats window5] ; 3. adjust closest activation-values if ( d1 < d2 and d1 < d3 and d1 < d4 and d1 < d5 ) [ set activ-c1 fast-rate activ-c1 set ch1 1 ] if ( d2 < d1 and d2 < d3 and d2 < d4 and d2 < d5 ) [ set activ-c2 fast-rate activ-c2 set ch2 1 ] if ( d3 < d2 and d3 < d1 and d3 < d4 and d3 < d5 ) [ set activ-c3 fast-rate activ-c3 set ch3 1 ] if ( d4 < d2 and d4 < d3 and d4 < d1 and d4 < d5 ) [ set activ-c4 fast-rate activ-c4 set ch4 1 ] if ( d5 < d2 and d5 < d3 and d5 < d4 and d5 < d1 ) [ set activ-c5 fast-rate activ-c5 set ch5 1 ] ; 4. adjust other activation values ifelse (ch1 = 0 ) [set activ-c1 slow-rate activ-c1 ] [set ch1 0 ] if (sensors > 1 ) [ifelse (ch2 = 0 ) [set activ-c2 slow-rate activ-c2 ] [set ch2 0 ]] if (sensors > 2 ) [ifelse (ch3 = 0 ) [set activ-c3 slow-rate activ-c3 ] [set ch3 0 ]] if (sensors > 3 ) [ifelse (ch4 = 0 ) [set activ-c4 slow-rate activ-c4 ] [set ch4 0 ]] if (sensors > 4 ) [ifelse (ch5 = 0 ) [set activ-c5 slow-rate activ-c5 ] [set ch5 0 ]] ; 4.b reset sensors if asked if (reset-sensors-during-match-process) [ set activ-c1 randomizer activ-c1 if (sensors > 1 ) [set activ-c2 randomizer activ-c2 ] if (sensors > 2 ) [set activ-c3 randomizer activ-c3 ] if (sensors > 3 ) [set activ-c4 randomizer activ-c4 ] if (sensors > 4 ) [set activ-c5 randomizer activ-c5 ] set reset-sensors-during-match-process false ] ; 5. recolor update-patch-activation-levels ask patches with [weight-access and pycor < 0] [ set pcolor scale-color blue activation 0 2 ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: RANDOMIZER : RESET SENSORS ::::::::: ;::::::::: ::::::::::::::::::::::::::::::::::::::::: to-report randomizer [cat-ract ] let update ( map [ ?1 * ?2 * 0 + ((random 100 ) / 100 ) ] activ-w cat-ract ) report update end to reset-sensors ;set reset-sensors-during-match-process true set activ-c1 randomizer activ-c1 if (sensors > 1 ) [set activ-c2 randomizer activ-c2 ] if (sensors > 2 ) [set activ-c3 randomizer activ-c3 ] if (sensors > 3 ) [set activ-c4 randomizer activ-c4 ] if (sensors > 4 ) [set activ-c5 randomizer activ-c5 ] set reset-sensors-during-match-process false ask patches with [ weight-access and pycor < 0 ] [ set activation ((random 100 ) / 100 ) set pcolor scale-color blue activation 0 2 ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: FAST SLOW CHANGES ::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to-report fast-rate [ cat-fact] let update ( map [ (?1 - ?2) * (adaptation-rate-for-sensor-most-similar-to-input / 100 ) + ?2 ] activ-w cat-fact ) ;show "fast-rate" report update end to-report slow-rate [cat-sact] let supdate ( map [ (?1 - ?2) * (adaptation-rate-for-all-other-sensors / 100 ) + ?2 ] activ-w cat-sact ) ;show "slow-rate" report supdate end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: RANK CATS ::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to rank-cats [windy] ; this receives the array for all coordinates in the randomly chosen window set activ-w [ ] foreach windy [ ask patch item 0 ?1 item 1 ?1 [ set pcolor white * activation ] set activ-w lput (value-from patch item 0 ?1 item 1 ?1 [activation]) activ-w ] ; see which in array are active wait 0.03 foreach windy [ ask patch item 0 ?1 item 1 ?1 [ set pcolor scale-color blue activation 0 2 ] ] set d1 mean ( map [ abs (?1 - ?2) ] activ-w activ-c1 ) ; check to see which activ-c window is closest to randomly chosen window, d is distance if (sensors > 1 ) [set d2 mean ( map [ abs (?1 - ?2) ] activ-w activ-c2 ) ] if (sensors > 2 ) [set d3 mean ( map [ abs (?1 - ?2) ] activ-w activ-c3 ) ] if (sensors > 3 ) [set d4 mean ( map [ abs (?1 - ?2) ] activ-w activ-c4 ) ] if (sensors > 4 ) [set d5 mean ( map [ abs (?1 - ?2) ] activ-w activ-c5 ) ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: COPY WINDOW ACTIVATION LEVELS ;:::::::::::::::::::::::::::::::::::::::::::::::::: to copy-window-prompt locals [startitem enditem wd1 wd2] set wd1 [ ] set startitem read-from-string user-input "Copy plot from which window [input number only ]?" set enditem read-from-string user-input "Copy plot to which window [input number only ]?" if startitem = 1 [set wd1 window1 ] if ( columns > 1 and startitem = 2) [set wd1 window2 ] if ( columns > 2 and startitem = 3) [set wd1 window3 ] if ( columns > 3 and startitem = 4) [set wd1 window4 ] if (enditem = 1 ) [copy wd1 window1 ] if (columns > 1 and enditem = 2 ) [copy wd1 window2 ] if (columns > 2 and enditem = 3 ) [copy wd1 window3 ] if (columns > 3 and enditem = 4 ) [copy wd1 window4 ] end to copy [ wind1 wind2 ] locals [active-copy i] set i 0 set active-copy [ ] foreach wind1 [ set active-copy lput (value-from patch item 0 ?1 item 1 ?1 [activation]) active-copy] ; see which in array are active ;show active-copy foreach wind2 [ ask patch item 0 ?1 item 1 ?1 [ set activation item i active-copy if (weight-access) [set pcolor scale-color blue activation 0 2 ] ] set i i + 1 ] ask patches with [weight-access and pycor < 0] [ set pcolor scale-color blue activation 0 2 ] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: UPDATE PATCH ACTIVATION LEVELS ;:::::::::::::::::::::::::::::::::::::::::::::::::: to update-patch-activation-levels locals [ i ] set i 0 foreach cat1 [ ask patch item 0 ?1 item 1 ?1 [set activation item i activ-c1] set i i + 1] set i 0 foreach cat2 [ ask patch item 0 ?1 item 1 ?1 [set activation item i activ-c2] set i i + 1] set i 0 foreach cat3 [ ask patch item 0 ?1 item 1 ?1 [set activation item i activ-c3] set i i + 1] set i 0 foreach cat4 [ ask patch item 0 ?1 item 1 ?1 [set activation item i activ-c4] set i i + 1] set i 0 foreach cat5 [ ask patch item 0 ?1 item 1 ?1 [set activation item i activ-c5] set i i + 1] end ;:::::::::::::::::::::::::::::::::::::::::::::::::: ;::::::::::::::::::: MAKE WINDOWS ::::::::: ;:::::::::::::::::::::::::::::::::::::::::::::::::: to make-windows ; WINDOW 1 ;let xv ( - screen-edge-x ) let xv ( - screen-edge-x ) let yv 1 let xy-coord [ ] repeat screen-edge-y [ repeat box-width [ set xy-coord lput xv xy-coord ;this could be wrong set xy-coord lput yv xy-coord set window1 lput xy-coord window1 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach window1 [ ask patch item 0 ?1 item 1 ?1 [set pcolor violet ] ] ; WINDOW 2 if columns > 1 [ set xv ( - screen-edge-x ) set yv 1 set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width ) + 1 ) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width ) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set window2 lput xy-coord window2 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach window2 [ ask patch item 0 ?1 item 1 ?1 [set pcolor green ] ] ] ; WINDOW 3 if columns > 2 [ set xv ( - screen-edge-x ) set yv 1 set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 2 ) + 1 ) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 2 ) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set window3 lput xy-coord window3 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach window3 [ ask patch item 0 ?1 item 1 ?1 [set pcolor yellow ] ] ] ; WINDOW 4 if columns > 3 [ set xv ( - screen-edge-x ) set yv 1 set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 3) + 1 ) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 3) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set window4 lput xy-coord window4 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach window4 [ ask patch item 0 ?1 item 1 ?1 [set pcolor green ] ] ] ; WINDOW 5 if columns > 4 [ set xv ( - screen-edge-x ) set yv 1 set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 4 ) + 1 ) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 4 ) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set window5 lput xy-coord window5 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach window5 [ ask patch item 0 ?1 item 1 ?1 [set pcolor orange ] ] ] ; CAT 1 set xv ( - screen-edge-x ) set yv (- screen-edge-y ) set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ set xy-coord lput (xv) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set cat1 lput xy-coord cat1 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach cat1 [ ask patch item 0 ?1 item 1 ?1 [set pcolor red ] ] ; CAT 2 if columns > 1 [ set xv ( - screen-edge-x ) set yv (- screen-edge-y ) set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width) + 1) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set cat2 lput xy-coord cat2 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach cat2 [ ask patch item 0 ?1 item 1 ?1 [set pcolor blue ] ] ] ; CAT 3 if columns > 2 [ set xv ( - screen-edge-x ) set yv (- screen-edge-y ) set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 2) + 1) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 2) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set cat3 lput xy-coord cat3 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach cat3 [ ask patch item 0 ?1 item 1 ?1 [set pcolor red ] ] ] ; CAT 4 if columns > 3 [ set xv ( - screen-edge-x ) set yv (- screen-edge-y ) set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 3) + 1) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 3) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set cat4 lput xy-coord cat4 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach cat4 [ ask patch item 0 ?1 item 1 ?1 [set pcolor violet ] ] ] ; CAT 5 if columns > 4 [ set xv ( - screen-edge-x ) set yv (- screen-edge-y ) set xy-coord [ ] repeat screen-edge-y [ repeat box-width [ ;set xy-coord lput (xv + floor( box-width * 4) + 1) xy-coord ;this could be wrong set xy-coord lput (xv + floor( box-width * 4) ) xy-coord ;this could be wrong set xy-coord lput yv xy-coord set cat5 lput xy-coord cat5 set xv xv + 1 set xy-coord [ ] ] set xv (- screen-edge-x ) set yv yv + 1 ] ;foreach cat5 [ ask patch item 0 ?1 item 1 ?1 [set pcolor grey ] ] ] end to quiz locals [ option datebit q1 q2 q3 q4 q5 q6 q7 ssn] set answer-list [] set condition "sensor" ;1 set q1 "To make the sensors best represent the natural groups in a set of inputs, you should: \n\n\n" set q1 word q1 "a. Have the sensors adapt as quickly as possible.\n\n" set q1 word q1 "b. Make the sensor that is most similar to a selected input \nadapt more quickly than all the other sensors.\n\n" set q1 word q1 "c. Make the sensor that is most similar to a selected input \nadapt more slowly than all the other sensors.\n\n" set q1 word q1 "d. Early on, make the most similar sensor adapt more quickly \nthan the others, but later on, make the most similar sensor adapt more slowly.\n\n" set answer-list lput (user-choice q1 [ "a" "b" "c" "d" ] ) answer-list ;2 set q2 "Why arenŐt specialized sensors formed if only the sensor most similar to a selected input adapts? \n\n\n" set q2 word q2 "a. If only the most similar sensor adapts, then this sensor \nwill become responsible for many inputs, and the other sensors may not match any of the input.\n\n" set q2 word q2 "b. If only the most similar sensor adapts, then its \nadaptability may eventually become exhausted and it may stop adapting at all.\n\n" set q2 word q2 "c. The most similar sensor shouldnŐt adapt much because it \nis already responsible for an input. The other sensors will slowly realize that this input is matched up and try to become responsible for other inputs.\n\n" set q2 word q2 "d. If only one sensor adapts, then this sensor must also \nkeep track of which inputs it has already adapted towards which is a difficult task.\n\n" set answer-list lput (user-choice q2 [ "a" "b" "c" "d" ] ) answer-list ;3 set q3 "Why arenŐt specialized sensors formed if all of the sensors (the most similar and the others) all adapt equally quickly? \n\n\n" set q3 word q3 "a. The most similar sensor will quickly become responsible \nfor inputs but the other sensors will have to quickly find other inputs that need matching.\n\n" set q3 word q3 "b. If other sensors adapt as quickly as the most similar \nsensor, then when a new input is selected, then all sensors will adapt to it. The sensors will all try to match the same input. \n\n" set q3 word q3 "c. If all of the sensors adapt with the same speed, then \nthey will all get an equal opportunity to look like the selected input but there is a limited number of inputs available for matching.\n\n" set q3 word q3 "d. If the most similar sensor adapts as quickly as the other \nsensors, then it will match the input first, and will prevent the other sensors from matching it.\n\n" set answer-list lput (user-choice q3 [ "a" "b" "c" "d" ] ) answer-list ;4 set q4 "To create sensors that can accommodate the whole range of inputs naturally, it is necessary to have the sensors become specialized for different inputs. Which action most directly allows for this specialization? \n\n\n" set q4 word q4 "a. Create just a few sensors. That way, no matter the rate \nof adaptation each sensor can be very dissimilar from the other sensors.\n\n" set q4 word q4 "b. Create more sensors than there are inputs. That way, no \nmatter the rate of adaptation each sensor can become very specialized.\n\n" set q4 word q4 "c. Make the sensor that is most similar to the selected input \nadapt quickly to that input, but the other sensors should only adapt slowly to it.\n\n" set q4 word q4 "d. Make the sensor that is most similar to the selected input \nadapt slowly to the input, but the other sensors should adapt quickly to it.\n\n" set answer-list lput (user-choice q4 [ "a" "b" "c" "d" ] ) answer-list ;5 set q5 "If there are four inputs and two sensors, the sensors will become responsible for inputs that are similar to each other. The similar parts of similar inputs will be learned by a sensor first. How does this occur? \n\n\n" set q5 word q5 "a. Sensors adapt most toward similar inputs because shared \nparts provide links between inputs across different sensors.\n\n" set q5 word q5 "b. Similar inputs get matched quickly by a sensor because \ntheir shared parts cause the rate of adaptation to be faster for sensors that are most similar to a selected input.\n\n" set q5 word q5 "c. Parts shared by similar inputs are matched by a sensor \nearly on because every time one of the similar inputs gets selected, the sensor gets an opportunity to adapt to the shared parts. \n\n" set q5 word q5 "d. Sensors adapt most to parts shared by similar inputs because \nthese parts are at the very essence of the sensor, defining what it means to be sensed.\n\n" set answer-list lput (user-choice q5 [ "a" "b" "c" "d" ] ) answer-list ;6 set q6 "There are two inputs and only one sensor, what usually happens? \n\n\n" set q6 word q6 "a. The sensor will alternate between matching the two inputs, \nbut only if it adapts very slowly.\n\n" set q6 word q6 "b. The sensor will be a blend of the two inputs, highlighting \nparts shared by the inputs.\n\n" set q6 word q6 "c. The sensor will become specialized for one of the inputs \nonly.\n\n" set q6 word q6 "d. The sensor will not become adapted to either input, unless \nit is highly similar to them in the first place.\n\n" set answer-list lput (user-choice q6 [ "a" "b" "c" "d" ] ) answer-list ;7 set q7 "Imagine there are two inputs and two sensors. However, one sensor is similar to both inputs and the other sensor is very different. If both sensors adapt, but the most similar sensor adapts more quickly, what will happen over time? \n\n\n" set q7 word q7 "a. The sensor that is already similar to the inputs will \ncontinue to cover both inputs, and the other sensor will never match any of the inputs.\n\n" set q7 word q7 "b. From the start, each of the sensors will become responsible \nfor one of the inputs (each sensor matches a different input), and will continue to match it.\n\n" set q7 word q7 "c. The most similar sensor will be responsible for both inputs \nat first, but as the other sensor adapts and becomes more similar, the two sensors will both become a blend of the two inputs.\n\n" set q7 word q7 "d. The most similar sensor will be responsible for both inputs \nat first, but as the other sensor adapts and becomes more similar, they will each become responsible for one of the inputs.\n\n" set answer-list lput (user-choice q7 [ "a" "b" "c" "d" ] ) answer-list set ssn user-input "Type in the last 4 digits of your social security number" set datebit date-and-time set datebit substring datebit 16 23 set datebit word condition datebit set datebit word datebit ssn set save-file datebit save-prompt save-data end to save-prompt locals [option new-file] ifelse is-string? save-file [ set option "OK" ] [ set option "NO" ] if option = "OK" [ if save-file = "" [ set option "NO" ] ] if option = "NO" [ set new-file user-choose-new-file ifelse is-string? new-file [ set save-file new-file set new-file "nofilename" set save-file word new-file "" ] [ set option "CANCEL" ] ] if option = "CANCEL" [ user-message "Change save file cancelled" ] end to save-data ifelse is-string? save-file [ write-data save-file ] [ ] end to write-data [file?] if file-exists? file? [ file-delete file? ] file-open file? file-write condition file-write answer-list file-close end @#$#@#$#@ GRAPHICS-WINDOW 44 273 786 676 30 15 12.0 1 10 1 1 1 0 1 1 1 CC-WINDOW 5 690 795 785 Command Center 0 BUTTON 55 38 167 71 setup inputs Setup-Inputs NIL 1 T OBSERVER T NIL SLIDER 54 76 355 109 inputs inputs 1 5 4 1 1 NIL BUTTON 54 153 163 186 NIL draw T 1 T OBSERVER T NIL BUTTON 53 190 163 224 NIL erase T 1 T OBSERVER T NIL BUTTON 415 33 785 100 match sensors to inputs match-sensors-to-inputs T 1 T OBSERVER T NIL SLIDER 413 143 786 176 adaptation-rate-for-sensor-most-similar-to-input adaptation-rate-for-sensor-most-similar-to-input 0 25 14.0 0.1 1 NIL SLIDER 413 182 786 215 adaptation-rate-for-all-other-sensors adaptation-rate-for-all-other-sensors 0 25 14.0 0.1 1 NIL SLIDER 53 113 356 146 sensors sensors 1 5 2 1 1 NIL BUTTON 53 230 164 264 copy window copy-window-prompt NIL 1 T OBSERVER T NIL SWITCH 414 106 786 139 select-current-input-with-mouse-click select-current-input-with-mouse-click 1 1 -1000 BUTTON 234 39 355 72 reset sensors Reset-Sensors NIL 1 T OBSERVER T NIL BUTTON 594 225 784 258 I'm READY to take the quiz!! quiz NIL 1 T OBSERVER T NIL @#$#@#$#@ WHAT IS IT? ----------- This section could give a general understanding of what the model is trying to show or explain. HOW IT WORKS ------------ This section could explain what rules the agents use to create the overall behavior of the model. HOW TO USE IT ------------- This section could explain how to use the model, including a description of each of the items in the interface tab. THINGS TO NOTICE ---------------- This section could give some ideas of things for the user to notice while running the model. THINGS TO TRY ------------- This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model. EXTENDING THE MODEL ------------------- This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc. 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. @#$#@#$#@ 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 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 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 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 3.0.2 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@