;; ;; Copyright 2011 Nathan Adams, Erik Akrop, Ira Benoy, and Robert Myers. ;; All rights reserved. ;; ;; Georgia Institute of Technology ;; Professional Masters of Applied Systems Engineering ;; ASE 6003 - Spring 2011 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Global constants ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; globals [ current-hour current-minute current-second default-number-of-ticks-to-wait end-time-of-day-seconds feet-per-patch load-unload-time-avg-ticks load-unload-time-min-ticks max-number-passengers-per-trolley minutes-per-hour number-of-stations seconds-per-minute seconds-per-tick special-partial-queue station-name-marta station-name-moes station-name-5th-st-ribs station-name-ferst-cherry station-name-klaus-east station-name-crc station-name-challenge-course station-name-marc station-name-ferst-state station-name-physics-bld station-name-nanotech-bld station-name-cherry-emerson station-name-chandler-stadium station-name-pkt-fraternity station-name-psk-fraternity station-name-ka-fraternity station-name-college-mgmt station-name-academy-med station-name-publix station-queue-max-marta station-queue-max-moes station-queue-max-5th-st-ribs station-queue-max-ferst-cherry station-queue-max-klaus-east station-queue-max-crc station-queue-max-challenge-course station-queue-max-marc station-queue-max-ferst-state station-queue-max-physics-bld station-queue-max-nanotech-bld station-queue-max-cherry-emerson station-queue-max-chandler-stadium station-queue-max-pkt-fraternity station-queue-max-psk-fraternity station-queue-max-ka-fraternity station-queue-max-college-mgmt station-queue-max-academy-med station-queue-max-publix station-queue-status-marta station-queue-status-moes station-queue-status-5th-st-ribs station-queue-status-ferst-cherry station-queue-status-klaus-east station-queue-status-crc station-queue-status-challenge-course station-queue-status-marc station-queue-status-ferst-state station-queue-status-physics-bld station-queue-status-nanotech-bld station-queue-status-cherry-emerson station-queue-status-chandler-stadium station-queue-status-pkt-fraternity station-queue-status-psk-fraternity station-queue-status-ka-fraternity station-queue-status-college-mgmt station-queue-status-academy-med station-queue-status-publix station-wait-minutes-avg-marta station-wait-minutes-avg-moes station-wait-minutes-avg-5th-st-ribs station-wait-minutes-avg-ferst-cherry station-wait-minutes-avg-klaus-east station-wait-minutes-avg-crc station-wait-minutes-avg-challenge-course station-wait-minutes-avg-marc station-wait-minutes-avg-ferst-state station-wait-minutes-avg-physics-bld station-wait-minutes-avg-nanotech-bld station-wait-minutes-avg-cherry-emerson station-wait-minutes-avg-chandler-stadium station-wait-minutes-avg-pkt-fraternity station-wait-minutes-avg-psk-fraternity station-wait-minutes-avg-ka-fraternity station-wait-minutes-avg-college-mgmt station-wait-minutes-avg-academy-med station-wait-minutes-avg-publix station-wait-minutes-max-marta station-wait-minutes-max-moes station-wait-minutes-max-5th-st-ribs station-wait-minutes-max-ferst-cherry station-wait-minutes-max-klaus-east station-wait-minutes-max-crc station-wait-minutes-max-challenge-course station-wait-minutes-max-marc station-wait-minutes-max-ferst-state station-wait-minutes-max-physics-bld station-wait-minutes-max-nanotech-bld station-wait-minutes-max-cherry-emerson station-wait-minutes-max-chandler-stadium station-wait-minutes-max-pkt-fraternity station-wait-minutes-max-psk-fraternity station-wait-minutes-max-ka-fraternity station-wait-minutes-max-college-mgmt station-wait-minutes-max-academy-med station-wait-minutes-max-publix time-of-day-offset-seconds total-passengers total-passengers-walking total-passengers-walking-now velocity-max-patches-per-tick velocity-multiplier wait-time-average-minutes wait-time-total-seconds wait-time-total-passengers ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Define breeds of turtles (a.k.a. classes of agents) ;; ;; Note 1: All such definitions must occur before any procedures are defined. ;; ;; Note 2: The order in which breeds are defined determine their display order ;; on screen with latter breeds being displayed on top of formerly defined ;; breeds. Since we want passengers to 'ride' trolleys we first define the ;; passenger breed then the trolley breed, thus obscuring passengers when they ;; 'board' a trolley, etc. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; A street segment between two nodes along the route. directed-link-breed [streetsegments streetsegment] ;; A place for a passenger to occupy while riding the trolley. directed-link-breed [trolleyseats trolleyseat] ;; A node along the route. breed [routepts routept] ;; A station spawns passengers. Note that 'stop' is a NetLogo keyword, so ;; we use 'station' instead of 'stop' or 'trolley-stop'. breed [stations station] stations-own [ expected-arrivals name queue partial-queue last-load-count last-unload-count max-queue max-wait-time-seconds total-passengers-queued total-wait-secs ] ;; A passenger spawns at a trolley stop, boards a trolley, and disembarks after ;; some number of stops. At their discretion a passenger may give up waiting for ;; the trolley and decide to walk. breed [passengers passenger] passengers-own [ number-of-ticks-to-wait destination start-location state ] ;; A trolley moves along a route, stops at stops, loads passengers, and unloads ;; passengers. breed [trolleys trolley] trolleys-own [ load-unload-tick-counter lead-trolley number-passengers state to-routept velocity velocity-mph ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Function definitions ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Setup functions ;; to setup clear-all ; seed PRNG random-seed new-seed setup-time setup-patches setup-routepts setup-stations setup-trolleys set-traffic-density set-passenger-disposition set total-passengers 0 set total-passengers-walking 0 set total-passengers-walking-now 0 set wait-time-average-minutes 0 set wait-time-total-seconds 0 set wait-time-total-passengers 0 setup-file end to setup-patches ;; The trolley route is roughly 4000 feet East to West. Here we round up to ;; 5000 feet (to add some buffer on either side of the route) and divide by ;; twice the maximum patch x coordinate value to determine the number of ;; feet per patch. ;; See: http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&ll=33.781707,-84.387816&spn=0.00247,0.006539&z=18&msid=217200371569716293873.00049c2f1b6f62466f432 set feet-per-patch (5000.0 / (max-pxcor * 2.0)) ask patches [ set pcolor black ] end ;; See: http://www.nextbus.com/predictor/publicMap.shtml?a=georgia-tech&r=trolley to setup-routepts ;; There are always exactly 31 route nodes on our map set-default-shape routepts "dot" create-routepts 31 [ set color gray if who = 0 [ setxy (-1710 / feet-per-patch) (-1210 / feet-per-patch) ] ;; CRC if who = 1 [ setxy (-1710 / feet-per-patch) (-1160 / feet-per-patch) ] if who = 2 [ setxy (-1800 / feet-per-patch) (-1160 / feet-per-patch) ] if who = 3 [ setxy (-1800 / feet-per-patch) ( 310 / feet-per-patch) ] if who = 4 [ setxy (-1540 / feet-per-patch) ( 310 / feet-per-patch) ] ;; MaRC if who = 5 [ setxy (-1065 / feet-per-patch) ( 310 / feet-per-patch) ] ;; Physics if who = 6 [ setxy ( -560 / feet-per-patch) ( 310 / feet-per-patch) ] ;; Cherry Emerson if who = 7 [ setxy ( -230 / feet-per-patch) ( 310 / feet-per-patch) ] if who = 8 [ setxy ( -230 / feet-per-patch) ( -230 / feet-per-patch) ] ;; Klaus (East bound) if who = 9 [ setxy ( 190 / feet-per-patch) ( -230 / feet-per-patch) ] ;; Phi Kappa Theta if who = 10 [ setxy ( 710 / feet-per-patch) ( -230 / feet-per-patch) ] ;; Kappa Alpha if who = 11 [ setxy ( 1240 / feet-per-patch) ( -230 / feet-per-patch) ] ;; 5th St Ribs & Blues if who = 12 [ setxy ( 1770 / feet-per-patch) ( -230 / feet-per-patch) ] ;; College of Mgmt if who = 13 [ setxy ( 1770 / feet-per-patch) ( 800 / feet-per-patch) ] ;; Academy of Medicine if who = 14 [ setxy ( 1770 / feet-per-patch) ( 1480 / feet-per-patch) ] if who = 15 [ setxy ( 2270 / feet-per-patch) ( 1480 / feet-per-patch) ] if who = 16 [ setxy ( 2270 / feet-per-patch) ( 1350 / feet-per-patch) ] if who = 17 [ setxy ( 2090 / feet-per-patch) ( 1350 / feet-per-patch) ] ;; MARTA if who = 18 [ setxy ( 1560 / feet-per-patch) ( 1350 / feet-per-patch) ] ;; Publix if who = 19 [ setxy ( 1560 / feet-per-patch) ( -210 / feet-per-patch) ] if who = 20 [ setxy ( 1240 / feet-per-patch) ( -210 / feet-per-patch) ] ;; Moe's if who = 21 [ setxy ( 710 / feet-per-patch) ( -210 / feet-per-patch) ] ;; Phi Sigma Kappa if who = 22 [ setxy ( 180 / feet-per-patch) ( -210 / feet-per-patch) ] ;; Chandler Stadium if who = 23 [ setxy ( -210 / feet-per-patch) ( -210 / feet-per-patch) ] if who = 24 [ setxy ( -210 / feet-per-patch) ( 20 / feet-per-patch) ] ;; Ferst & Cherry if who = 25 [ setxy ( -210 / feet-per-patch) ( 330 / feet-per-patch) ] if who = 26 [ setxy ( -750 / feet-per-patch) ( 330 / feet-per-patch) ] ;; Nanotech if who = 27 [ setxy (-1220 / feet-per-patch) ( 330 / feet-per-patch) ] ;; Ferst & State if who = 28 [ setxy (-1820 / feet-per-patch) ( 330 / feet-per-patch) ] ;; Challenge Course if who = 29 [ setxy (-1820 / feet-per-patch) (-1270 / feet-per-patch) ] if who = 30 [ setxy (-1710 / feet-per-patch) (-1270 / feet-per-patch) ] if who = 0 [ create-streetsegment-to routept 1 ] if who = 1 [ create-streetsegment-to routept 2 ] if who = 2 [ create-streetsegment-to routept 3 ] if who = 3 [ create-streetsegment-to routept 4 ] if who = 4 [ create-streetsegment-to routept 5 ] if who = 5 [ create-streetsegment-to routept 6 ] if who = 6 [ create-streetsegment-to routept 7 ] if who = 7 [ create-streetsegment-to routept 8 ] if who = 8 [ create-streetsegment-to routept 9 ] if who = 9 [ create-streetsegment-to routept 10 ] if who = 10 [ create-streetsegment-to routept 11 ] if who = 11 [ create-streetsegment-to routept 12 ] if who = 12 [ create-streetsegment-to routept 13 ] if who = 13 [ create-streetsegment-to routept 14 ] if who = 14 [ create-streetsegment-to routept 15 ] if who = 15 [ create-streetsegment-to routept 16 ] if who = 16 [ create-streetsegment-to routept 17 ] if who = 17 [ create-streetsegment-to routept 18 ] if who = 18 [ create-streetsegment-to routept 19 ] if who = 19 [ create-streetsegment-to routept 20 ] if who = 20 [ create-streetsegment-to routept 21 ] if who = 21 [ create-streetsegment-to routept 22 ] if who = 22 [ create-streetsegment-to routept 23 ] if who = 23 [ create-streetsegment-to routept 24 ] if who = 24 [ create-streetsegment-to routept 25 ] if who = 25 [ create-streetsegment-to routept 26 ] if who = 26 [ create-streetsegment-to routept 27 ] if who = 27 [ create-streetsegment-to routept 28 ] if who = 28 [ create-streetsegment-to routept 29 ] if who = 29 [ create-streetsegment-to routept 30 ] if who = 30 [ create-streetsegment-to routept 0 ] ] end ;; This must be call immediately after creating all routepts such that the who ;; IDs in this procedure immediately follow those in the routept setup procedure to setup-stations set-default-shape stations "square" ;; Always show the MARTA, 2 x Tech Sq, 2 x Klaus, and CRC stations set number-of-stations 6 ;; Determine if we need to position a given station on the map. We need a ;; separate variable from the control switch so that we can toggle it once ;; the given station is moved to the correct location. let place-challenge-course false let place-mfg-research-bld false let place-ferst-state false let place-physics-bld false let place-nanotech-bld false let place-cherry-emerson false let place-chandler-stadium false let place-pkt-fraternity false let place-psk-fraternity false let place-ka-fraternity false let place-college-mgmt false let place-academy-med false let place-publix false if station-challenge-course [ set number-of-stations (number-of-stations + 1) set place-challenge-course true ] if station-mfg-research-bld [ set number-of-stations (number-of-stations + 1) set place-mfg-research-bld true ] if station-ferst-state [ set number-of-stations (number-of-stations + 1) set place-ferst-state true ] if station-physics-bld [ set number-of-stations (number-of-stations + 1) set place-physics-bld true ] if station-nanotech-bld [ set number-of-stations (number-of-stations + 1) set place-nanotech-bld true ] if station-cherry-emerson [ set number-of-stations (number-of-stations + 1) set place-cherry-emerson true ] if station-chandler-stadium [ set number-of-stations (number-of-stations + 1) set place-chandler-stadium true ] if station-pkt-fraternity [ set number-of-stations (number-of-stations + 1) set place-pkt-fraternity true ] if station-psk-fraternity [ set number-of-stations (number-of-stations + 1) set place-psk-fraternity true ] if station-ka-fraternity [ set number-of-stations (number-of-stations + 1) set place-ka-fraternity true ] if station-college-mgmt [ set number-of-stations (number-of-stations + 1) set place-college-mgmt true ] if station-academy-med [ set number-of-stations (number-of-stations + 1) set place-academy-med true ] if station-publix [ set number-of-stations (number-of-stations + 1) set place-publix true ] set station-name-marta "MARTA" set station-name-moes "Moe's" set station-name-5th-st-ribs "5th St Ribs & Blues" set station-name-ferst-cherry "Ferst & Cherry" set station-name-klaus-east "Klaus (East bound)" set station-name-crc "Campus Recreation Center" set station-name-challenge-course "Challenge Course" set station-name-marc "Manufacturing Research Center" set station-name-ferst-state "Ferst & State" set station-name-physics-bld "Physics" set station-name-nanotech-bld "Nanotech" set station-name-cherry-emerson "Cherry Emerson" set station-name-chandler-stadium "Chandler Stadium" set station-name-pkt-fraternity "Phi Kappa Theta" set station-name-psk-fraternity "Phi Sigma Kappa" set station-name-ka-fraternity "Kappa Alpha" set station-name-college-mgmt "College of Management" set station-name-academy-med "Academy of Medicine" set station-name-publix "Publix" create-stations number-of-stations [ set color blue set queue 0 set partial-queue 0.0 set last-load-count 0 set last-unload-count 0 set max-queue 0 set max-wait-time-seconds 0 set total-passengers 0 set total-wait-secs 0 if who = 31 [ move-to routept 17 set name station-name-marta ] if who = 32 [ move-to routept 20 set name station-name-moes ] if who = 33 [ move-to routept 11 set name station-name-5th-st-ribs ] if who = 34 [ move-to routept 24 set name station-name-ferst-cherry ] if who = 35 [ move-to routept 8 set name station-name-klaus-east ] if who = 36 [ move-to routept 0 set name station-name-crc ] ] ;; Loop through the number of optional stations that were set true and place ;; them in the correct location. let iterator 36 repeat (number-of-stations - 6) [ set iterator (iterator + 1) ifelse place-challenge-course [ set place-challenge-course false ask station iterator [ move-to routept 28 set name station-name-challenge-course ] ] [ ifelse place-mfg-research-bld [ set place-mfg-research-bld false ask station iterator [ move-to routept 4 set name station-name-marc ] ] [ ifelse place-ferst-state [ set place-ferst-state false ask station iterator [ move-to routept 27 set name station-name-ferst-state ] ] [ ifelse place-physics-bld [ set place-physics-bld false ask station iterator [ move-to routept 5 set name station-name-physics-bld ] ] [ ifelse place-nanotech-bld [ set place-nanotech-bld false ask station iterator [ move-to routept 26 set name station-name-nanotech-bld ] ] [ ifelse place-cherry-emerson [ set place-cherry-emerson false ask station iterator [ move-to routept 6 set name station-name-cherry-emerson ] ] [ ifelse place-chandler-stadium [ set place-chandler-stadium false ask station iterator [ move-to routept 22 set name station-name-chandler-stadium ] ] [ ifelse place-pkt-fraternity [ set place-pkt-fraternity false ask station iterator [ move-to routept 9 set name station-name-pkt-fraternity ] ] [ ifelse place-psk-fraternity [ set place-psk-fraternity false ask station iterator [ move-to routept 21 set name station-name-psk-fraternity ] ] [ ifelse place-ka-fraternity [ set place-ka-fraternity false ask station iterator [ move-to routept 10 set name station-name-ka-fraternity ] ] [ ifelse place-college-mgmt [ set place-college-mgmt false ask station iterator [ move-to routept 12 set name station-name-college-mgmt ] ] [ ifelse place-academy-med [ set place-academy-med false ask station iterator [ move-to routept 13 set name station-name-academy-med ] ] [ if place-publix [ set place-publix false ask station iterator [ move-to routept 18 set name station-name-publix ] ] ] ] ] ] ] ] ] ] ] ] ] ] ;; phew. ] set special-partial-queue 0.0 set station-wait-minutes-avg-marta 0 set station-wait-minutes-avg-moes 0 set station-wait-minutes-avg-5th-st-ribs 0 set station-wait-minutes-avg-ferst-cherry 0 set station-wait-minutes-avg-klaus-east 0 set station-wait-minutes-avg-crc 0 set station-wait-minutes-avg-challenge-course 0 set station-wait-minutes-avg-marc 0 set station-wait-minutes-avg-ferst-state 0 set station-wait-minutes-avg-physics-bld 0 set station-wait-minutes-avg-nanotech-bld 0 set station-wait-minutes-avg-cherry-emerson 0 set station-wait-minutes-avg-chandler-stadium 0 set station-wait-minutes-avg-pkt-fraternity 0 set station-wait-minutes-avg-psk-fraternity 0 set station-wait-minutes-avg-ka-fraternity 0 set station-wait-minutes-avg-college-mgmt 0 set station-wait-minutes-avg-academy-med 0 set station-wait-minutes-avg-publix 0 set station-wait-minutes-max-marta 0 set station-wait-minutes-max-moes 0 set station-wait-minutes-max-5th-st-ribs 0 set station-wait-minutes-max-ferst-cherry 0 set station-wait-minutes-max-klaus-east 0 set station-wait-minutes-max-crc 0 set station-wait-minutes-max-challenge-course 0 set station-wait-minutes-max-marc 0 set station-wait-minutes-max-ferst-state 0 set station-wait-minutes-max-physics-bld 0 set station-wait-minutes-max-nanotech-bld 0 set station-wait-minutes-max-cherry-emerson 0 set station-wait-minutes-max-chandler-stadium 0 set station-wait-minutes-max-pkt-fraternity 0 set station-wait-minutes-max-psk-fraternity 0 set station-wait-minutes-max-ka-fraternity 0 set station-wait-minutes-max-college-mgmt 0 set station-wait-minutes-max-academy-med 0 set station-wait-minutes-max-publix 0 end to setup-time set seconds-per-tick 1.0 set seconds-per-minute 60 set minutes-per-hour 60 if start-time-of-day = "5:45am" [ set time-of-day-offset-seconds ( ( 5 * minutes-per-hour * seconds-per-minute) + (45 * seconds-per-minute) ) ] if start-time-of-day = "6:00am" [ set time-of-day-offset-seconds ( ( 6 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "6:30am" [ set time-of-day-offset-seconds ( ( 6 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "7:00am" [ set time-of-day-offset-seconds ( ( 7 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "7:30am" [ set time-of-day-offset-seconds ( ( 7 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "8:00am" [ set time-of-day-offset-seconds ( ( 8 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "8:30am" [ set time-of-day-offset-seconds ( ( 8 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "9:00am" [ set time-of-day-offset-seconds ( ( 9 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "9:30am" [ set time-of-day-offset-seconds ( ( 9 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "10:00am" [ set time-of-day-offset-seconds ( (10 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "10:30am" [ set time-of-day-offset-seconds ( (10 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "11:00am" [ set time-of-day-offset-seconds ( (11 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "11:30am" [ set time-of-day-offset-seconds ( (11 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "12:00pm" [ set time-of-day-offset-seconds ( (12 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "12:30pm" [ set time-of-day-offset-seconds ( (12 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "1:00pm" [ set time-of-day-offset-seconds ( (13 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "1:30pm" [ set time-of-day-offset-seconds ( (13 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "2:00pm" [ set time-of-day-offset-seconds ( (14 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "2:30pm" [ set time-of-day-offset-seconds ( (14 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "3:00pm" [ set time-of-day-offset-seconds ( (15 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "3:30pm" [ set time-of-day-offset-seconds ( (15 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "4:00pm" [ set time-of-day-offset-seconds ( (16 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "4:30pm" [ set time-of-day-offset-seconds ( (16 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "5:00pm" [ set time-of-day-offset-seconds ( (17 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "5:30pm" [ set time-of-day-offset-seconds ( (17 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "6:00pm" [ set time-of-day-offset-seconds ( (18 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "6:30pm" [ set time-of-day-offset-seconds ( (18 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "7:00pm" [ set time-of-day-offset-seconds ( (19 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "7:30pm" [ set time-of-day-offset-seconds ( (19 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "8:00pm" [ set time-of-day-offset-seconds ( (20 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "8:30pm" [ set time-of-day-offset-seconds ( (20 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "9:00pm" [ set time-of-day-offset-seconds ( (21 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "9:30pm" [ set time-of-day-offset-seconds ( (21 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if start-time-of-day = "10:00pm" [ set time-of-day-offset-seconds ( (22 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if start-time-of-day = "10:30pm" [ set time-of-day-offset-seconds ( (22 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "6:00am" [ set end-time-of-day-seconds ( ( 6 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "6:30am" [ set end-time-of-day-seconds ( ( 6 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "7:00am" [ set end-time-of-day-seconds ( ( 7 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "7:30am" [ set end-time-of-day-seconds ( ( 7 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "8:00am" [ set end-time-of-day-seconds ( ( 8 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "8:30am" [ set end-time-of-day-seconds ( ( 8 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "9:00am" [ set end-time-of-day-seconds ( ( 9 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "9:30am" [ set end-time-of-day-seconds ( ( 9 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "10:00am" [ set end-time-of-day-seconds ( (10 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "10:30am" [ set end-time-of-day-seconds ( (10 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "11:00am" [ set end-time-of-day-seconds ( (11 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "11:30am" [ set end-time-of-day-seconds ( (11 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "12:00pm" [ set end-time-of-day-seconds ( (12 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "12:30pm" [ set end-time-of-day-seconds ( (12 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "1:00pm" [ set end-time-of-day-seconds ( (13 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "1:30pm" [ set end-time-of-day-seconds ( (13 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "2:00pm" [ set end-time-of-day-seconds ( (14 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "2:30pm" [ set end-time-of-day-seconds ( (14 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "3:00pm" [ set end-time-of-day-seconds ( (15 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "3:30pm" [ set end-time-of-day-seconds ( (15 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "4:00pm" [ set end-time-of-day-seconds ( (16 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "4:30pm" [ set end-time-of-day-seconds ( (16 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "5:00pm" [ set end-time-of-day-seconds ( (17 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "5:30pm" [ set end-time-of-day-seconds ( (17 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "6:00pm" [ set end-time-of-day-seconds ( (18 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "6:30pm" [ set end-time-of-day-seconds ( (18 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "7:00pm" [ set end-time-of-day-seconds ( (19 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "7:30pm" [ set end-time-of-day-seconds ( (19 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "8:00pm" [ set end-time-of-day-seconds ( (20 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "8:30pm" [ set end-time-of-day-seconds ( (20 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "9:00pm" [ set end-time-of-day-seconds ( (21 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "9:30pm" [ set end-time-of-day-seconds ( (21 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "10:00pm" [ set end-time-of-day-seconds ( (22 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] if end-time-of-day = "10:30pm" [ set end-time-of-day-seconds ( (22 * minutes-per-hour * seconds-per-minute) + (30 * seconds-per-minute) ) ] if end-time-of-day = "11:00pm" [ set end-time-of-day-seconds ( (23 * minutes-per-hour * seconds-per-minute) + ( 0 * seconds-per-minute) ) ] update-clock end to setup-trolleys set max-number-passengers-per-trolley 48 ;; 5280 feet = 1 mile, 3600 seconds = 1 hour ;; (mi/hr) * (s/tick) * (ft/mi) * (hr/s) * (patches/ft) = patches/tick set velocity-max-patches-per-tick ( (avg-speed-limit-mph * seconds-per-tick * 5280.0) / (3600.0 * feet-per-patch) ) set load-unload-time-avg-ticks ( 20 / seconds-per-tick ) set load-unload-time-min-ticks ( 10 / seconds-per-tick ) ;; Adapted from the LinkTravel example available from: ;; http://backspaces.net/wiki/NetLogo_Bag_of_Tricks repeat number-of-trolleys [ ask one-of routepts [ hatch-trolleys 1 [ set to-routept one-of [out-link-neighbors] of myself face to-routept set size 1.5 set color yellow set-velocity who velocity-max-patches-per-tick set load-unload-tick-counter ( random load-unload-time-avg-ticks ) set lead-trolley nobody set number-passengers 0 set state "unknown" ] ;; end hatch-trolleys ] ;; end ask one-of routepts ] ;; end repeat end to setup-file if output-csv-file [ file-open "station-load.csv" file-type "\"Seconds Since Midnight\"," foreach sort stations [ ask ? [ file-type "\"" file-type name file-type " Unload\"," file-type "\"" file-type name file-type " Load\"," ] ] file-print "" ] end to print-file if output-csv-file [ if ((get-seconds-past-midnight mod 10) = 0) [ file-type "\"" file-type get-seconds-past-midnight file-type "\"," foreach sort stations [ ask ? [ file-type "\"" file-type last-unload-count file-type "\"," file-type "\"" file-type last-load-count file-type "\"," ] ] file-print "" ] ] end ;; ;; Simulation functions ;; to get-next-routept [whoid] ask trolley whoid [ set load-unload-tick-counter random load-unload-time-avg-ticks if load-unload-tick-counter < load-unload-time-min-ticks [ set load-unload-tick-counter load-unload-time-min-ticks ] set-velocity whoid ( velocity-max-patches-per-tick - ( random-float (velocity-multiplier * velocity-max-patches-per-tick) ) ) set to-routept one-of [out-link-neighbors] of to-routept face to-routept ] end ;; Run the simulation by making the trolleys move about their routes to go set-traffic-density set-passenger-disposition queue-passengers move-trolleys update-waiting-passengers tick update-clock update-queue-status plot-passenger-status print-file if get-seconds-past-midnight >= end-time-of-day-seconds [ file-close stop ;; don't go past 11pm ] end to leave-station-queue [sn wait-time-ticks] let wait-time-secs (wait-time-ticks * seconds-per-tick) ask stations [ if name = sn [ set queue (queue - 1) set total-passengers-queued (total-passengers-queued + 1) set total-wait-secs (total-wait-secs + wait-time-secs) if max-wait-time-seconds < wait-time-secs [ set max-wait-time-seconds wait-time-secs ] ] ] set wait-time-total-seconds (wait-time-total-seconds + wait-time-secs) set wait-time-total-passengers (wait-time-total-passengers + 1) end to move-trolleys ;; Link traversal algorithm adapted from the LinkTravel example available ;; from: http://backspaces.net/wiki/NetLogo_Bag_of_Tricks ask trolleys [ let mystation (min-one-of stations [distance myself]) let distance-to-station (distance mystation) ;; Once the trolley reaches its current destination, turn to the next destination ifelse (distance to-routept < 0.0001) ;; we are at a routept [ ifelse (distance-to-station < 0.0001) ;; we are also at a station [ if state = "moving" [ set-velocity who 0 set state "unloading" unload-trolley self mystation set state "loading" load-trolley self mystation set state "countdown" ] ;; we are still loading/unloading ifelse (load-unload-tick-counter > 0) [ set load-unload-tick-counter (load-unload-tick-counter - 1) ] ;; else [ get-next-routept who ] ] ;; else [ get-next-routept who ] ] ;; else [ set state "moving" ;; Determine which trolley, if any, is directly in front of this trolley ;; on the same link. set lead-trolley nobody let mywho who let mydist (distance to-routept) let myto to-routept let mylead nobody foreach sort-by [distance ?1 > distance ?2] trolleys [ if (mywho != (get-who ?)) and (myto = (get-to-routept ?)) and (mydist > (get-distance-to-routept ?)) [ set mylead ? ] ] if (mylead != nobody) [ set lead-trolley mylead let lead-velocity (get-velocity mylead) let lead-tick-cnt (get-tick-count mylead) ;; Don't pass other trolleys on the road if (lead-velocity > 0 ) [ set-velocity who lead-velocity ] if load-unload-tick-counter <= lead-tick-cnt [ set load-unload-tick-counter lead-tick-cnt + 5 ] ] ] ;; The trolley either moves the distance specified by velocity or ;; the remaining distance to its destination, whichever is less. face to-routept forward min list velocity distance to-routept ] end to queue-passengers ;; NB: This wrongly assumes that the number of trolleys matches the number in the collected data, but this provides a good starting point. if (ticks = 1) or (0 = (ticks mod (60 / seconds-per-tick))) [ let spm get-seconds-past-midnight ask stations [ set expected-arrivals (station-unload-model name spm) ] ask stations [ let start-name name let mydests (remaining-stations start-name) set partial-queue (partial-queue + estimate-load-passengers-per-minute start-name spm) if partial-queue >= 1.0 [ let pcount partial-queue set partial-queue (partial-queue mod 1.0) hatch-passengers pcount [ set shape "dot" set color red set number-of-ticks-to-wait default-number-of-ticks-to-wait set start-location start-name set state "waiting" ask myself [ set queue (queue + 1) ] ;set destination (get-destination start-name) let mydest "" let found-dest false foreach shuffle mydests [ ask stations [ if (found-dest = false) and (name = ?) [ if expected-arrivals > 0 [ set mydest name set expected-arrivals (expected-arrivals - 0) set found-dest true ] ] ] ] set destination mydest ] set total-passengers (total-passengers + pcount) ] if queue > max-queue [ set max-queue queue ] ] ;; For the East-bound route if the next-to-last stop (and any immediately ;; prior stops) are turned off the riders that would have appeared at those ;; stops get accumulated at the MARTA stop under the assumption they could be ;; headed to Publix. However, for the West-bound route this same rationale ;; does not hold true because of the layout of the map. So if the user turns ;; off the Challenge Course stop (and any immediately prior stops) we need to ;; account for those 'orphaned riders'. By analysis we can see that such a ;; rider has no choice but to walk. if (station-challenge-course = false) [ set special-partial-queue (special-partial-queue + (estimate-load-passengers-per-minute station-name-challenge-course spm)) if special-partial-queue >= 1.0 [ let rem (special-partial-queue mod 1.0) let pcount (special-partial-queue - rem) set special-partial-queue rem set total-passengers-walking-now (total-passengers-walking-now + pcount) set total-passengers (total-passengers + pcount) ] ] ] end to load-trolley [trolley station] ask trolley [ if (number-passengers < max-number-passengers-per-trolley) [ ask station [ set last-load-count 0 ] foreach sort-by [distance ?1 > distance ?2] passengers [ if ( (distance ?) < 0.0001 ) and (number-passengers < max-number-passengers-per-trolley) [ ask ? [ if (state = "waiting") [ ask station [ set last-load-count (last-load-count + 1) ] leave-station-queue start-location (default-number-of-ticks-to-wait - number-of-ticks-to-wait) set state "riding" create-trolleyseat-from myself [ tie ] ask myself [ set number-passengers (number-passengers + 1) ] ] ] ] ] ] ] end to unload-trolley [trolley station] ask trolley [ ask station [ set last-unload-count 0 ] foreach sort my-out-links [ ask ? [ ask end2 [ if (get-distance-to-station xcor ycor destination) < 0.0001 [ ask station [ set last-unload-count (last-unload-count + 1) ] ask trolley [ set number-passengers (number-passengers - 1) ] set state "finished" die ] ] ] ] ] end to update-waiting-passengers foreach sort passengers [ ask ? [ if (get-distance-to-station xcor ycor start-location) < 0.0001 [ set number-of-ticks-to-wait (number-of-ticks-to-wait - 1) ] if (number-of-ticks-to-wait <= 0) ;; Tired of waiting, just walk [ leave-station-queue start-location (default-number-of-ticks-to-wait - number-of-ticks-to-wait) set total-passengers-walking-now (total-passengers-walking-now + 1) die ] ] ] end to set-passenger-disposition if passenger-disposition = "patient" [ set default-number-of-ticks-to-wait (1005 * 60 / seconds-per-tick) ] ; 1005 minutes or the length of time from 5:45am to 11pm if passenger-disposition = "somewhat patient" [ set default-number-of-ticks-to-wait (12 * 60 / seconds-per-tick) ] ; 12 minutes if passenger-disposition = "impatient" [ set default-number-of-ticks-to-wait ( 6 * 60 / seconds-per-tick) ] ; 6 minutes end to set-traffic-density ;; Allow the average velocity to vary by traffic density ifelse traffic-density = "light" [ set velocity-multiplier 0.05 ] [ ifelse traffic-density = "medium" [ set velocity-multiplier 0.5 ] [ set velocity-multiplier 0.9 ] ] ;; heavy end to set-velocity [whoid velocity-patches-per-tick] ask trolley whoid [ set velocity velocity-patches-per-tick if velocity-patches-per-tick > 0 [ if velocity > velocity-max-patches-per-tick [ set velocity velocity-max-patches-per-tick ] ] ;; (patches/tick) * (ticks/s) * (ft/patch) * (mi/ft) * (s/hr) = mi/hr set velocity-mph ( velocity * (feet-per-patch * 3600.0) / (seconds-per-tick * 5280.0) ) ] end to update-clock let current-sec-since-midnight (time-of-day-offset-seconds + (ticks * seconds-per-tick)) let hour-remainder (current-sec-since-midnight mod (minutes-per-hour * seconds-per-minute)) let minute-remainder ( hour-remainder mod seconds-per-minute ) set current-hour ( (current-sec-since-midnight - hour-remainder) / (minutes-per-hour * seconds-per-minute) ) set current-minute ( (hour-remainder - minute-remainder) / seconds-per-minute ) set current-second minute-remainder end to update-queue-status ask stations [ ifelse name = station-name-marta [ set station-queue-max-marta max-queue set station-queue-status-marta queue set station-wait-minutes-max-marta (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-marta (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-moes [ set station-queue-max-moes max-queue set station-queue-status-moes queue set station-wait-minutes-max-moes (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-moes (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-5th-st-ribs [ set station-queue-max-5th-st-ribs max-queue set station-queue-status-5th-st-ribs queue set station-wait-minutes-max-5th-st-ribs (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-5th-st-ribs (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-ferst-cherry [ set station-queue-max-ferst-cherry max-queue set station-queue-status-ferst-cherry queue set station-wait-minutes-max-ferst-cherry (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-ferst-cherry (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-klaus-east [ set station-queue-max-klaus-east max-queue set station-queue-status-klaus-east queue set station-wait-minutes-max-klaus-east (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-klaus-east (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-crc [ set station-queue-max-crc max-queue set station-queue-status-crc queue set station-wait-minutes-max-crc (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-crc (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-challenge-course [ set station-queue-max-challenge-course max-queue set station-queue-status-challenge-course queue set station-wait-minutes-max-challenge-course (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-challenge-course (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-marc [ set station-queue-max-marc max-queue set station-queue-status-marc queue set station-wait-minutes-max-marc (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-marc (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-ferst-state [ set station-queue-max-ferst-state max-queue set station-queue-status-ferst-state queue set station-wait-minutes-max-ferst-state (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-ferst-state (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-physics-bld [ set station-queue-max-physics-bld max-queue set station-queue-status-physics-bld queue set station-wait-minutes-max-physics-bld (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-physics-bld (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-nanotech-bld [ set station-queue-max-nanotech-bld max-queue set station-queue-status-nanotech-bld queue set station-wait-minutes-max-nanotech-bld (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-nanotech-bld (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-cherry-emerson [ set station-queue-max-cherry-emerson max-queue set station-queue-status-cherry-emerson queue set station-wait-minutes-max-cherry-emerson (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-cherry-emerson (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-chandler-stadium [ set station-queue-max-chandler-stadium max-queue set station-queue-status-chandler-stadium queue set station-wait-minutes-max-chandler-stadium (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-chandler-stadium (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-pkt-fraternity [ set station-queue-max-pkt-fraternity max-queue set station-queue-status-pkt-fraternity queue set station-wait-minutes-max-pkt-fraternity (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-pkt-fraternity (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-psk-fraternity [ set station-queue-max-psk-fraternity max-queue set station-queue-status-psk-fraternity queue set station-wait-minutes-max-psk-fraternity (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-psk-fraternity (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-ka-fraternity [ set station-queue-max-ka-fraternity max-queue set station-queue-status-ka-fraternity queue set station-wait-minutes-max-ka-fraternity (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-ka-fraternity (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-college-mgmt [ set station-queue-max-college-mgmt max-queue set station-queue-status-college-mgmt queue set station-wait-minutes-max-college-mgmt (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-college-mgmt (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ ifelse name = station-name-academy-med [ set station-queue-max-academy-med max-queue set station-queue-status-academy-med queue set station-wait-minutes-max-academy-med (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-academy-med (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] [ if name = station-name-publix [ set station-queue-max-publix max-queue set station-queue-status-publix queue set station-wait-minutes-max-publix (max-wait-time-seconds / seconds-per-minute) if total-passengers-queued > 0 [ set station-wait-minutes-avg-publix (total-wait-secs / (total-passengers-queued * seconds-per-minute)) ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] if (wait-time-total-passengers > 0) [ set wait-time-average-minutes (wait-time-total-seconds / (wait-time-total-passengers * seconds-per-minute)) ] end to plot-passenger-status set-current-plot "Passengers in the Trolley System" let total-waiting 0 let total-riders 0 let total-now 0 ask passengers [ if state = "waiting" [ set total-waiting (total-waiting + 1) ] if state = "riding" [ set total-riders (total-riders + 1) ] ] let x get-seconds-past-midnight set-current-plot-pen "Waiting" plotxy (x) (total-waiting) set-current-plot-pen "Riding" plotxy (x) (total-riders) set-current-plot-pen "Walking" plotxy (x) (total-passengers-walking-now) set total-passengers-walking (total-passengers-walking + total-passengers-walking-now) set total-now (total-waiting + total-riders + total-passengers-walking-now) set-current-plot-pen "Total" plotxy (x) (total-now) set total-passengers-walking-now 0 end to-report get-destination [start-name] let possible-destinations (remaining-stations start-name) let destname (one-of possible-destinations) let lucky-number (random-float 1.0) let lucky-sum 0.0 ; should be less than 1.0 ; loop over possible destinations and see which is this passenger's destination while [(lucky-sum >= lucky-number) and (not empty? possible-destinations)] [ set destname (first possible-destinations) set possible-destinations but-first possible-destinations ; remove this destination set lucky-sum (lucky-sum + (percent-chance-of-unload-at-dest start-name destname get-seconds-past-midnight)) ; ] report destname end to-report get-distance-to-station [x y station-name] let result (max-pxcor * 5.0) foreach sort stations [ ask ? [ if name = station-name [ set result distancexy x y ] ] ] report result end to-report get-distance-to-routept [trolley] let mydistance 0 ask trolley [ set mydistance distance(to-routept) ] report mydistance end to-report get-station-name [station] let myname "default" ask station [ set myname name ] report myname end to-report get-tick-count [trolley] let mytickcount 0 ask trolley [ set mytickcount load-unload-tick-counter ] report mytickcount end to-report get-to-routept [trolley] let myroutept 0 ask trolley [ set myroutept to-routept ] report myroutept end to-report get-velocity [trolley] let myvelocity 0 ask trolley [ set myvelocity velocity ] report myvelocity end to-report get-who [trolley] let mywho 0 ask trolley [ set mywho who ] report mywho end ;; calculate the number of passengers that will queue at a trolley stop over a minute to-report estimate-load-passengers-per-minute [sn tod] report (convert-to-rate tod (model-fixup (station-load-model sn tod))) end ;; This function returns the per MINUTE rate predicted by a stop model ;; - time - a 24-hour time format. e.g., 6am is 600 ;; - value - number of riders (can return partial riders) ;; ;; Period Start Period End Frequency (minutes) ;; 05:45 (20700) 06:30 (23400) 36 ;; 06:30 (23400) 07:30 (27000) 12 ;; 07:30 (27000) 17:05 (61500) 6 ;; 17:05 (61500) 18:00 (64800) 8 ;; 18:00 (64800) 19:00 (68400) 12 ;; 19:00 (68400) 21:45 (78300) 15 ;; 21:45 (78300) 23:00 (82800) 30 to-report convert-to-rate [time value] let ret 0 if ((20700 <= time) and (time < 23400)) [ set ret (value / 36) ] if ((23400 <= time) and (time < 27000)) [ set ret (value / 12) ] if ((27000 <= time) and (time < 61500)) [ set ret (value / 6) ] if ((61500 <= time) and (time < 64800)) [ set ret (value / 8) ] if ((64800 <= time) and (time < 68400)) [ set ret (value / 12) ] if ((68400 <= time) and (time < 78300)) [ set ret (value / 15) ] if ((78300 <= time) and (time <= 82800)) [ set ret (value / 30) ] if (ret < 0) [ set ret 0 ] report ret end ;; This function ensures that the models do not return negative riders. ;; Future fixups can be included with this function. to-report model-fixup [value] ifelse (value < 0) [report 0] [report value] end ;; ;; Trolley Stop Legend ;; ;; 01 station-name-crc "Campus Recreation Center" ;; 02 station-name-marc "Manufacturing Research Center" ;; 03 station-name-physics-bld "Physics" ;; 04 station-name-cherry-emerson "Cherry Emerson" ;; 05 station-name-klaus-east "Klaus (East bound)" ;; 06 station-name-pkt-fraternity "Phi Kappa Theta" ;; 07 station-name-ka-fraternity "Kappa Alpha" ;; 08 station-name-5th-st-ribs "5th St Ribs & Blues" ;; 09 station-name-college-mgmt "College of Management" ;; 10 station-name-academy-med "Academy of Medicine" ;; 11 station-name-marta "MARTA" ;; 12 station-name-publix "Publix" ;; 13 station-name-moes "Moe's" ;; 14 station-name-psk-fraternity "Phi Sigma Kappa" ;; 15 station-name-chandler-stadium "Chandler Stadium" ;; 16 station-name-ferst-cherry "Ferst & Cherry" ;; 17 station-name-nanotech-bld "Nanotech" ;; 18 station-name-ferst-state "Ferst & State" ;; 19 station-name-challenge-course "Challenge Course" ;; ;; East Bound Line ;; ;; 01 N station-name-crc "Campus Recreation Center" End of Line ;; 02 Y station-name-marc "Manufacturing Research Center" ;; 03 Y station-name-physics-bld "Physics" ;; 04 Y station-name-cherry-emerson "Cherry Emerson" ;; 05 N station-name-klaus-east "Klaus (East bound)" ;; 06 Y station-name-pkt-fraternity "Phi Kappa Theta" ;; 07 Y station-name-ka-fraternity "Kappa Alpha" ;; 08 N station-name-5th-st-ribs "5th St Ribs & Blues" ;; 09 Y station-name-college-mgmt "College of Management" ;; 10 Y station-name-academy-med "Academy of Medicine" ;; 11 N station-name-marta "MARTA" End of Line ;; ;; West Bound Line ;; ;; 11 N station-name-marta "MARTA" End of Line ;; 12 Y station-name-publix "Publix" ;; 13 N station-name-moes "Moe's" ;; 14 Y station-name-psk-fraternity "Phi Sigma Kappa" ;; 15 Y station-name-chandler-stadium "Chandler Stadium" ;; 16 N station-name-ferst-cherry "Ferst & Cherry" ;; 17 Y station-name-nanotech-bld "Nanotech" ;; 18 Y station-name-ferst-state "Ferst & State" ;; 19 Y station-name-challenge-course "Challenge Course" ;; 01 N station-name-crc "Campus Recreation Center" End of Line ;; Use the station identifier (sn) and seconds since midnight (x) to determine how many passengers are typically at a given stop to-report station-load-model [sn x] ;; ;; ;; LOAD models ;; ifelse sn = station-name-crc [ report station-load-crc x ] [ ifelse sn = station-name-marc [ report station-load-marc x ] [ ifelse sn = station-name-physics-bld [ report station-load-physics-bld x ] [ ifelse sn = station-name-cherry-emerson [ report station-load-cherry-emerson x ] [ ifelse sn = station-name-klaus-east [ report station-load-klaus-east x ] [ ifelse sn = station-name-pkt-fraternity [ report station-load-pkt-fraternity x ] [ ifelse sn = station-name-ka-fraternity [ report station-load-ka-fraternity x ] [ ifelse sn = station-name-5th-st-ribs [ report station-load-5th-st-ribs x ] [ ifelse sn = station-name-college-mgmt [ report station-load-college-mgmt x ] [ ifelse sn = station-name-academy-med [ report station-load-academy-med x ] [ ifelse sn = station-name-marta [ report station-load-marta x ] [ ifelse sn = station-name-publix [ report station-load-publix x ] [ ifelse sn = station-name-moes [ report station-load-moes x ] [ ifelse sn = station-name-psk-fraternity [ report station-load-psk-fraternity x ] [ ifelse sn = station-name-chandler-stadium [ report station-load-chandler-stadium x ] [ ifelse sn = station-name-ferst-cherry [ report station-load-ferst-cherry x ] [ ifelse sn = station-name-nanotech-bld [ report station-load-nanotech-bld x ] [ ifelse sn = station-name-ferst-state [ report station-load-ferst-state x ] [ if sn = station-name-challenge-course [ report station-load-challenge-course x ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] end ;; ;; Load models for individual stops ;; ;; Note that if any previous stations on this route are turned off we roll up ;; those passengers as well. However care must be taken to ensure that the ;; rollup passengers are not being handled by an intermediate stop along the ;; way. ;; ;; Also note that because we have 6 'perminent' stops, we know that those 6 ;; stops never need their passengers rolled up by subsequent stops. This fact ;; actually simplifies the algorithms greatly. ;; ;; The x parameter always represents seconds since midnight ;; to-report station-load-crc [x] report ( 8.9587E-19 * x * x * x * x - 2.6667E-13 * x * x * x + 1.8657E-08 * x * x - 2.2156E-04 * x - 7.4539E-01 ) end to-report station-load-marc [x] report ( -2.6944E-19 * x * x * x * x + 7.3934E-14 * x * x * x - 7.4999E-09 * x * x + 3.2226E-04 * x - 4.3831E+00 ) end to-report station-load-physics-bld [x] let load ( -8.7124E-20 * x * x * x * x + 1.3266E-14 * x * x * x - 6.5310E-10 * x * x + 1.3787E-05 * x - 9.3689E-02 ) if station-mfg-research-bld = false [ set load (load + station-load-marc x) ] report load end to-report station-load-cherry-emerson [x] let load ( -8.2545E-19 * x * x * x * x + 1.7491E-13 * x * x * x - 1.4910E-08 * x * x + 5.9826E-04 * x - 7.9117E+00 ) if (station-physics-bld = false) [ set load (load + station-load-physics-bld x) ] report load end to-report station-load-klaus-east [x] let load ( -1.6901E-18 * x * x * x * x + 3.4591E-13 * x * x * x - 2.6192E-08 * x * x + 8.7697E-04 * x - 1.0176E+01 ) if (station-cherry-emerson = false) [ set load (load + station-load-cherry-emerson x) ] report load end to-report station-load-pkt-fraternity [x] report ( -5.9028E-19 * x * x * x * x + 1.2541E-13 * x * x * x - 1.0354E-08 * x * x + 3.9451E-04 * x - 4.8140E+00 ) end to-report station-load-ka-fraternity [x] let load ( 2.4888E-19 * x * x * x * x - 3.7678E-14 * x * x * x - 4.6064E-11 * x * x + 1.6630E-04 * x - 3.4307E+00 ) if (station-pkt-fraternity = false) [ set load (load + station-load-pkt-fraternity x) ] report load end to-report station-load-5th-st-ribs [x] let load ( 1.7376E-18 * x * x * x * x - 2.8735E-13 * x * x * x + 8.3110E-09 * x * x + 4.3128E-04 * x - 1.1176E+01 ) if (station-ka-fraternity = false) [ set load (load + station-load-ka-fraternity x) ] report load end to-report station-load-college-mgmt [x] report ( 1.6109E-20 * x * x * x * x - 4.1308E-14 * x * x * x + 5.0899E-09 * x * x - 1.7430E-04 * x + 1.9647E+00 ) end to-report station-load-academy-med [x] let load ( 5.0410E-20 * x * x * x * x - 1.3871E-14 * x * x * x + 1.2608E-09 * x * x - 4.3983E-05 * x + 5.4455E-01 ) if (station-college-mgmt = false) [ set load (load + station-load-college-mgmt x) ] report load end to-report station-load-marta [x] let load ( -2.8230E-17 * x * x * x * x + 5.9741E-12 * x * x * x - 4.5205E-07 * x * x + 1.4222E-02 * x - 1.4695E+02 ) if (station-academy-med = false) [ set load (load + station-load-academy-med x) ] report load end to-report station-load-publix [x] report ( -4.0088E-19 * x * x * x * x + 8.1595E-14 * x * x * x - 5.8829E-09 * x * x + 1.7566E-04 * x - 1.6931E+00 ) end to-report station-load-moes [x] let load ( -2.7842E-19 * x * x * x * x + 2.0227E-14 * x * x * x + 2.9847E-10 * x * x - 4.1426E-06 * x - 9.0188E-02 ) if (station-publix = false) [ set load (load + station-load-publix x) ] report load end to-report station-load-psk-fraternity [x] report ( 1.0979E-18 * x * x * x * x - 2.0246E-13 * x * x * x + 1.0911E-08 * x * x - 1.2648E-04 * x - 5.8818E-01 ) end to-report station-load-chandler-stadium [x] let load ( -5.9984E-19 * x * x * x * x + 1.0602E-13 * x * x * x - 7.8456E-09 * x * x + 3.1241E-04 * x - 4.3169E+00 ) if (station-psk-fraternity = false) [ set load (load + station-load-psk-fraternity x) ] report load end to-report station-load-ferst-cherry [x] let load ( -3.1921E-19 * x * x * x * x - 8.8903E-16 * x * x * x + 2.4524E-09 * x * x - 7.8277E-07 * x - 1.3387E+00 ) if (station-chandler-stadium = false) [ set load (load + station-load-chandler-stadium x) ] report load end to-report station-load-nanotech-bld [x] report ( -5.0598E-18 * x * x * x * x + 9.6140E-13 * x * x * x - 6.8299E-08 * x * x + 2.2323E-03 * x - 2.5942E+01 ) end to-report station-load-ferst-state [x] let load ( -3.9231E-19 * x * x * x * x + 7.7832E-14 * x * x * x - 5.5523E-09 * x * x + 1.6904E-04 * x - 1.7363E+00 ) if (station-nanotech-bld = false) [ set load (load + station-load-nanotech-bld x) ] report load end to-report station-load-challenge-course [x] let load ( -3.5858E-18 * x * x * x * x + 7.2118E-13 * x * x * x - 5.2801E-08 * x * x + 1.6750E-03 * x - 1.8150E+01 ) if (station-ferst-state = false) [ set load (load + station-load-ferst-state x) ] report load end ;; Use the station identifier (sn) and the seconds since midnight (x) to determine how many passengers typically get off at a given stop to-report station-unload-model [sn x] ;; ;; UNLOAD models ;; ifelse sn = station-name-crc [ report -1.3879E-18 * x * x * x * x + 3.9250E-13 * x * x * x - 4.3611E-08 * x * x + 2.0283E-03 * x - 2.6354E+01 ] [ ifelse sn = station-name-marc [ report -8.2869E-18 * x * x * x * x + 1.6222E-12 * x * x * x - 1.1391E-07 * x * x + 3.4429E-03 * x - 3.5901E+01 ] [ ifelse sn = station-name-physics-bld [ report -4.7436E-19 * x * x * x * x + 9.2063E-14 * x * x * x - 6.3221E-09 * x * x + 1.8121E-04 * x - 1.6916E+00 ] [ ifelse sn = station-name-cherry-emerson [ report -7.4026E-18 * x * x * x * x + 1.5942E-12 * x * x * x - 1.2486E-07 * x * x + 4.1458E-03 * x - 4.5409E+01 ] [ ifelse sn = station-name-klaus-east [ report -4.9853E-18 * x * x * x * x + 1.1354E-12 * x * x * x - 9.3531E-08 * x * x + 3.2194E-03 * x - 3.6063E+01 ] [ ifelse sn = station-name-pkt-fraternity [ report -3.6127E-19 * x * x * x * x + 7.5464E-14 * x * x * x - 6.1311E-09 * x * x + 2.2044E-04 * x - 2.2564E+00 ] [ ifelse sn = station-name-ka-fraternity [ report -2.7980E-18 * x * x * x * x + 5.9654E-13 * x * x * x - 4.6297E-08 * x * x + 1.5309E-03 * x - 1.6964E+01 ] [ ifelse sn = station-name-5th-st-ribs [ report -3.3885E-18 * x * x * x * x + 7.3463E-13 * x * x * x - 5.7134E-08 * x * x + 1.8492E-03 * x - 1.9457E+01 ] [ ifelse sn = station-name-college-mgmt [ report -3.4266E-18 * x * x * x * x + 8.5463E-13 * x * x * x - 7.9413E-08 * x * x + 3.1386E-03 * x - 3.9524E+01 ] [ ifelse sn = station-name-academy-med [ report -6.3331E-19 * x * x * x * x + 1.0223E-13 * x * x * x - 5.7449E-09 * x * x + 1.4919E-04 * x - 1.4778E+00 ] [ ifelse sn = station-name-marta [ report -7.8697E-18 * x * x * x * x + 1.1661E-12 * x * x * x - 5.3971E-08 * x * x + 9.7110E-04 * x - 4.5356E+00 ] [ ifelse sn = station-name-publix [ report -7.5282E-20 * x * x * x * x + 1.4553E-14 * x * x * x - 9.9834E-10 * x * x + 3.0527E-05 * x - 3.3417E-01 ] [ ifelse sn = station-name-moes [ report 2.0863E-18 * x * x * x * x - 3.7416E-13 * x * x * x + 1.6915E-08 * x * x + 7.9045E-05 * x - 7.5565E+00 ] [ ifelse sn = station-name-psk-fraternity [ report -6.2831E-19 * x * x * x * x + 1.1879E-13 * x * x * x - 9.0387E-09 * x * x + 3.5217E-04 * x - 4.7249E+00 ] [ ifelse sn = station-name-chandler-stadium [ report -1.0172E-18 * x * x * x * x + 1.9685E-13 * x * x * x - 1.4365E-08 * x * x + 4.8599E-04 * x - 5.8588E+00 ] [ ifelse sn = station-name-ferst-cherry [ report -8.5638E-19 * x * x * x * x + 2.0394E-13 * x * x * x - 1.7908E-08 * x * x + 6.7289E-04 * x - 8.4595E+00 ] [ ifelse sn = station-name-nanotech-bld [ report -6.3031E-19 * x * x * x * x + 1.6338E-13 * x * x * x - 1.5849E-08 * x * x + 6.5390E-04 * x - 8.5702E+00 ] [ ifelse sn = station-name-ferst-state [ report 3.0904E-20 * x * x * x * x - 5.7917E-15 * x * x * x + 3.6980E-10 * x * x - 9.0701E-06 * x + 7.8723E-02 ] [ if sn = station-name-challenge-course [ report 1.2495E-21 * x * x * x * x + 4.5470E-16 * x * x * x - 1.8178E-10 * x * x + 1.4749E-05 * x - 2.5235E-01 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] end ;; destination estimation ;; iterate over each active stop ahead on the line and record the number of passengers getting off at each stop as well as the total number of passengers ;; probability of a given destination stop is number of passengers at that stop divided by the total to-report percent-chance-of-unload-at-dest [ current-stop-name destination-stop-name tod ] ;; calculate the total number of passengers let total-passengers-now 0 ;; loop over all all active stations summing the number of riders foreach sort (remaining-stations current-stop-name) [ ask ? [ set total-passengers-now (total-passengers-now + (model-fixup (station-unload-model name tod))) ] ] ;; subtract the number of riders at this station from the total since this station cannot be a destination set total-passengers-now (total-passengers-now - (station-unload-model current-stop-name tod)) ;; ensure that we do not divide by zero or a negative number if (total-passengers-now <= 0 ) [ set total-passengers-now 0.01 ] ;; calculate the percent chance that this is the passenger's destination report ((model-fixup(station-unload-model destination-stop-name tod)) / total-passengers-now) end ;; ;; Get a list of the stations reamaining on the line from the current station ;; ;; Function Verified 17 Feb 2011 1859 ;; to-report remaining-stations [ current-station ] let station-list [] ;; add active stations remaining on East Bound route if current-station = station-name-crc [ if (station-mfg-research-bld) [ set station-list lput station-name-marc station-list ] if (station-physics-bld) [ set station-list lput station-name-physics-bld station-list ] if (station-cherry-emerson) [ set station-list lput station-name-cherry-emerson station-list ] set station-list lput station-name-klaus-east station-list if (station-pkt-fraternity) [ set station-list lput station-name-pkt-fraternity station-list ] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-marc [ if (station-physics-bld) [ set station-list lput station-name-physics-bld station-list ] if (station-cherry-emerson) [ set station-list lput station-name-cherry-emerson station-list ] set station-list lput station-name-klaus-east station-list if (station-pkt-fraternity) [ set station-list lput station-name-pkt-fraternity station-list ] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-physics-bld [ if (station-cherry-emerson) [ set station-list lput station-name-cherry-emerson station-list ] set station-list lput station-name-klaus-east station-list if (station-pkt-fraternity) [ set station-list lput station-name-pkt-fraternity station-list ] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-cherry-emerson [ set station-list lput station-name-klaus-east station-list if (station-pkt-fraternity) [ set station-list lput station-name-pkt-fraternity station-list ] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-klaus-east [ if (station-pkt-fraternity) [ set station-list lput station-name-pkt-fraternity station-list ] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-pkt-fraternity [ set station-list [] if (station-ka-fraternity) [ set station-list lput station-name-ka-fraternity station-list ] set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-ka-fraternity [ set station-list lput station-name-5th-st-ribs station-list if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-5th-st-ribs [ if (station-college-mgmt) [ set station-list lput station-name-college-mgmt station-list ] if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-college-mgmt [ if (station-academy-med) [ set station-list lput station-name-academy-med station-list ] set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on East Bound route if current-station = station-name-academy-med [ set station-list lput station-name-marta station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-marta [ if (station-publix) [ set station-list lput station-name-publix station-list ] set station-list lput station-name-moes station-list if (station-psk-fraternity) [ set station-list lput station-name-psk-fraternity station-list ] if (station-chandler-stadium) [ set station-list lput station-name-chandler-stadium station-list ] set station-list lput station-name-ferst-cherry station-list if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-publix [ set station-list lput station-name-moes station-list if (station-psk-fraternity) [ set station-list lput station-name-psk-fraternity station-list ] if (station-chandler-stadium) [ set station-list lput station-name-chandler-stadium station-list ] set station-list lput station-name-ferst-cherry station-list if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-moes [ if (station-psk-fraternity) [ set station-list lput station-name-psk-fraternity station-list ] if (station-chandler-stadium) [ set station-list lput station-name-chandler-stadium station-list ] set station-list lput station-name-ferst-cherry station-list if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-psk-fraternity [ if (station-chandler-stadium) [ set station-list lput station-name-chandler-stadium station-list ] set station-list lput station-name-ferst-cherry station-list if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-chandler-stadium [ set station-list lput station-name-ferst-cherry station-list if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-ferst-cherry [ if (station-nanotech-bld) [ set station-list lput station-name-nanotech-bld station-list ] if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-nanotech-bld [ if (station-ferst-state) [ set station-list lput station-name-ferst-state station-list ] if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-ferst-state [ if (station-challenge-course) [ set station-list lput station-name-challenge-course station-list ] set station-list lput station-name-crc station-list report station-list ] ;; add active stations remaining on West Bound route if current-station = station-name-challenge-course [ set station-list lput station-name-crc station-list report station-list ] report station-list end ; calculate the time of day based on the start time and the number of ticks to-report get-seconds-past-midnight report time-of-day-offset-seconds + (ticks * seconds-per-tick) end @#$#@#$#@ GRAPHICS-WINDOW 575 10 1395 651 40 30 10.0 1 8 1 1 1 0 1 1 1 -40 40 -30 30 1 1 1 ticks BUTTON 754 149 809 182 config setup NIL 1 T OBSERVER NIL C NIL NIL BUTTON 862 149 917 182 NIL go T 1 T OBSERVER NIL G NIL NIL SLIDER 394 229 568 262 number-of-trolleys number-of-trolleys 1 12 6 1 1 NIL HORIZONTAL SWITCH 394 195 568 228 station-challenge-course station-challenge-course 0 1 -1000 SWITCH 394 161 568 194 station-ferst-state station-ferst-state 0 1 -1000 SWITCH 196 59 370 92 station-physics-bld station-physics-bld 0 1 -1000 SWITCH 394 127 568 160 station-nanotech-bld station-nanotech-bld 0 1 -1000 SWITCH 196 93 370 126 station-cherry-emerson station-cherry-emerson 0 1 -1000 SWITCH 196 25 370 58 station-mfg-research-bld station-mfg-research-bld 0 1 -1000 SWITCH 394 93 568 126 station-chandler-stadium station-chandler-stadium 0 1 -1000 SWITCH 196 127 370 160 station-pkt-fraternity station-pkt-fraternity 0 1 -1000 SWITCH 394 59 568 92 station-psk-fraternity station-psk-fraternity 0 1 -1000 SWITCH 196 161 370 194 station-ka-fraternity station-ka-fraternity 0 1 -1000 SWITCH 196 195 370 228 station-college-mgmt station-college-mgmt 0 1 -1000 SWITCH 196 229 370 262 station-academy-med station-academy-med 0 1 -1000 SWITCH 394 25 568 58 station-publix station-publix 0 1 -1000 MONITOR 596 60 746 101 Total Number of Stations number-of-stations 17 1 10 CHOOSER 9 25 174 70 avg-speed-limit-mph avg-speed-limit-mph 5 10 15 20 25 30 3 CHOOSER 9 71 174 116 traffic-density traffic-density "light" "medium" "heavy" 1 CHOOSER 9 117 174 162 start-time-of-day start-time-of-day "5:45am" "6:00am" "6:30am" "7:00am" "7:30am" "8:00am" "8:30am" "9:00am" "9:30am" "10:00am" "10:30am" "11:00am" "11:30am" "12:00pm" "12:30pm" "1:00pm" "1:30pm" "2:00pm" "2:30pm" "3:00pm" "3:30pm" "4:00pm" "4:30pm" "5:00pm" "5:30pm" "6:00pm" "6:30pm" "7:00pm" "7:30pm" "8:00pm" "8:30pm" "9:00pm" "9:30pm" "10:00pm" "10:30pm" 0 CHOOSER 9 163 174 208 end-time-of-day end-time-of-day "6:00am" "6:30am" "7:00am" "7:30am" "8:00am" "8:30am" "9:00am" "9:30am" "10:00am" "10:30am" "11:00am" "11:30am" "12:00pm" "12:30pm" "1:00pm" "1:30pm" "2:00pm" "2:30pm" "3:00pm" "3:30pm" "4:00pm" "4:30pm" "5:00pm" "5:30pm" "6:00pm" "6:30pm" "7:00pm" "7:30pm" "8:00pm" "8:30pm" "9:00pm" "9:30pm" "10:00pm" "10:30pm" "11:00pm" 34 MONITOR 754 60 804 101 Hour current-hour 0 1 10 MONITOR 804 60 854 101 Minutes current-minute 0 1 10 TEXTBOX 754 41 904 59 Simulation Time 10 9.9 1 MONITOR 854 60 904 101 Seconds current-second 0 1 10 BUTTON 808 149 863 182 step go NIL 1 T OBSERVER NIL S NIL NIL PLOT 748 431 1381 637 Passengers in the Trolley System Time (Seconds Past Midnight) Passengers 19800.0 82800.0 0.0 80.0 true true PENS "Riding" 1.0 0 -10899396 true "Waiting" 1.0 0 -5825686 true "Walking" 1.0 0 -2674135 true "Total" 1.0 0 -13345367 true CHOOSER 9 209 174 254 passenger-disposition passenger-disposition "patient" "somewhat patient" "impatient" 0 MONITOR 596 150 745 191 Total Passengers Walking total-passengers-walking 0 1 10 MONITOR 10 280 60 321 1 station-queue-status-crc 0 1 10 MONITOR 62 280 112 321 2 station-queue-status-marc 0 1 10 MONITOR 114 280 164 321 3 station-queue-status-physics-bld 0 1 10 MONITOR 218 280 268 321 5 station-queue-status-klaus-east 0 1 10 MONITOR 270 280 320 321 6 station-queue-status-pkt-fraternity 0 1 10 MONITOR 166 280 216 321 4 station-queue-status-cherry-emerson 0 1 10 MONITOR 322 280 372 321 7 station-queue-status-ka-fraternity 0 1 10 MONITOR 374 280 424 321 8 station-queue-status-5th-st-ribs 0 1 10 MONITOR 426 280 476 321 9 station-queue-status-college-mgmt 0 1 10 MONITOR 478 280 528 321 10 station-queue-status-academy-med 0 1 10 MONITOR 10 323 60 364 11 station-queue-status-marta 0 1 10 MONITOR 62 323 112 364 12 station-queue-status-publix 0 1 10 MONITOR 114 323 164 364 13 station-queue-status-moes 0 1 10 MONITOR 166 323 216 364 14 station-queue-status-psk-fraternity 0 1 10 MONITOR 218 323 268 364 15 station-queue-status-chandler-stadium 0 1 10 MONITOR 270 323 320 364 16 station-queue-status-ferst-cherry 0 1 10 MONITOR 322 323 372 364 17 station-queue-status-nanotech-bld 0 1 10 MONITOR 374 323 424 364 18 station-queue-status-ferst-state 0 1 10 MONITOR 426 323 476 364 19 station-queue-status-challenge-course 0 1 10 TEXTBOX 721 527 736 545 1 10 9.9 1 TEXTBOX 738 300 753 318 2 10 9.9 1 TEXTBOX 815 298 830 318 3 10 9.9 1 TEXTBOX 895 299 910 318 4 10 9.9 1 TEXTBOX 948 387 963 405 5 10 9.9 1 TEXTBOX 1016 387 1031 405 6 10 9.9 1 TEXTBOX 1099 386 1114 405 7 10 9.9 1 TEXTBOX 1184 387 1199 405 8 10 9.9 1 TEXTBOX 1268 386 1283 405 9 10 9.9 1 TEXTBOX 1280 206 1295 224 10 10 9.9 1 TEXTBOX 1317 133 1332 151 11 10 9.9 1 TEXTBOX 1217 119 1232 137 12 10 9.9 1 TEXTBOX 1180 353 1195 371 13 10 9.9 1 TEXTBOX 1095 353 1110 371 14 10 9.9 1 TEXTBOX 1011 353 1026 371 15 10 9.9 1 TEXTBOX 962 331 977 349 16 10 9.9 1 TEXTBOX 863 265 878 283 17 10 9.9 1 TEXTBOX 787 266 802 284 18 10 9.9 1 TEXTBOX 691 266 706 284 19 10 9.9 1 TEXTBOX 180 34 195 55 2 11 0.0 1 TEXTBOX 180 68 195 86 3 11 0.0 1 TEXTBOX 180 103 195 121 4 11 0.0 1 TEXTBOX 180 137 195 155 6 11 0.0 1 TEXTBOX 180 171 195 189 7 11 0.0 1 TEXTBOX 180 205 195 223 9 11 0.0 1 TEXTBOX 180 239 195 257 10 11 0.0 1 TEXTBOX 377 35 392 53 12 11 0.0 1 TEXTBOX 377 69 392 87 14 11 0.0 1 TEXTBOX 377 102 392 120 15 11 0.0 1 TEXTBOX 377 136 392 154 17 11 0.0 1 TEXTBOX 377 169 392 187 18 11 0.0 1 TEXTBOX 377 203 392 221 19 11 0.0 1 TEXTBOX 11 263 192 281 Current Station Queue Size 11 0.0 1 MONITOR 12 594 62 635 1 station-wait-minutes-max-crc 1 1 10 TEXTBOX 12 577 284 595 Maximum Station Wait Time (Minutes) 11 0.0 1 MONITOR 64 594 114 635 2 station-wait-minutes-max-marc 1 1 10 MONITOR 116 594 166 635 3 station-wait-minutes-max-physics-bld 1 1 10 MONITOR 168 594 218 635 4 station-wait-minutes-max-cherry-emerson 1 1 10 MONITOR 220 594 270 635 5 station-wait-minutes-max-klaus-east 1 1 10 MONITOR 272 594 322 635 6 station-wait-minutes-max-pkt-fraternity 1 1 10 MONITOR 324 594 374 635 7 station-wait-minutes-max-ka-fraternity 1 1 10 MONITOR 376 594 426 635 8 station-wait-minutes-max-5th-st-ribs 1 1 10 MONITOR 428 594 478 635 9 station-wait-minutes-max-college-mgmt 1 1 10 MONITOR 480 594 530 635 10 station-wait-minutes-max-academy-med 1 1 10 MONITOR 12 637 62 678 11 station-wait-minutes-max-marta 1 1 10 MONITOR 64 637 114 678 12 station-wait-minutes-max-publix 1 1 10 MONITOR 116 637 166 678 13 station-wait-minutes-max-moes 1 1 10 MONITOR 168 637 218 678 14 station-wait-minutes-max-psk-fraternity 1 1 10 MONITOR 220 637 270 678 15 station-wait-minutes-max-chandler-stadium 1 1 10 MONITOR 272 637 322 678 16 station-wait-minutes-max-ferst-cherry 1 1 10 MONITOR 324 637 374 678 17 station-wait-minutes-max-nanotech-bld 1 1 10 MONITOR 376 637 426 678 18 station-wait-minutes-max-ferst-state 1 1 10 MONITOR 428 637 478 678 19 station-wait-minutes-max-challenge-course 1 1 10 TEXTBOX 12 367 202 385 Maximum Station Queue Size 11 0.0 1 MONITOR 11 385 61 426 1 station-queue-max-crc 0 1 10 MONITOR 63 385 113 426 2 station-queue-max-marc 0 1 10 MONITOR 115 385 165 426 3 station-queue-max-physics-bld 0 1 10 MONITOR 167 385 217 426 4 station-queue-max-cherry-emerson 0 1 10 MONITOR 219 385 269 426 5 station-queue-max-klaus-east 0 1 10 MONITOR 271 385 321 426 6 station-queue-max-pkt-fraternity 0 1 10 MONITOR 323 385 373 426 7 station-queue-max-ka-fraternity 0 1 10 MONITOR 375 385 425 426 8 station-queue-max-5th-st-ribs 0 1 10 MONITOR 427 385 477 426 9 station-queue-max-college-mgmt 0 1 10 MONITOR 479 385 529 426 10 station-queue-max-academy-med 0 1 10 MONITOR 11 428 61 469 11 station-queue-max-marta 0 1 10 MONITOR 63 428 113 469 12 station-queue-max-publix 0 1 10 MONITOR 115 428 165 469 13 station-queue-max-moes 0 1 10 MONITOR 167 428 217 469 14 station-queue-max-psk-fraternity 0 1 10 MONITOR 219 428 269 469 15 station-queue-max-chandler-stadium 0 1 10 MONITOR 271 428 321 469 16 station-queue-max-ferst-cherry 0 1 10 MONITOR 323 428 373 469 17 station-queue-max-nanotech-bld 0 1 10 MONITOR 375 428 425 469 18 station-queue-max-ferst-state 0 1 10 MONITOR 427 428 477 469 19 station-queue-max-challenge-course 0 1 10 TEXTBOX 10 10 170 28 Environment Configuration: 11 0.0 1 TEXTBOX 198 10 370 28 Trolley System Configuration: 11 0.0 1 TEXTBOX 937 58 1229 238 Instructions:\n 1) Configure the environment and the trolley system\n 2) Click 'config' to configure the simulation\n 3a) Click 'step' to single step through time\n 3b) Click 'go' to continuously step through time\n\nNote: Six (6) stations are always available:\n 1: Campus Recreation Center\n 5: Klaus (towards MARTA)\n 8: Tech Square (towards MARTA)\n 11: MARTA Midtown\n 13: Tech Square (towards CRC)\n 16: Ferst Dr. & Cherry St. (towards CRC) 10 9.9 1 MONITOR 597 196 745 237 Average Wait Time (Minutes) wait-time-average-minutes 17 1 10 MONITOR 596 105 745 146 Total Number of Passengers total-passengers 0 1 10 MONITOR 11 533 61 574 11 station-wait-minutes-avg-marta 1 1 10 TEXTBOX 12 472 239 490 Average Station Wait Time (Minutes) 11 0.0 1 MONITOR 11 490 61 531 1 station-wait-minutes-avg-crc 1 1 10 MONITOR 63 490 113 531 2 station-wait-minutes-avg-marc 1 1 10 MONITOR 115 490 165 531 3 station-wait-minutes-avg-physics-bld 1 1 10 MONITOR 167 490 217 531 4 station-wait-minutes-avg-cherry-emerson 1 1 10 MONITOR 219 490 269 531 5 station-wait-minutes-avg-klaus-east 1 1 10 MONITOR 271 490 321 531 6 station-wait-minutes-avg-pkt-fraternity 1 1 10 MONITOR 323 490 373 531 7 station-wait-minutes-avg-ka-fraternity 1 1 10 MONITOR 375 490 425 531 8 station-wait-minutes-avg-5th-st-ribs 1 1 10 MONITOR 427 490 477 531 9 station-wait-minutes-avg-college-mgmt 1 1 10 MONITOR 479 490 529 531 10 station-wait-minutes-avg-academy-med 1 1 10 MONITOR 63 533 113 574 12 station-wait-minutes-avg-publix 1 1 10 MONITOR 115 533 165 574 13 station-wait-minutes-avg-moes 1 1 10 MONITOR 167 533 217 574 14 station-wait-minutes-avg-psk-fraternity 1 1 10 MONITOR 219 533 269 574 15 station-wait-minutes-avg-chandler-stadium 1 1 10 MONITOR 271 533 321 574 16 station-wait-minutes-avg-ferst-cherry 1 1 10 MONITOR 323 533 373 574 17 station-wait-minutes-avg-nanotech-bld 1 1 10 MONITOR 375 533 425 574 18 station-wait-minutes-avg-ferst-state 1 1 10 MONITOR 427 533 477 574 19 station-wait-minutes-avg-challenge-course 1 1 10 SWITCH 754 109 904 142 output-csv-file output-csv-file 1 1 -1000 @#$#@#$#@ 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 sheep false 0 Rectangle -7500403 true true 151 225 180 285 Rectangle -7500403 true true 47 225 75 285 Rectangle -7500403 true true 15 75 210 225 Circle -7500403 true true 135 75 150 Circle -16777216 true false 165 76 116 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 4.1.2 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@