globals [ unit_time ;incrementation of built-in NetLogo units for expressing total time of simulation time_of_simulation ;total time in hours (not real one), given for a specified number of built-in units per one hour of simulation one_hour ;in procedure "setup" there is an assignment of how many built-in units is equivalent to one hour one_minute ;in procedure "setup" there is an assignment of how many built-in units is equivalent to one minute one_day ;in procedure "setup" there is an assignment of how many built-in units is equivalent to one day time_day ;in procedure "time" a number of the total simulation days is written to this variable actual_day_unit ;incrementation of built-in units for an actual hour (variable is set to zero when a day is over) actual_day_hour ;in procedure "time" an actual number of simulation hours is written to this variable actual_day_unit_minute ;incrementation of built-in units for an actual minute (variable is set to zero when an hour is over) actual_day_minute ;in procedure "time" an actual number of simulation minutes is written to the variable No_of_cars_to_East No_of_trucks_to_East ;Number of cars/trucks in EAST direction, once a simulation day is over the variable remains unchaged No_of_cars_to_West No_of_trucks_to_West ;Number of cars/trucks in WEST direction, once a simulation day is over the variable remains unchaged freq freq< ;variable that is being compared with the following variable "Time-interval" and road vehicles are generated based on match Time-interval Time-interval< congestion-we congestion-ew ;determines how many road vehicles have not been generated (in this case the result is not output to monitor window) MaxSpeed MaxSpeed< ;variable used to set maximum speed of road vehicles choose-vehicleWE choose-vehicleEW ;variable used to choose between a car and a truck randomly generationF ;if the variable is set to the value 1, the good wagons for a freight train are generated behind the locomotive (0 for no generating) generationP ;if the variable is set to the value 1, the passenger wagons are generated for a pasenger train behind the locomotive (0 for no generating) generationFS ;the same as above, but for a special (extra generated) freight train generationPS ;the same as above, but for a special (extra generated) passenger train freight-train ;variable used to detect what kind of rail vehicle is actually the line (due to function of Approach Time Predictor - for different speeds) passenger-train ;variable used to detect what kind of rail vehicle is actually at the line (due to function of Approach Time Predictor - for different speeds) occupancy delta_t ;coefficient used to multiply a train speed counter-wagonsF ;these four variables record a number of wagons (of a freight train (F), passenger train (P), specially generated freight train (FS) or specially counter-wagonsP ;generated passenger train (PS)); if value becomes equivalent to the required number, the variable (F,P,FS,PS) is given the value zero counter-wagonsFS counter-wagonsPS no_of_passenger_trains ;in procedure "move-for-train" a number of passenger wagons/day is written to this variable no_of_freight_trains ;in procedure "move-for-train" a number of goods wagons/day is written to this variable blinkA ;variable used to set interval for "active signalling" (white flashing light) blinkW ;variable used to set interval for the warning state of level crossing tcb ;warning time to close barriers (time from the moment of warning activation to the moment when barriers start going down) A ;approach section, by default value="vacant" B ;annulation section, by default value="vacant" C ;distant section, by default value="vacant" timeATPr ;variable is incremented after the approach section A has been occupied ativation-point-ATPr ;if variable becomes equivalent o value 1, warning state is activated at the level crossing (delay depends on train speed) carsE ;drawing road vehicles at the certain hour, reset of variable occurs when hour is over trucksE carsW trucksW value all-cars ;summing of variables mentioned above, necessary for drawing histograms all-trucks all-vehicles top_intensity ;variable reports the highest achieved value via reporter moment valueI ;value of lapses (time intervals) between road vehicle arrivals resetting ;variable used to reset values of "no_of_passenger_trains" a "no_of_freight_trains" ] breed [rail] breed [rail1] ;rails over road breed [obstacle-EW] breed [obstacle-WE] breed [ST240] ;ST means "signalling table", situated 240 m prior to the level crossing breed [ST160] ;signalling table situated 160 m prior to the level crossing breed [ST80] ;signalling table situated 80 m prior to the level crossing breed [cars-WE] ;cars going from west to east breed [trucks-WE] ;trucks going from west to east breed [cars-EW] ;cars going from east to west breed [trucks-EW] ;trucks going from east to west breed [wsignal] ;warning signal - here alternatively flashing red light breed [rail-signal] ;rail signal - here 2 yellow position lights + 1 white light (being on or off) breed [barriers-EW] ;barriers for direction East-West breed [barriers-WE] ;barriers for direction West-East breed [trainF] ;freight train breed [wagonF] ;wagon of freight train breed [trainP] ;passenger train breed [wagonP] ;wagon of passenger train breed [state-of-wsignal-EW] ;state of the warning signal (information for road users going from East to West) breed [state-of-wsignal-WE] ;state of the warning signal (information for road users going from West to East) breed [state-of-rsignal] ;state of the rail signal (information for train crew) cars-WE-own [speed accel?] trucks-WE-own [speed accel?] cars-EW-own [speed< accel?<] trucks-EW-own [speed< accel?<] ;------------------------------------------------------------------------------------------ ; PART 1 SETUP ;------------------------------------------------------------------------------------------ to setup reset-timer ca crt 1 ;turtle used to draw road communication (curves) set actual_day_unit 0 set actual_day_unit_minute 0 set one_hour 8417 ;all what is needed - to define how many time unit create one hour and one day mentioned below ;shortened simulation 20; ; and in procedure “time“ all times in model are re-calculated automatically set one_day 202008 ;shortened simulation 480; set one_minute one_hour / 60 set No_of_trucks_to_West 0 set No_of_cars_to_West 0 set No_of_cars_to_East 0 set No_of_trucks_to_East 0 set time_of_simulation 0 set delta_t 0.003 set freq 0 set freq< 0 set generationF 0 set counter-wagonsP 0 set-default-shape ST240 "signal table 240m" set-default-shape ST160 "signal table 160m" set-default-shape ST80 "signal table 80m" set-default-shape cars-WE "car0" set-default-shape trucks-WE "carn01" set-default-shape cars-EW "car<" set-default-shape trucks-EW "carn<" set-default-shape rail "rail3" set-default-shape rail1 "rail4" set-default-shape trainF "locomotive1"; definition of turtle for a passenger train set-default-shape wagonF "freight car" set-default-shape trainP "locomotive2"; definition of turtle for a freight train set-default-shape wagonP "coach" set-default-shape wsignal "warning signal" set-default-shape rail-signal"rail signal" set-default-shape barriers-WE "barriers" set-default-shape barriers-EW "barriers" set-default-shape state-of-wsignal-EW "black point" set-default-shape state-of-wsignal-WE "black point" set-default-shape state-of-rsignal "black point" curve background centerline STs rails wsignals rail-signal-draw end ;------------------------------------------------------------------------------------------- ; PART 2 DRAWING ROAD CURVE (LEFT AND RIGHT) ;------------------------------------------------------------------------------------------- to curve ask turtles [set heading 90 part1] ask turtles [set heading 10 part2] ask turtles [set heading 90 track] end to part1 setxy ( -1 * max-pxcor + 34 ) (-1 * max-pycor + 5 ) set pen-size 39 set color black pd repeat 7 [fd 1.16 lt 12 ] pu end to part2 setxy 0 8 set pen-size 39 set color black pd repeat 7 [fd 1.15 rt 12] pu end to track setxy 10.5 -13 ;drawing of the track set pen-size 1.5 set shape "squareR" set color 38 pd repeat 2 [fd 15] pu setxy 10.5 -12.9; use of two lines one alongside of another set pen-size 1.5 set shape "squareR" set color 38 pd repeat 2 [fd 15] pu end to background ask patches [ set pcolor green if ((pxcor < -4 and pycor < -10) and (pxcor < -4 and pycor >= -15 )) ;access road from the left [ set pcolor black ] if ((pxcor > 4 and pycor > 10) and (pxcor > 4 and pycor <= 15 )) ;access road from the right [ set pcolor black ] if ( (pxcor >= -2 and pycor < 9 )and (pxcor <= 2 and pycor > -9 )) ;road directly to the top (section will be grey) [ set pcolor gray ] if ( (pxcor >= -2 and pycor > 2 ) and (pxcor <= 2 and pycor <= 8 )) ;re-draw the curve from the bottom [ set pcolor black ] if ( (pxcor >= -2 and pycor < -2 ) and (pxcor <= 2 and pycor >= -8 )) ;re-draw the curve from the top [ set pcolor black ] if ((pxcor > 10 and pycor >= -18) and (pxcor > 10 and pycor <= -7 )) ;monitor window [ set pcolor black ] if ((pxcor > 10 and pycor > -14) and (pxcor < 24 and pycor < -12 ))[set pcolor gray ] ;technical means TP1 if ((pxcor >= 25 and pycor > -14) and (pxcor < 29 and pycor < -12 ))[set pcolor gray ] ;technical means TP2 if ((pxcor >= 30 and pycor > -14) and (pxcor <= 40 and pycor < -12 ))[set pcolor gray ];technical means TP3 ] end ;------------------------------------------------------------------------------------------- ; PART 3 DEFINITION OF THE HALF-WAY LINE ;------------------------------------------------------------------------------------------- to centerline ask turtles [set heading 90 part3] ask turtles [set heading 80 part4] ask turtles [set heading 10 part5] ask turtles [set heading 90 part6] end to part3 setxy -40.4 -13 set pen-size 1 set shape "point" set color white pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd end to part4 setxy ( -1 * max-pxcor + 35 ) (-1 * max-pycor + 5 ) set pen-size 1.5 set shape "point" set color white pd repeat 7 [fd 1.13 lt 12] end to part5 setxy 0 8 set pen-size 1.5 set shape "point" set color white pd repeat 7 [fd 1.12 rt 12] pu end to part6 setxy 5 13 set pen-size 1 set shape "point" set color white pd repeat 11 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu repeat 1 [fd 1 ] pd repeat 1 [fd 1 ] pu end ;------------------------------------------------------------------------------------------- ; PART 4 DRAWING RAILS ;------------------------------------------------------------------------------------------- to rails create-custom-rail 25 [ setxy min-pxcor + 1.2 0 set heading 90 set size 3 non-overlapping1 ] create-custom-rail1 4 [ set color gray + 1 setxy -1.5 0 set heading 90 set size 3 non-overlapping1 ] create-custom-rail 25 [ setxy 4.2 0 set heading 90 set size 3 non-overlapping1 ] end to non-overlapping1 if any? other-turtles-here [ fd 1.5 non-overlapping1 ] end ;------------------------------------------------------------------------------------------- ; PART 5 DRAWING OF SIGNAL TABLES FOR ROAD USERS & DRAWING OF WARNING AND RAIL SIGNALS ;------------------------------------------------------------------------------------------- to STs; drawing signal tables for road communication create-custom-ST240 1 [setxy -6 -16.2 set heading 90 set size 5 ] create-custom-ST160 1 [setxy 0.5 -14 set heading 50 set size 5 ] create-custom-ST80 1 [setxy 3.2 -8 set heading 0 set size 5 ] create-custom-ST240 1 [setxy 6 16.2 set heading 270 set size 5 ] create-custom-ST160 1 [setxy -0.5 14 set heading 230 set size 5 ] create-custom-ST80 1 [setxy -3.2 8 set heading 180 set size 5 ] end to wsignals ;custom turtle "wsignal" is defined inside setup, ;it remembers its position all the time therefore it is not necessary to use Ask create-custom-wsignal 1 [setxy 5 -3 set heading 0 set size 4 ] create-custom-wsignal 1 [setxy -5 3 set heading 180 set size 4 ] create-obstacle-EW 1 ask obstacle-EW [setxy -9 6 set shape "x" set color green set size 1] ;turtle "obstacle" is also created inside setup, ;it changes its position during the warning period and avoid vehicles from enterring the rails area create-obstacle-WE 1 ask obstacle-WE [setxy 9 -6 set shape "x" set color green set size 1] create-barriers-WE 1 ask barriers-WE [setxy 3.5 0 set heading 90 set size 6 ] create-barriers-EW 1 ask barriers-EW [setxy -3.5 0 set heading 270 set size 6 ] create-custom-state-of-wsignal-WE 1 [setxy 5 -3.3 set size 4.6 set color black] ;creation of the signal sign "black" at the place of active signalling create-custom-state-of-wsignal-EW 1 [setxy -5 3.3 set size 4.6 set color black] ;this signal will be drawn accoring to the state of the level crossing end to rail-signal-draw ;drawing the rail signal create-custom-rail-signal 1 [setxy -38 -2.5 set heading 90 set size 4.3] create-custom-state-of-rsignal 1 [setxy -36.90 -2.45 set size 4.5 set color black] end ;------------------------------------------------------------------------------------------- ; PART 6 THE MAIN BODY OF THE PROGRAMME ;------------------------------------------------------------------------------------------- to Simulation Simulation/step end ;using the procedure "Simulation/step" all required procedures are called ;these procedures are performed during the entire running of the programme to Simulation/step time occupancy-check wagons-newF wagons-newP wagons-newF-special wagons-newP-special time-table arrival-hour move-for-train set-speed-of-vehicles CCM set freq freq + 1 if freq > Time-interval [new-vehicles cycle set freq 0 set choose-vehicleWE random 3 ] movement turning set freq< freq< + 1 if freq< > Time-interval< [new-vehicles< cycle< set freq< 0 set choose-vehicleEW random 3] movement< turning< set-variables end ;------------------------------------------------------------------------------------------- ; PART 7 PROCEDURES USED TO BOLT BARRIERS ;------------------------------------------------------------------------------------------- to barriers ask obstacle-EW [setxy -1.5 3.5 set shape "x" set size 1 set color black] ask obstacle-WE [setxy 1.5 -3.5 set shape "x" set size 1 set color black] set tcb tcb + 1 if tcb = 50 [ask barriers-WE [setxy 0.8 -2.8 set heading 0 set size 6 ] ;turtle generated in setup using procedure wsignals ask barriers-EW [setxy -0.8 2.8 set heading 180 set size 6 ]set tcb 0] end to barriersUP ask barriers-WE [setxy 3.5 0 set heading 90 set size 6 ] ;turtle generated in setup using procedure wsignals ask barriers-EW [setxy -3.5 0 set heading 270 set size 6 ] ask obstacle-EW [setxy -9 6 set shape "x" set size 1 set color green] ask obstacle-WE [setxy 9 -6 set shape "x" set size 1 set color green] end ;------------------------------------------------------------------------------------------- ; PART 8 USE OF APPROACH TIME PREDICTOR ATPr OR ITS ABSENCE ;------------------------------------------------------------------------------------------- to CCM ; central control module contains (un)selection of ATPr ;the following conditions define states of all three sections (A,B,C) ifelse ((any? wagonF with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < -4 and ycor = 0.5) ] ) or (any? wagonP with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < -4 and ycor = 0.5) ] ) or (any? trainF with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < -4 and ycor = 0.5) ] ) or (any? trainP with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < -4 and ycor = 0.5) ] )) [set A "occupied"] [set A "vacant"] ifelse ((any? wagonF with [ (pxcor > -4 and ycor = 0.5) and (pxcor < 7 and ycor = 0.5) ] ) or (any? wagonP with [ (pxcor > -4 and ycor = 0.5) and (pxcor < 7 and ycor = 0.5) ] ) or (any? trainF with [ (pxcor > -4 and ycor = 0.5) and (pxcor < 7 and ycor = 0.5) ] ) or (any? trainP with [ (pxcor > -4 and ycor = 0.5) and (pxcor < 7 and ycor = 0.5) ] ) ) [set B "occupied"] [set B "vacant"] ifelse ((any? wagonF with [ (pxcor > 7 and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? wagonP with [ (pxcor > 7 and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? trainF with [ (pxcor > 7 and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? trainP with [ (pxcor > 7 and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] )) [set C "occupied"] [set C "vacant"] use-of-ATPr ;call of procedure given below end to use-of-ATPr if (Yes/No = "YES")[ATPr-yes] if (Yes/No = "NO")[ATPr-no] end to ATPr-no ;fulfilling of the following conditions enables to choose one of three states of the level crossing system used in this model if (A = "occupied" or B = "occupied") [warning-state] if (A = "vacant" and B = "vacant" and C = "occupied") [annulation-state] if (A = "vacant" and B = "vacant" and C = "vacant") [basic-state] ;fulfilment of the following conditions make possible visualization of train movement in bottom right-hand corner of the dispaly window ifelse A = "occupied" [ask patches with [((pxcor > 10 and pycor > -14) and (pxcor < 24 and pycor < -12 ))][ set pcolor red ]] [ask patches with [((pxcor > 10 and pycor > -14) and (pxcor < 24 and pycor < -12 ))][ set pcolor gray ]] ifelse B = "occupied" [ask patches with [((pxcor >= 25 and pycor > -14)and (pxcor < 29 and pycor < -12 ))][ set pcolor red ]] [ask patches with [((pxcor >= 25 and pycor > -14)and (pxcor < 29 and pycor < -12 ))][ set pcolor gray ]] ifelse C = "occupied" [ask patches with [((pxcor >= 30 and pycor > -14)and (pxcor <= 40 and pycor < -12 ))][ set pcolor red ]] [ask patches with [((pxcor >= 30 and pycor > -14)and (pxcor <= 40 and pycor < -12 ))][ set pcolor gray ]] end to ATPr-yes if A = "occupied" [set timeATPr timeATPr + 1 ] if (freight-train = 1 and (((For_Freight_Train = 10 )and timeATPr = 1136 - 71)or ((For_Freight_Train = 20 )and timeATPr = 568 - 71) or ((For_Freight_Train = 30 )and timeATPr = 378 - 71) or ((For_Freight_Train = 40 )and timeATPr = 284 - 71) or ((For_Freight_Train = 50 )and timeATPr = 227 - 71) or ((For_Freight_Train = 60 )and timeATPr = 189 - 71) or ((For_Freight_Train = 70 )and timeATPr = 162 - 71) or ((For_Freight_Train = 80 )and timeATPr = 142 - 71) or ((For_Freight_Train = 90 )and timeATPr = 126 - 71) or ((For_Freight_Train = 100 )and timeATPr = 113 - 71) or ((For_Freight_Train = 110 )and timeATPr = 103 - 71) or ((For_Freight_Train = 120 )and timeATPr = 94 - 71) or ((For_Freight_Train = 130 )and timeATPr = 87 - 71) or ((For_Freight_Train = 140 )and timeATPr = 81 - 71) or ((For_Freight_Train = 150 )and timeATPr = 75 - 71) or ((For_Freight_Train = 160 )and timeATPr = 5)));speed of freight train in interface is max 80, ;however here it is processed for all speeds [set ativation-point-ATPr 1] if (passenger-train = 1 and (((For_Passenger_Train = 10 )and timeATPr = 1136 - 71)or ((For_Passenger_Train = 20 )and timeATPr = 568 - 71) or ((For_Passenger_Train = 30 )and timeATPr = 378 - 71) or ((For_Passenger_Train = 40 )and timeATPr = 284 - 71) or ((For_Passenger_Train = 50 )and timeATPr = 227 - 71) or ((For_Passenger_Train = 60 )and timeATPr = 189 - 71) or ((For_Passenger_Train = 70 )and timeATPr = 162 - 71) or ((For_Passenger_Train = 80 )and timeATPr = 142 - 71) or ((For_Passenger_Train = 90 )and timeATPr = 126 - 71) or ((For_Passenger_Train = 100 )and timeATPr = 113 - 71) or ((For_Passenger_Train = 110 )and timeATPr = 103 - 71) or ((For_Passenger_Train = 120 )and timeATPr = 94 - 71) or ((For_Passenger_Train = 130 )and timeATPr = 87 - 71) or ((For_Passenger_Train = 140 )and timeATPr = 81 - 71) or ((For_Passenger_Train = 150 )and timeATPr = 75 - 71) or ((For_Passenger_Train = 160 )and timeATPr = 1))) [set ativation-point-ATPr 1] ;fulfilment of the following conditions make possible visualization of train movement in bottom right-hand corner of the dispaly window if(freight-train = 1 and For_Freight_Train = 160 and timeATPr >= 1)or (passenger-train = 1 and For_Passenger_Train = 160 and timeATPr >= 1 )[ask (patch 11 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 150 and timeATPr >= 75 - 71)or (passenger-train = 1 and For_Passenger_Train = 150 and timeATPr >= 75 - 71 )[ask (patch 11 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 140 and timeATPr >= 81 - 71)or (passenger-train = 1 and For_Passenger_Train = 140 and timeATPr >= 81 - 71 )[ask (patch 12 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 130 and timeATPr >= 87 - 71)or (passenger-train = 1 and For_Passenger_Train = 130 and timeATPr >= 87 - 71 )[ask (patch 13 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 120 and timeATPr >= 94 - 71)or (passenger-train = 1 and For_Passenger_Train = 120 and timeATPr >= 94 - 71 )[ask (patch 14 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 110 and timeATPr >= 103 - 71)or (passenger-train = 1 and For_Passenger_Train = 110 and timeATPr >= 103 - 71 )[ask (patch 15 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 100 and timeATPr >= 113 - 71)or (passenger-train = 1 and For_Passenger_Train = 100 and timeATPr >= 113 - 71 )[ask (patch 16 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 90 and timeATPr >= 126 - 71)or (passenger-train = 1 and For_Passenger_Train = 90 and timeATPr >= 126 - 71 )[ask (patch 15 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 80 and timeATPr >= 142 - 71)or (passenger-train = 1 and For_Passenger_Train = 80 and timeATPr >= 142 - 71 )[ask (patch 17 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 70 and timeATPr >= 162 - 71)or (passenger-train = 1 and For_Passenger_Train = 70 and timeATPr >= 162 - 71 )[ask (patch 17 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 60 and timeATPr >= 189 - 71)or (passenger-train = 1 and For_Passenger_Train = 60 and timeATPr >= 189 - 71 )[ask (patch 18 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 50 and timeATPr >= 227 - 71)or (passenger-train = 1 and For_Passenger_Train = 50 and timeATPr >= 227 - 71 )[ask (patch 19 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 40 and timeATPr >= 284 - 71)or (passenger-train = 1 and For_Passenger_Train = 40 and timeATPr >= 284 - 71 )[ask (patch 20 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 30 and timeATPr >= 378 - 71)or (passenger-train = 1 and For_Passenger_Train = 30 and timeATPr >= 378 - 71 )[ask (patch 21 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 20 and timeATPr >= 568 - 71)or (passenger-train = 1 and For_Passenger_Train = 20 and timeATPr >= 568 - 71 )[ask (patch 21 -13) [set pcolor red ]] if(freight-train = 1 and For_Freight_Train = 10 and timeATPr >= 1136 - 71)or (passenger-train = 1 and For_Passenger_Train = 10 and timeATPr >= 1136 - 71 )[ask (patch 22 -13) [set pcolor red ]] if ativation-point-ATPr = 1 [warning-state] if (A = "vacant" and B = "vacant" and C = "occupied") [annulation-state ] if (ativation-point-ATPr = 0 and B = "vacant" and C = "vacant") [basic-state] ifelse B = "occupied" [ask patches with [((pxcor >= 25 and pycor > -14)and (pxcor < 29 and pycor < -12 ))][ set pcolor red ]] [ask patches with [((pxcor >= 25 and pycor > -14)and (pxcor < 29 and pycor < -12 ))][ set pcolor gray ]] ifelse C = "occupied" [ask patches with [((pxcor >= 30 and pycor > -14)and (pxcor <= 40 and pycor < -12 ))][ set pcolor red ]] [ask patches with [((pxcor >= 30 and pycor > -14)and (pxcor <= 40 and pycor < -12 ))][ set pcolor gray ]] end ;------------------------------------------------------------------------------------------- ; PART 9 ACTIVE SIGNALLING, WARNING ACTIVATION, WARNING TERMINATION ;------------------------------------------------------------------------------------------- ;Note: so called "active signalling" is represented by one white flashing light to basic-state set tcb 0 set blinkA blinkA + 1 if blinkA = 20 [ask state-of-wsignal-WE [setxy 5 -3.3 set size 4.6 set color white ] ask state-of-wsignal-EW [setxy -5 3.3 set size 4.6 set color white ] ] if blinkA = 40 [ask state-of-wsignal-WE [setxy 5 -3.3 set size 4.6 set color black set blinkA 0 ] ask state-of-wsignal-EW [setxy -5 3.3 set size 4.6 set color black set blinkA 0 ] ] ask state-of-rsignal [setxy -36.90 -2.45 set size 4.5 set color white] ;relation Level Crossing - Rail Signal end to warning-state if (blinkA >= 20 and blinkA <= 40) [ask state-of-wsignal-WE [set color black ] ;condition deactivates active signalling after occupying A ask state-of-wsignal-EW [set color black ] set blinkA 0 set blinkW 18 ] set blinkW blinkW + 1 ;variable blink is used for both active signalling and warning signalling if blinkW = 20 [ask state-of-wsignal-WE [setxy 4.4 -2.5 set size 4.8 set color red beep beep beep] ask state-of-wsignal-EW [setxy -4.6 2.6 set size 4.8 set color red ]] if blinkW = 40 [ask state-of-wsignal-WE [setxy 5.5 -2.5 set size 4.8 set color red set blinkW 0 ] ask state-of-wsignal-EW [setxy -5.7 2.6 set size 4.8 set color red set blinkW 0 ] ] barriers ask state-of-rsignal [setxy -36.90 -2.45 set size 4.5 set color white] ;relation Level Crossing - Rail Signal end to annulation-state set timeATPr 0 set ativation-point-ATPr 0 set tcb 0 ask state-of-wsignal-WE [set color black ] ask state-of-wsignal-EW [set color black ] ask patches with [((pxcor > 10 and pycor > -14) and (pxcor < 24 and pycor < -12 ))][ set pcolor gray ] barriersUP ask state-of-rsignal [setxy -36.90 -2.45 set size 4.5 set color white] ;relation Level Crossing - Rail Signal end ;------------------------------------------------------------------------------------------- ; PART 10 GENERATING OF FREIGHT AND PASSENGER TRAINS ;------------------------------------------------------------------------------------------- to occupancy-check ;after occupying the track (here particular patches) te variable "occupancy " is set to "1" ;this variable can be used in any procedure, where we need to test if a train is or is not ;in the monitored part of the railway line ifelse ((any? wagonF with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? wagonP with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? trainF with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] ) or (any? trainP with [ (pxcor > min-pxcor and ycor = 0.5) and (pxcor < max-pxcor and ycor = 0.5) ] )) [set occupancy 1] [set occupancy 0] end to generated-F-train create-custom-trainF 1 [set color white setxy -39 0.5 set size 4 set heading 90 set generationF 1 set freight-train 1] ; end to wagons-newF ;procedure ensures generating of freight wagons (freight cars) following the locomotive if not (((any? wagonF-at min-pxcor 0.5) or (any? wagonF-at (min-pxcor + 1) 0.5) or (any? wagonF-at (min-pxcor + 2) 0.5) or (any? wagonF-at (min-pxcor + 3) 0.5) or(any? wagonF-at (min-pxcor + 3.49) 0.5) or (any? trainF-at min-pxcor 0.5) or (any? trainF-at (min-pxcor + 1) 0.5) or (any? trainF-at (min-pxcor + 2) 0.5) or (any? trainF-at (min-pxcor + 3) 0.5) or(any? trainF-at (min-pxcor + 3.5) 0.5)) or generationF = 0 or Freight-cars = 0) [create-custom-wagonF 1 [ set color white setxy -39 0.5 set size 3.3 set heading 90 set counter-wagonsF counter-wagonsF + 1 ]] if counter-wagonsF = Freight-cars [set generationF 0 set counter-wagonsF 0] if (occupancy = 0 ) [set freight-train 0] end to generated-P-train create-custom-trainP 1 [set color white setxy -39 0.5 set size 3.55 set heading 90 set generationP 1 set passenger-train 1 ] end to wagons-newP ;procedure ensures generating of passenger wagons (coaches) following the locomotive if not (((any? wagonP-at min-pxcor 0.5) or (any? wagonP-at (min-pxcor + 1) 0.5) or (any? wagonP-at (min-pxcor + 2) 0.5) or (any? wagonP-at (min-pxcor + 3) 0.5) or(any? wagonP-at (min-pxcor + 3.49) 0.5) or (any? trainP-at min-pxcor 0.5) or (any? trainP-at (min-pxcor + 1) 0.5) or (any? trainP-at (min-pxcor + 2) 0.5) or (any? trainP-at (min-pxcor + 3) 0.5) or(any? trainP-at (min-pxcor + 3.5) 0.5)) or generationP = 0 or Coaches = 0) [create-custom-wagonP 1 [ set color white setxy -39 0.5 set size 3.5 set heading 90 set counter-wagonsP counter-wagonsP + 1 ]] if counter-wagonsP = Coaches[set generationP 0 set counter-wagonsP 0] if (occupancy = 0 ) [set passenger-train 0] end to move-for-train ask trainF [ fd (For_Freight_Train * delta_t) ] ask wagonF [ fd (For_Freight_Train * delta_t) ] ask trainF [ if xcor > max-pxcor - 0.8 [set no_of_freight_trains no_of_freight_trains + 1 die ]] ask wagonF [ if xcor > max-pxcor - 0.8 [ die ]] ask trainP [ fd (For_Passenger_Train * delta_t) ] ask wagonP [ fd (For_Passenger_Train * delta_t) ] ask trainP [ if xcor > max-pxcor - 1 [ set no_of_passenger_trains no_of_passenger_trains + 1 die]] ask wagonP [ if xcor > max-pxcor - 1 [ die ]] end ;------------------------------------------------------------------------------------------- ; PART 11 GENERATING OF THE SPECIAL TRAIN ;------------------------------------------------------------------------------------------- to special-train ifelse occupancy = 1 [user-message "There is a rail vehicle at the line and required train cannot be dispatched. Check actual time of simulation and compare it with train time-table. To continue simulation press OK - to stop simulation press HALT. " stop] [if Train = "freight" [generated-F-train-special] if Train = "passenger" [generated-P-train-special] ] end to generated-F-train-special create-custom-trainF 1 [set color white setxy -39 0.5 set size 4 set heading 90 set generationFS 1 set freight-train 1] end to wagons-newF-special ;procedure ensures generating of freight wagons (freight cars) following the locomotive if not (((any? wagonF-at min-pxcor 0.5) or (any? wagonF-at (min-pxcor + 1) 0.5) or (any? wagonF-at (min-pxcor + 2) 0.5) or (any? wagonF-at (min-pxcor + 3) 0.5) or(any? wagonF-at (min-pxcor + 3.49) 0.5) or (any? trainF-at min-pxcor 0.5) or (any? trainF-at (min-pxcor + 1) 0.5) or (any? trainF-at (min-pxcor + 2) 0.5) or (any? trainF-at (min-pxcor + 3) 0.5) or(any? trainF-at (min-pxcor + 3.5) 0.5)) or generationFS = 0 or Number_of_Wagons = 0) [create-custom-wagonF 1 [ set color white setxy -39 0.5 set size 3.3 set heading 90 set counter-wagonsFS counter-wagonsFS + 1 ]] if counter-wagonsFS = Number_of_Wagons [set generationFS 0 set counter-wagonsFS 0] end to generated-P-train-special create-custom-trainP 1 [set color white setxy -39 0.5 set size 3.55 set heading 90 set generationPS 1 set passenger-train 1] end to wagons-newP-special ;procedure ensures generating of passenger wagons following the locomotive if not (((any? wagonP-at min-pxcor 0.5) or (any? wagonP-at (min-pxcor + 1) 0.5) or (any? wagonP-at (min-pxcor + 2) 0.5) or (any? wagonP-at (min-pxcor + 3) 0.5) or(any? wagonP-at (min-pxcor + 3.49) 0.5) or (any? trainP-at min-pxcor 0.5) or (any? trainP-at (min-pxcor + 1) 0.5) or (any? trainP-at (min-pxcor + 2) 0.5) or (any? trainP-at (min-pxcor + 3) 0.5) or(any? trainP-at (min-pxcor + 3.5) 0.5)) or generationPS = 0 or Number_of_Wagons = 0) [create-custom-wagonP 1 [ set color white setxy -39 0.5 set size 3.5 set heading 90 set counter-wagonsPS counter-wagonsPS + 1 ]] if counter-wagonsPS = Number_of_Wagons [set generationPS 0 set counter-wagonsPS 0] end ;------------------------------------------------------------------------------------------- ; PART 12 PROCEDURE USED TO SET TIME-TABLE ;------------------------------------------------------------------------------------------- to time-table if (==TGT== = "====1====")[tgt-1] if (==TGT== = "====2====" )[tgt-2] end to tgt-1 if ((((int actual_day_hour = 0 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 1 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 3 )and ((actual_day_minute >= 0)and(actual_day_minute <= 1)))and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 23 ) and ((actual_day_minute >= 45)and(actual_day_minute <= 46)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] ;freight trains in time-table TGT1 if ((((int actual_day_hour = 4 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 5 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 6 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 8 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 10 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 12 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 14 ) and ((actual_day_minute >= 40)and(actual_day_minute <= 41)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 16 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 18 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] if ((((int actual_day_hour = 20 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 160] ;speed trains (passenger trains) in time-table TGT1 if ((((int actual_day_hour = 5 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)))and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 6 ) and ((actual_day_minute >= 15)and(actual_day_minute <= 16)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 7 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 11 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 13 ) and ((actual_day_minute >= 35)and(actual_day_minute <= 36)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 14 ) and ((actual_day_minute >= 25)and(actual_day_minute <= 26)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 15 ) and ((actual_day_minute >= 40)and(actual_day_minute <= 41)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 17 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 17 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 18 ) and ((actual_day_minute >= 50)and(actual_day_minute <= 51)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 22 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] ;passenger trains in time-table TGT1 end to tgt-2 if ((((int actual_day_hour = 0 ) and ((actual_day_minute >= 50)and(actual_day_minute <= 51)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 2 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 3 )and ((actual_day_minute >= 30)and(actual_day_minute <= 31)))and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 5 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 9 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 12 ) and ((actual_day_minute >= 5)and(actual_day_minute <= 6)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 13 )and ((actual_day_minute >= 30)and(actual_day_minute <= 31)))and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 17 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 18 )and ((actual_day_minute >= 30)and(actual_day_minute <= 31)))and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 19 ) and ((actual_day_minute >= 50)and(actual_day_minute <= 51)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 21 )and ((actual_day_minute >= 10)and(actual_day_minute <= 11)))and occupancy = 0)) [generated-F-train set For_Freight_Train 80] if ((((int actual_day_hour = 23 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-F-train set For_Freight_Train 80] ;freight trains in time-table TGT2 if ((((int actual_day_hour = 4 ) and ((actual_day_minute >= 10)and(actual_day_minute <= 11)))and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 5 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 6 ) and ((actual_day_minute >= 30)and(actual_day_minute <= 31)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 10 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 14 ) and ((actual_day_minute >= 0)and(actual_day_minute <= 1)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] if ((((int actual_day_hour = 19 ) and ((actual_day_minute >= 50)and(actual_day_minute <= 51)) )and occupancy = 0)) [generated-P-train set For_Passenger_Train 100] end ;------------------------------------------------------------------------------------------- ; PART 13 TIME PROCEDURES ;------------------------------------------------------------------------------------------- to time set resetting time_day if (int resetting) + 0.002 >= resetting [clear-all-plots set no_of_passenger_trains 0 set no_of_freight_trains 0 set top_intensity 0 set resetting 0] set unit_time unit_time + 1 set actual_day_unit_minute actual_day_unit_minute + 1 set actual_day_unit actual_day_unit + 1 set time_of_simulation ( unit_time / one_hour ) ;total time in hours (not real time) given for chosen number of units in one simulation hour set time_day ( unit_time / one_day ) ;sets total number of passed days set actual_day_minute (actual_day_unit_minute / one_minute ) set actual_day_hour (actual_day_unit / one_hour) if actual_day_minute >= 60 [do-plot set carsE 0 set trucksE 0 set carsW 0 set trucksW 0 set actual_day_unit_minute 0 set actual_day_minute 0] ;60 is in minutes (not real but for the given model) if actual_day_hour >= 24 [set actual_day_hour 0 set actual_day_unit 0 calculate-results ] ;24 is in hours (not real but for the given model) end ;------------------------------------------------------------------------------------------- ; PART 14. MOVEMENT FOR ROAD VEHICLES IN BOTH DIRECTIONS ;------------------------------------------------------------------------------------------- to set-speed-of-vehicles set MaxSpeed ((MAX_SPEED / 1000) * 1.5) set MaxSpeed< ((MAX-SPEED / 1000) * 1.5) end to movement ask cars-WE[ if xcor > max-pxcor - 1 [set No_of_cars_to_East No_of_cars_to_East + 1 set carsE carsE + 1 die ] set accel? true if (any? cars-WE-at 0 1) or (any? cars-WE-at 0 2) or (any? cars-WE-at 0 3)or (any? cars-WE-at 0.5 1) or (any? cars-WE-at 0.5 2) or (any? cars-WE-at 0.5 3)or (any? cars-WE-at 3 2) or (any? cars-WE-at 3 1) or (any? cars-WE-at 3 0.5) or (any? cars-WE-at 3 0)or (any? cars-WE-at 2 2) or (any? cars-WE-at 2 1) or (any? cars-WE-at 2 0.5) or (any? cars-WE-at 2 0)or (any? cars-WE-at 1 2) or (any? cars-WE-at 1 1) or (any? cars-WE-at 1 0.5) or (any? cars-WE-at 1 0)or ;reporters used to stop a car behind the truck follow (any? trucks-WE-at 0 1) or (any? trucks-WE-at 0 2) or (any? trucks-WE-at 0 3)or (any? trucks-WE-at 0.5 1) or (any? trucks-WE-at 0.5 2) or (any? trucks-WE-at 0.5 3)or ;always takes these reportes. If the barrier goes down immediately in front of the car, then condition is not ;fulfilled any more since distance < 3 and reporters given below are used (any? trucks-WE-at 3 2) or (any? trucks-WE-at 3 1) or (any? trucks-WE-at 3 0.5) or (any? trucks-WE-at 3 0)or (any? trucks-WE-at 2 2) or (any? trucks-WE-at 2 1) or (any? trucks-WE-at 2 0.5) or (any? trucks-WE-at 2 0)or (any? trucks-WE-at 1 2) or (any? trucks-WE-at 1 1) or (any? trucks-WE-at 1 0.5) or (any? trucks-WE-at 1 0)or (any? obstacle-WE-at 0 1) or (any? obstacle-WE-at 0 2)or(any? obstacle-WE-at 0.5 1)or (any? obstacle-WE-at 0.5 2) [set speed 0 set accel? false] ;if at least one condition of those given above following if is fulfilled, cars will stop (zero speed) if (any? cars-WE-at 4 0) or ;slowing-down of 4patch prior to next car and car "looks" only directly ahead it (any? trucks-WE-at 4 0) or (any? cars-WE-at 4 0.5) or ;slowing-down of 4patch to next car and “looks“ also from -14.5 to 14, usually uses intervals 0.5 (any? trucks-WE-at 4 0.5)or (any? cars-WE-at 4 1) or (any? trucks-WE-at 4 1)or (any? obstacle-WE-at 0.5 3);condition for slowing cars ahead truck in front of barriers too [set speed 0.01 set accel? false] if accel? [speed-up] ;nasledujúca procedúra musí byť uvedená ako podmienka nasledujúceho príkazu "fd speed" lebo inak vozidlá nebudú spomalovať if xcor > -6 and xcor < 2 and ycor < 2 [ set speed speed / 3] fd speed ] ask trucks-WE[ if xcor > max-pxcor - 1 [set No_of_trucks_to_East No_of_trucks_to_East + 1 set trucksE trucksE + 1 die ] set accel? true if (any? trucks-WE-at 0 1) or (any? trucks-WE-at 0 2) or (any? trucks-WE-at 0 3)or (any? trucks-WE-at 0.5 1) or(any? trucks-WE-at 0.5 2) or (any? trucks-WE-at 0.5 3)or (any? trucks-WE-at 3 2) or (any? trucks-WE-at 3 1) or (any? trucks-WE-at 3 0.5) or (any? trucks-WE-at 3 0)or (any? trucks-WE-at 2 2) or (any? trucks-WE-at 2 1) or (any? trucks-WE-at 2 0.5) or (any? trucks-WE-at 2 0)or (any? trucks-WE-at 1 2) or (any? trucks-WE-at 1 1) or (any? trucks-WE-at 1 0.5) or (any? trucks-WE-at 1 0 )or ;nasleduju reportery pouziti na zastavenie nakladneho pred osobnym (any? cars-WE-at 0 1) or (any? cars-WE-at 0 2) or (any? cars-WE-at 0 3)or (any? cars-WE-at 0.5 1) or (any? cars-WE-at 0.5 2) or (any? cars-WE-at 0.5 3)or (any? cars-WE-at 3 2) or (any? cars-WE-at 3 1) or (any? cars-WE-at 3 0.5) or (any? cars-WE-at 3 0)or (any? cars-WE-at 2 2) or (any? cars-WE-at 2 1) or (any? cars-WE-at 2 0.5) or (any? cars-WE-at 2 0)or (any? cars-WE-at 1 2) or (any? cars-WE-at 1 1) or (any? cars-WE-at 1 0.5) or (any? cars-WE-at 1 0)or (any? obstacle-WE-at 0.5 1)or (any? obstacle-WE-at 0.5 2) ;úplné zastavenie pred závorou vo vzdialenosti 1 [set speed 0 set accel? false] if (any? trucks-WE-at 4 0)or;spomalovanie pred autami a aj pred zavorami pocas vystrahy (any? cars-WE-at 4 0) or (any? trucks-WE-at 4 0.5)or (any? cars-WE-at 4 0.5) or (any? trucks-WE-at 4 1)or (any? cars-WE-at 4 1) or (any? obstacle-WE-at 0.5 3) [set speed 0.01 set accel? false] if accel? [speed-up] if xcor > -6 and xcor < 2 and ycor < 2 [ set speed speed / 3 ] fd speed ] end to speed-up ifelse (speed >= MaxSpeed) [set speed MaxSpeed fd speed] ;ak je rýchlosť väčšia, alebo rovná ako zadaná rýchlosť ;zo slideru "RYCHLOST_MAX" potom nastaví "speed" na hodnotu ;ktorá je na slideri čiže spomalí (obmedzenie rýchlosti) [set speed speed + 0.07 fd speed];ak je rýchlosť menšia potom vozidlo zrýchľuje krokom 0.07 end to movement< ask cars-EW[ if xcor < 0 + min-pxcor + 1 [set No_of_cars_to_West No_of_cars_to_West + 1 set carsW carsW + 1 die ] set accel?< true if (any? cars-EW-at 0.5 -1) or (any? cars-EW-at 0.5 -2) or (any? cars-EW-at 0.5 -3)or (any? cars-EW-at -3 -2) or (any? cars-EW-at -3 -1) or (any? cars-EW-at -3 -0.5) or (any? cars-EW-at -3 0)or (any? cars-EW-at -2 -2) or (any? cars-EW-at -2 -1) or (any? cars-EW-at -2 -0.5) or (any? cars-EW-at -2 0)or (any? cars-EW-at -1 -2) or (any? cars-EW-at -1 -1) or (any? cars-EW-at -1 -0.5) or (any? cars-EW-at -1 0)or ;nasleduju reportery pouzity na zastavenie osobneho pred nakladnym v smere Vychod-Zapad (any? trucks-EW-at 0.5 -1)or (any? trucks-EW-at 0.5 -2) or (any? trucks-EW-at 0.5 -3)or (any? trucks-EW-at -3 -2) or (any? trucks-EW-at -3 -1) or (any? trucks-EW-at -3 -0.5) or (any? trucks-EW-at -3 0) or (any? trucks-EW-at -2 -2) or (any? trucks-EW-at -2 -1) or (any? trucks-EW-at -2 -0.5) or (any? trucks-EW-at -2 0) or (any? trucks-EW-at -1 -2) or (any? trucks-EW-at -1 -1) or (any? trucks-EW-at -1 -0.5) or (any? trucks-EW-at -1 0) or (any? obstacle-EW-at 0.5 -1) or (any? obstacle-EW-at 0.5 -2)or(any? obstacle-EW-at 0 -1)or (any? obstacle-EW-at 0 -2);zastavenie pred priecestím, ak je PZZ vo výstražnom stave [set speed< 0 set accel?< false] if (any? cars-EW-at -4 0)or;spomalovanie (any? trucks-EW-at -4 0)or (any? cars-EW-at -4 -0.5)or (any? trucks-EW-at -4 -0.5)or (any? cars-EW-at -4 -4)or (any? trucks-EW-at -4 -1)or (any? obstacle-EW-at 0.5 -3) [set speed< 0.01 set accel?< false] if accel?< [speed-up<] if xcor < 6 and xcor > -2 and ycor > -2 [ set speed< speed< / 3 ] fd speed< ] ask trucks-EW[ if xcor < 0 + min-pxcor + 1 [set No_of_trucks_to_West No_of_trucks_to_West + 1 set trucksW trucksW + 1 die ] set accel?< true if (any? trucks-EW-at 0.5 -1)or (any? trucks-EW-at 0.5 -2) or (any? trucks-EW-at 0.5 -3)or (any? trucks-EW-at -3 -2) or (any? trucks-EW-at -3 -1) or (any? trucks-EW-at -3 -0.5) or (any? trucks-EW-at -3 0) or (any? trucks-EW-at -2 -2) or (any? trucks-EW-at -2 -1) or (any? trucks-EW-at -2 -0.5) or (any? trucks-EW-at -2 0) or (any? trucks-EW-at -1 -2) or (any? trucks-EW-at -1 -1) or (any? trucks-EW-at -1 -0.5) or (any? trucks-EW-at -1 0) or (any? cars-EW-at 0.5 -1) or (any? cars-EW-at 0.5 -2) or (any? cars-EW-at 0.5 -3)or (any? cars-EW-at -3 -2) or (any? cars-EW-at -3 -1) or (any? cars-EW-at -3 -0.5) or (any? cars-EW-at -3 0)or (any? cars-EW-at -2 -2) or (any? cars-EW-at -2 -1) or (any? cars-EW-at -2 -0.5) or (any? cars-EW-at -2 0)or (any? cars-EW-at -1 -2) or (any? cars-EW-at -1 -1) or (any? cars-EW-at -1 -0.5) or (any? cars-EW-at -1 0)or (any? obstacle-EW-at 0.5 -1) or (any? obstacle-EW-at 0.5 -2)or(any? obstacle-EW-at 0 -1) or (any? obstacle-EW-at 0 -2);stopping in front of level crossing if there is the warning state there [set speed< 0 set accel?< false] if (any? cars-EW-at -4 0)or;spomalovanie (any? trucks-EW-at -4 0)or (any? cars-EW-at -4 -0.5)or (any? trucks-EW-at -4 -0.5)or (any? cars-EW-at -4 -4)or (any? trucks-EW-at -4 -1)or (any? obstacle-EW-at 0.5 -3) [set speed< 0.01 set accel?< false] if accel?< [speed-up<] if xcor < 6 and xcor > -2 and ycor > -2 [ set speed< speed< / 3 ] fd speed< ] end to speed-up< ifelse (speed< >= MaxSpeed<) [set speed< MaxSpeed< fd speed<] ;if the speed is higher or equivalent to the value of defined speed ;then the speed will be taken from the slider "MAX-SPEED, i.e. ;the speed becomes reduced [set speed< speed< + 0.07 fd speed<] ;if the speed is lower that vehicle speeds up with the step 0.07 end ;------------------------------------------------------------------------------------------- ; PART 15 VEHICLES' FOLLOWING THE TRAJECTORY ;------------------------------------------------------------------------------------------- to turning< ask turtles [ if (distancexy 3.0800 14 ) < 0.5 [ set heading 260 ] if (distancexy 2.9310 13.8857) < 0.5 [ set heading 250 ] if (distancexy 1.6865 13.3565) < 0.5 [ set heading 240 ] if (distancexy 0.7027 12.8073) < 0.5 [ set heading 230 ] if (distancexy -0.7027 11.6843) < 0.5 [ set heading 220 ] if (distancexy -0.5909 11.3840) < 0.5 [ set heading 210 ] if (distancexy -0.8998 10.6863) < 0.5 [ set heading 200 ] if (distancexy -1.1149 9.8569) < 0.5 [ set heading 190 ] if (distancexy -1.3622 7.9842) < 0.5 [ set heading 180 ] ;from the right to the left - direction "270=>180" if (distancexy -1.2806 -8.7548) < 0.5[ set heading 190 ] if (distancexy -1.3785 -9.4042) < 0.5 [ set heading 200 ] if (distancexy -1.4591 -9.6735) < 0.5 [ set heading 210 ] if (distancexy -1.6323 -10.0060) < 0.5 [ set heading 220 ] if (distancexy -1.9210 -10.3755) < 0.5 [ set heading 230 ] if (distancexy -2.2694 -10.6892) < 0.5 [ set heading 240 ] if (distancexy -3.5068 -11.0681) < 0.5 [ set heading 250 ] if (distancexy -4.3714 -11.7142) < 0.5 [ set heading 260 ] if (distancexy -5.5706 -11.9423) < 0.7 [ set heading 270 ]] ;from the right to the left - directon "180=>270" end to turning ask turtles [ if (distancexy -5 -14.5) < 0.5 [ set heading 80 ] if (distancexy -3.500 -14.326) < 1 [ set heading 70 ] if (distancexy -2.0653 -13.4594) < 1 [ set heading 60 ] if (distancexy -0.5396 -12.3938) < 0.5 [ set heading 50] if (distancexy 0.2693 -11.6316) < 0.5 [ set heading 40 ] if (distancexy 1.0518 -10.5996) < 0.5 [ set heading 30 ] if (distancexy 1.3673 -9.9254) < 0.5 [ set heading 20 ] if (distancexy 1.4979 -9.3796) < 0.5 [ set heading 10 ] if (distancexy 1.7235 -7.7321) < 1 [ set heading 0 ] ;from the left to the right - direction "0" if (distancexy 1.4771 8.5448) < 0.5[ set heading 20 ] if (distancexy 2.1492 9.6967) < 0.5 [ set heading 30 ] if (distancexy 2.4152 10.6007) < 0.5 [ set heading 40 ] if (distancexy 3.2354 11.0406) < 0.5 [ set heading 60 ] if (distancexy 3.4108 11.0380) < 0.5 [ set heading 70 ] if (distancexy 4.2060 11.4650) < 0.5 [ set heading 90 ]] ;from the left to the right - direction "90" end ;------------------------------------------------------------------------------------------- ; PART 16 GENERATING ROAD VEHICLES FOR BOTH DIRECTIONS ;------------------------------------------------------------------------------------------- to new-vehicles ;vehicles in direction EAST if (East = "cars")[cars] ;choose of the car using the chooser if (East = "trucks")[trucks] if (East = "cars/trucks")[cars-trucks] end to cars let my-colors [ 15 35 45 55 97] ifelse ((any? cars-WE-at min-pxcor -14.5) or (any? cars-WE-at (min-pxcor + 1) -14.5)or(any? cars-WE-at (min-pxcor + 2) -14.5))or ((any? trucks-WE-at min-pxcor -14.5)or(any? trucks-WE-at (min-pxcor + 1) -14.5)or(any? trucks-WE-at(min-pxcor + 2) -14.5)) [set congestion-we congestion-we + 1] [create-custom-cars-WE 1 [set heading 90 set size 1.4 setxy -39.5 -14.5 set speed 0 set color one-of my-colors]] end to trucks let my-colors [ 15 35 45 55 97 ] ifelse ((any? trucks-WE-at min-pxcor -14.5)or(any? trucks-WE-at (min-pxcor + 1) -14.5)or(any? trucks-WE-at(min-pxcor + 2) -14.5)) or((any? cars-WE-at min-pxcor -14.5) or (any? cars-WE-at (min-pxcor + 1) -14.5)or(any? cars-WE-at (min-pxcor + 2) -14.5)) [set congestion-we congestion-we + 1] [create-custom-trucks-WE 1 [set heading 90 set size 2 setxy -39.5 -14.5 set speed 0 set color one-of my-colors]] end to cars-trucks if (choose-vehicleWE <= 1) [cars] if (choose-vehicleWE = 2) [trucks] end to new-vehicles< ;nove auta v smere Západ if (West = "cars")[cars<];vyber auta pomocou chooseru if (West = "trucks")[trucks<] if (West = "cars/trucks")[cars-trucks<] end to cars< let my-colors [ 15 35 45 55 97] ifelse ((any? cars-EW-at max-pxcor 14) or (any? cars-EW-at (max-pxcor - 1) 14)or(any? cars-WE-at (max-pxcor - 2) 14))or ((any? trucks-EW-at max-pxcor 14)or(any? trucks-EW-at (max-pxcor - 1) 14)or(any? trucks-EW-at(min-pxcor - 2) 14)) [set congestion-ew congestion-ew + 1] [create-custom-cars-EW 1 [set heading 270 set size 1.4 setxy 39 14 set speed< 0 set color one-of my-colors]] end to trucks< let my-colors [ 15 35 45 55 97] ifelse ((any? trucks-EW-at max-pxcor 14)or(any? trucks-EW-at (max-pxcor - 1) 14)or(any? trucks-EW-at(min-pxcor - 2) 14)) or((any? cars-EW-at max-pxcor 14) or (any? cars-EW-at (max-pxcor - 1) 14)or(any? cars-WE-at (max-pxcor - 2) 14)) [set congestion-ew congestion-ew + 1] [create-custom-trucks-EW 1 [set heading 270 set size 2 setxy 39 14 set speed< 0 set color one-of my-colors]] end to cars-trucks< if (choose-vehicleEW <= 1) [cars<] if (choose-vehicleEW = 2) [trucks<] end ;------------------------------------------------------------------------------------------- ; PART 17 PROCESURES FOR DETERMINING OF REGULAR OR OCCASSIONAL ARRIVAL OF VEHICLE ;------------------------------------------------------------------------------------------- to arrival-hour if actual_day_hour < 5.5 [set valueI 7000] if actual_day_hour = 5.5 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 5.5)and(actual_day_hour < 6.5)) [set valueI 100] if actual_day_hour = 6.5 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 6.5)and(actual_day_hour < 8.5)) [set valueI 70] if actual_day_hour = 8.5 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 8.5)and(actual_day_hour < 13.5)) [set valueI 400] if actual_day_hour = 13.5 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 13.5)and(actual_day_hour < 15.5)) [set valueI 70] if actual_day_hour = 15.5 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 15.5)and(actual_day_hour < 20)) [set valueI 400] if actual_day_hour = 20 [set Time-interval 0 set Time-interval< 0] if ((actual_day_hour > 20)and(actual_day_hour < 23)) [set valueI 1500] if actual_day_hour = 23 [set Time-interval 0 set Time-interval< 0] end to cycle if (Vehicle_arrival = "regular")[regular] if (Vehicle_arrival = "occasional" )[occasional] end to occasional set Time-interval random-exponential valueI ;setting of time interval between arrival of vehicles, ;in this case according to "quasi" poisson distribution end to regular set Time-interval _interval_ end to cycle< if (Vehicle-arrival = "regular")[regular<] if (Vehicle-arrival = "occasional" )[occasional<] end to occasional< set Time-interval< random-exponential valueI ;setting of time interval between arrival of vehicles, ;in this case according to "quasi" poisson distribution end to regular< set Time-interval< -interval- end ;------------------------------------------------------------------------------------------- ; PART 18 PROCEDURES FOR DRAWING HISTOGRAMS AND SETTING VARIABLES FOR DRAWING ;------------------------------------------------------------------------------------------- to do-plot set-current-plot "Histogram of Intensities of Real Vehicles/Hour" set-plot-x-range 0 24 set-current-plot-pen "Cars" plot all-cars set-current-plot-pen "Trucks" plot all-trucks set-current-plot-pen "Total" plot all-cars + all-trucks set-current-plot "Histogram of intensities of Unit Vehicles/Hour" set-plot-x-range 0 24 set-current-plot-pen "UnitVehs" plot all-vehicles end to set-variables set all-cars (carsE + carsW) set all-trucks (trucksE + trucksW) set all-vehicles (all-cars + (all-trucks * 2)) if top_intensity < all-vehicles [set top_intensity all-vehicles] set moment ((10 * top_intensity)*(no_of_freight_trains + no_of_passenger_trains )) end to calculate-results export-all-plots "d:/histogram.csv" user-message "Actual simulation day is over. Calculated traffic moment is "+ moment + ". Press HALT and record all monitored quantities. Values from histograms were exported to the file d:/histogram.csv To continue simulation of the next day press again Simulation. " stop end @#$#@#$#@ GRAPHICS-WINDOW 331 28 989 355 40 18 8.0 1 15 1 1 1 0 1 1 1 -40 40 -18 18 CC-WINDOW 5 717 1273 812 Command Center 0 BUTTON 605 377 732 419 Setup setup\n NIL 1 T OBSERVER T NIL BUTTON 605 424 729 463 Simulation Simulation\n T 1 T OBSERVER T NIL SLIDER 90 170 236 203 MAX_SPEED MAX_SPEED 50 130 70 10 1 km/h BUTTON 605 472 730 511 Step Simulation Simulation/step NIL 1 T OBSERVER T NIL CHOOSER 13 112 112 157 East East "cars" "trucks" "cars/trucks" 2 TEXTBOX 32 91 186 109 Vehicle Types and Arrival: \n \n TEXTBOX 935 10 1055 28 EAST => TEXTBOX 337 10 449 28 <= WEST\n CHOOSER 117 112 210 157 Vehicle_arrival Vehicle_arrival "regular" "occasional" 0 SLIDER 220 124 312 157 _interval_ _interval_ 0 500 60 10 1 NIL CHOOSER 16 266 113 311 West West "cars" "trucks" "cars/trucks" 2 CHOOSER 117 266 212 311 Vehicle-arrival Vehicle-arrival "regular" "occasional" 1 SLIDER 221 277 315 310 -interval- -interval- 0 500 150 10 1 NIL SLIDER 94 322 238 355 MAX-SPEED MAX-SPEED 50 140 130 1 1 Km/h TEXTBOX 72 68 282 86 INITIATION FOR EAST DIRECTION\n TEXTBOX 217 90 315 116 Interval for regular\n vehicle arrival: TEXTBOX 15 202 328 220 ======================================= TEXTBOX 81 219 275 237 INITIATION FOR WEST DIRECTION TEXTBOX 14 356 327 374 ======================================= TEXTBOX 36 244 172 262 Vehicle Types and Arrival: TEXTBOX 220 245 317 272 Interval for regular\n vehicle arrival: MONITOR 36 394 115 443 Cars No_of_cars_to_East 3 1 MONITOR 114 394 193 443 Trucks No_of_trucks_to_East 3 1 MONITOR 457 388 582 437 Hours of Simulation int (time_of_simulation) 4 1 MONITOR 336 55 419 104 Real minutes timer / 60 1 1 TEXTBOX 1071 159 1194 187 SETTING FOR TRAINS CHOOSER 1002 96 1105 141 ==TGT== ==TGT== "====1====" "====2====" "====3====" 1 TEXTBOX 1004 59 1121 89 Train Graphic Timetable (TGT) MONITOR 324 467 452 516 Hours of Actual Day int actual_day_hour 1 1 TEXTBOX 378 367 578 385 Total Running of Simulation: MONITOR 454 467 582 516 Minutes of Actual Day actual_day_minute 1 1 TEXTBOX 398 448 535 466 Actual Day Simulation: SLIDER 999 272 1146 305 For_Freight_Train For_Freight_Train 0 80 80 10 1 NIL TEXTBOX 1167 297 1224 328 Maximum Line Speed SLIDER 1000 311 1147 344 For_Passenger_Train For_Passenger_Train 0 160 100 10 1 NIL TEXTBOX 1180 173 1243 201 PASSENGER\n TEXTBOX 1033 174 1087 192 FREIGHT TEXTBOX 1085 186 1183 214 Number of Wagons SLIDER 1133 205 1242 238 Coaches Coaches 0 15 10 1 1 NIL SLIDER 995 205 1117 238 Freight-cars Freight-cars 0 20 10 1 1 NIL CHOOSER 1037 407 1129 452 Train Train "passenger" "freight" 1 BUTTON 1129 407 1224 452 Generate Train special-train NIL 1 T OBSERVER T NIL TEXTBOX 1039 387 1229 406 A New Train Not Included in TGT: SLIDER 1037 453 1224 486 Number_of_Wagons Number_of_Wagons 0 50 6 1 1 NIL TEXTBOX 1023 533 1264 551 ========================== TEXTBOX 998 143 1251 161 ============================== TEXTBOX 1001 347 1249 365 -------------------------------------------------------------- TEXTBOX 998 251 1250 269 ------------------------------------------------------------- MONITOR 761 418 828 467 State of A A 1 1 MONITOR 843 418 906 467 State of B B 1 1 MONITOR 917 418 979 467 State of C C 1 1 MONITOR 416 55 549 104 Time [built-in units] unit_time 3 1 CHOOSER 1139 96 1242 141 Yes/No Yes/No "YES" "NO" 1 TEXTBOX 1133 58 1256 88 Use of Approaching Time Predictor (ATPr)\n TEXTBOX 113 10 213 66 ===========\n Road Traffic \n=========== TEXTBOX 16 48 331 66 ======================================= TEXTBOX 1068 10 1191 47 =============\n Railway Traffic \n============= MONITOR 192 394 279 443 Total Number No_of_cars_to_East + No_of_trucks_to_East 3 1 TEXTBOX 45 375 293 394 Number of Vehicles Passed in EAST Direction: MONITOR 40 480 119 529 Cars No_of_cars_to_West 3 1 MONITOR 118 480 197 529 Trucks No_of_trucks_to_West 3 1 MONITOR 196 480 283 529 Total Number No_of_cars_to_West + No_of_trucks_to_West 3 1 TEXTBOX 48 460 295 479 Number of Vehicles Passed in WEST Direction: PLOT 297 536 656 703 Histogram of Intensities of Real Vehicles/Hour Number of Hours Number of Vehicles 0.0 24.0 0.0 50.0 true true PENS "Cars" 1.0 1 -5825686 true "Trucks" 1.0 1 -13345367 true "Total" 1.0 1 -16777216 true PLOT 655 536 1014 703 Histogram of intensities of Unit Vehicles/Hour Number of Hours Number of Vehicles 0.0 24.0 0.0 50.0 true true PENS "UnitVehs" 1.0 1 -7500403 true MONITOR 794 474 942 523 Intensity of Rush Hour/Day top_intensity 3 1 TEXTBOX 86 543 252 561 Number of All Passed Vehicles: MONITOR 41 562 119 611 Cars No_of_cars_to_West + No_of_cars_to_East 3 1 MONITOR 118 562 195 611 Trucks No_of_trucks_to_West + No_of_trucks_to_East 3 1 MONITOR 194 562 281 611 Total Number (No_of_cars_to_West + No_of_cars_to_East)+\n(No_of_trucks_to_West + No_of_trucks_to_East) 3 1 TEXTBOX 76 633 247 651 Number of Passed Unit Vehicles: MONITOR 37 651 115 700 Cars No_of_cars_to_West + No_of_cars_to_East 3 1 MONITOR 114 651 191 700 Trucks (No_of_trucks_to_West + No_of_trucks_to_East) * 2 3 1 MONITOR 190 651 277 700 Total Number (No_of_cars_to_West + No_of_cars_to_East)+\n((No_of_trucks_to_West + No_of_trucks_to_East) * 2) 3 1 TEXTBOX 768 360 836 416 ^\nApproach\n Section\n A MONITOR 1041 574 1139 623 Passenger Trains no_of_passenger_trains 3 1 MONITOR 1093 628 1202 677 Total Trains no_of_passenger_trains + no_of_freight_trains 3 1 TEXTBOX 1114 553 1212 571 Trains Per Day: MONITOR 1144 574 1232 623 Freight Trains no_of_freight_trains 3 1 MONITOR 327 388 454 437 Days of Simulation int time_day 3 1 TEXTBOX 579 10 754 29 LEVEL CROSSING ver. 2.1 TEXTBOX 850 359 915 415 ^\nAnnulation\n Section\n B TEXTBOX 943 359 1010 415 ^\nDistant\nSection\n C @#$#@#$#@ WHAT IS IT? ----------- It is a multi-agent model of the level crossing system (ver. 2.1). Its ancestor (ver.1.1) was uploaded as a community model in late 2005. This essentially improved version was created to have more realistic graphic representation and implement some new functions. The model also makes possible to model traffic flows and make evaluation based on one "simulation day". HOW IT WORKS? ------------ 1) At the beginning it is necessary to make all required settings using sliders and choosers for: ROAD TRAFFIC (speed, kind of road vehicles, arrival interval) and RAILWAY TRAFFIC (train time table, approaching time predictor, speed, number of wagons, kind of train); 2) Then pressing the button "Setup" makes initiation of the model; 3) Simulation itself can be started by pressing the button "Simulation" or "Simulation/step" (in that case repeated pressing of the button "Simulation/step" is required). HOW TO USE IT ---------------- Road vehicles are generated separately for East->West and West->East direction based on used settings. Trains are generated either using one of three train time-tables or by pressing the button "Generate Train" for generation of an extra train. Only one train may be generated and situated at the line. THINGS TO NOTICE ---------------- - drawing histograms showing intensities of road traffic after one hour of simulation; - displayng the states of particular track sections (approach section, annulation section, distant section) in the right-hand bottom corner of two-dimensional world; the way of displaying how the approach section becomes occupied is different and depends on the use of Approaching Time Predictor (ATPr) - if ATPr is used then red point located somewhere inside the approach section indicates point of activation (depending on train speed), if ATPr is not used the whole length is coloured red in the same way for all train speeds. THINGS TO TRY ------------- You may try how different settings of parameters can change a traffic flow, resulting values of intensities and finally calculate so called "traffic moment". EXTENDING THE MODEL ------------------- There are still several ideas how the model could be extended in future, e.g.: - possible choice of a higher number of rails; - choice of rail traffic direction(s); - two-way railway operation; - the way of how warning and rail signals look like and what signalling is given (different countries and different companies use different road-rail interface - present way corresponds to Slovak regulations and is very similar to other Central European countries); - choice of a different kind of protection (no barriers, half barriers, full barriers); - results evaluation not only for one day of simulation, but for a longer timer interval; - implementation of new functions defining behaviour under faulty conditions, under service mode (when maintenance is being performed) etc. NETLOGO FEATURES -------------- The model was created using NetLogo 3.1.4. Using higher versions of NetLogo may cause error messages and brings necessity to make modifications of the code to ensure troublefree running of the model in higher versions. RELATED MODELS -------------- Level crossing ver. 1.1 designed by JANOTA A. et al - this model is available as a community model at http://ccl.northwestern.edu/netlogo/models/community/Level_Crossing Designed at the University of Zilina, EF KRIS 2005 CREDITS AND REFERENCES ---------------------- Slovak version of the model (ver. 2.0) was theoretically and experimentally elaborated and tested within the MSc. thesis entitled "Multiagentovy model priecestneho zabezpecovacieho zariadenia", written (in Slovak) by Mr. Robert Kubicar under supervision of prof. Ales Janota. The thesis was successfully defended in 2007 at the Department of Control and Information Systems, Faculty of Electrical Engineering, University of Zilina (Slovakia). This version (2.1) represents the latest version - English mutation, containing other modifications and some other functions implemented. SPECIAL THANKS -------------- Sincere thanks to Robert Kubicar for his work over Slovak model of the version 2.O. Additional thanks also to Esther Verreau from the Center for Connected Learning (CCL) and Computer-Based Modeling for her time and willingness to answer his questions. More detailed description of the model, including some background explanations, will be available in the paper "JANOTA Ales, MAS Model of the Level Crossing. Journal of ITS Research, Vol. 6, No. 2, November 2008. ISSN 1348-8503", to be published in Japan. To refer to this model in academic publications, please use: "Janota, A. (2008). NetLogo Level Crossing Model 2.1 http://ccl.northwestern.edu/netlogo/models/....... (please complete link address according to the real position of the file at the server)". To reference NetLogo software in academic publications, please use: Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 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 barriers true 0 Polygon -7500403 true true 253 139 268 139 268 126 299 126 298 191 269 191 269 163 253 163 253 139 Polygon -16777216 false false 256 140 271 141 270 128 296 127 296 187 271 188 271 159 257 159 256 141 Polygon -1 true false 255 159 255 139 1 144 1 154 255 160 Polygon -2674135 true false 226 148 226 159 184 158 184 140 226 140 Polygon -2674135 true false 160 141 160 158 124 157 124 142 160 141 Polygon -2674135 true false 101 142 101 157 73 156 73 143 101 142 Polygon -7500403 true true 255 135 257 131 Circle -16777216 true false 275 143 16 Polygon -2674135 true false 48 150 48 156 21 154 21 144 48 143 black point false 0 Circle -7500403 true true 130 129 42 bod true 0 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 true 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 car0 true 0 Polygon -7500403 true true 180 0 164 21 144 39 135 60 132 74 106 87 84 97 63 115 50 141 50 165 60 225 150 300 165 300 225 300 225 0 180 0 Circle -16777216 true false 180 30 90 Circle -16777216 true false 180 180 90 Polygon -16777216 true false 80 138 78 168 135 166 135 91 105 106 96 111 89 120 Circle -7500403 true true 195 195 58 Circle -7500403 true true 195 47 58 car< true 0 Polygon -7500403 true true 120 0 136 21 156 39 165 60 168 74 194 87 216 97 237 115 250 141 250 165 240 225 150 300 135 300 75 300 75 0 120 0 Circle -16777216 true false 30 30 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 220 138 222 168 165 166 165 91 195 106 204 111 211 120 Circle -7500403 true true 47 195 58 Circle -7500403 true true 47 47 58 carn01 true 0 Rectangle -7500403 true true 45 105 187 296 Polygon -7500403 true true 193 4 150 4 134 41 104 56 104 92 194 93 Rectangle -1 true false 60 105 105 105 Polygon -16777216 true false 112 62 141 48 141 81 112 82 Circle -16777216 true false 174 24 42 Rectangle -7500403 true true 185 86 194 119 Circle -16777216 true false 174 114 42 Circle -16777216 true false 174 234 42 Circle -7500403 false true 174 234 42 Circle -7500403 false true 174 24 42 Circle -1 false false 174 134 3 Circle -6459832 false false 174 114 42 Circle -1 true false 174 234 42 Circle -1 true false 180 120 30 Circle -1 true false 175 25 40 Circle -1 true false 180 120 30 Circle -1 true false 183 125 25 Circle -1 true false 174 113 44 Polygon -13345367 true false 113 86 151 86 149 40 111 57 112 86 carn< true 0 Rectangle -7500403 true true 113 105 255 296 Polygon -7500403 true true 107 4 150 4 166 41 196 56 196 92 106 93 Rectangle -1 true false 195 105 240 105 Polygon -16777216 true false 188 62 159 48 159 81 188 82 Circle -16777216 true false 84 24 42 Rectangle -7500403 true true 106 86 115 119 Circle -16777216 true false 84 114 42 Circle -16777216 true false 84 234 42 Circle -7500403 false true 84 234 42 Circle -7500403 false true 84 24 42 Circle -1 false false 123 134 3 Circle -6459832 false false 84 114 42 Circle -1 true false 84 234 42 Circle -1 true false 90 120 30 Circle -1 true false 85 25 40 Circle -1 true false 90 120 30 Circle -1 true false 92 125 25 Circle -1 true false 82 113 44 Polygon -13345367 true false 187 86 149 86 151 40 189 57 188 86 cierny bod false 0 Circle -7500403 true true 130 129 42 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 coach false 0 Polygon -7500403 true true 15 206 15 150 15 135 30 120 270 120 285 135 285 150 285 206 270 210 30 210 Circle -16777216 true false 240 195 30 Circle -16777216 true false 210 195 30 Circle -16777216 true false 60 195 30 Circle -16777216 true false 30 195 30 Rectangle -16777216 true false 30 140 268 165 Line -7500403 true 60 135 60 165 Line -7500403 true 60 135 60 165 Line -7500403 true 90 135 90 165 Line -7500403 true 120 135 120 165 Line -7500403 true 150 135 150 165 Line -7500403 true 180 135 180 165 Line -7500403 true 210 135 210 165 Line -7500403 true 240 135 240 165 Rectangle -16777216 true false 5 195 19 207 Rectangle -16777216 true false 281 195 295 207 Rectangle -13345367 true false 15 165 285 173 Rectangle -2674135 true false 15 180 285 188 cow0 true 0 Polygon -7500403 true true 193 100 249 103 249 121 196 123 187 134 189 160 191 207 179 222 211 228 209 251 181 252 149 263 120 275 89 275 72 255 84 197 75 121 76 102 64 48 81 28 103 7 121 15 121 45 118 58 167 76 Polygon -7500403 true true 210 227 251 214 249 238 208 252 Polygon -7500403 true true 114 275 195 284 204 291 213 277 200 275 123 261 cylinder false 0 Circle -7500403 true true 0 0 300 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 freight car false 0 Circle -16777216 true false 253 195 30 Circle -16777216 true false 220 195 30 Circle -16777216 true false 50 195 30 Circle -16777216 true false 17 195 30 Rectangle -16777216 true false 105 90 135 90 Rectangle -16777216 true false 285 180 294 195 Polygon -7500403 true true 15 105 15 120 45 180 45 195 255 195 255 180 285 120 285 105 Rectangle -7500403 false true 15 105 285 195 Rectangle -16777216 true false 6 180 15 195 Polygon -7500403 true true 90 195 105 210 120 195 Polygon -7500403 true true 135 195 150 210 165 195 Polygon -7500403 true true 180 195 195 210 210 195 Polygon -16777216 false false 15 105 15 120 45 180 45 195 255 195 255 180 285 120 285 105 Line -16777216 false 60 105 60 195 Line -16777216 false 240 105 240 195 Line -16777216 false 180 105 180 195 Line -16777216 false 120 105 120 195 Polygon -6459832 true false 15 106 60 83 97 75 133 66 186 76 235 79 285 106 hnacie vozidlo1 false 0 Polygon -7500403 true true 45 210 45 180 45 150 53 130 151 123 248 131 255 150 255 195 255 210 60 210 Circle -16777216 true false 225 195 30 Circle -16777216 true false 195 195 30 Circle -16777216 true false 75 195 30 Circle -16777216 true false 45 195 30 Line -7500403 true 150 135 150 165 Rectangle -7500403 true true 120 90 180 195 Rectangle -16777216 true false 132 98 170 120 Line -7500403 true 150 90 150 150 Rectangle -16777216 false false 120 90 180 180 Rectangle -7500403 true true 30 180 270 195 Rectangle -16777216 false false 30 180 270 195 Line -16777216 false 270 150 270 180 Rectangle -1 true false 245 131 252 138 Rectangle -1 true false 48 131 55 138 Polygon -16777216 true false 255 179 227 169 227 158 255 168 Polygon -16777216 true false 255 162 227 152 227 141 255 151 Polygon -16777216 true false 45 162 73 152 73 141 45 151 Polygon -16777216 true false 45 179 73 169 73 158 45 168 Rectangle -16777216 true false 112 195 187 210 Rectangle -16777216 true false 264 180 279 195 Rectangle -16777216 true false 21 180 36 195 Line -16777216 false 30 150 30 180 Line -16777216 false 120 98 180 98 hnacie vozidlo11 false 0 Polygon -7500403 true true 23 189 16 165 16 137 16 123 154 106 274 124 274 136 274 176 261 190 63 193 Circle -16777216 true false 228 181 30 Circle -16777216 true false 190 182 30 Circle -16777216 true false 77 182 30 Circle -16777216 true false 37 181 30 Line -7500403 true 150 135 150 165 Rectangle -7500403 true true 120 74 180 179 Rectangle -16777216 true false 131 83 169 105 Line -7500403 true 150 90 150 150 Rectangle -16777216 false false 120 80 180 170 Rectangle -7500403 true true 9 163 283 177 Rectangle -16777216 false false 9 163 283 179 Line -16777216 false 238 119 238 163 Rectangle -1 true false 265 113 272 120 Rectangle -1 true false 13 115 20 122 Polygon -16777216 true false 273 161 245 151 245 140 273 150 Polygon -16777216 true false 273 142 245 132 245 121 273 131 Polygon -16777216 true false 19 141 47 131 47 120 19 130 Polygon -16777216 true false 19 161 47 151 47 140 19 150 Rectangle -16777216 true false 112 182 187 197 Rectangle -16777216 true false 259 177 274 192 Rectangle -16777216 true false 17 177 32 192 Line -16777216 false 120 108 180 108 Line -16777216 false 52 162 52 119 hnacie vozidlo2 false 0 Rectangle -7500403 true true 0 180 300 195 Polygon -7500403 true true 283 161 274 128 255 114 231 105 165 105 15 105 15 153 15 195 15 210 285 210 Circle -16777216 true false 17 195 30 Circle -16777216 true false 50 195 30 Circle -16777216 true false 220 195 30 Circle -16777216 true false 253 195 30 Rectangle -1 true false 11 111 18 118 Rectangle -1 true false 270 129 277 136 Rectangle -16777216 true false 91 195 210 210 Rectangle -16777216 true false 1 180 10 195 Line -16777216 false 290 150 291 182 Rectangle -16777216 true false 165 90 195 90 Rectangle -16777216 true false 290 180 299 195 Polygon -13345367 true false 285 180 267 158 239 135 180 120 15 120 16 113 180 113 240 120 270 135 282 154 Polygon -2674135 true false 284 179 267 160 239 139 180 127 15 127 16 120 180 120 240 127 270 142 282 161 Rectangle -16777216 true false 210 115 254 135 Line -7500403 true 225 105 225 150 Line -7500403 true 240 105 240 150 Rectangle -16777216 false false 15 197 300 178 Rectangle -7500403 true true -26 176 22 196 Rectangle -16777216 false false -17 179 9 192 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 kolajnice2 true 0 Rectangle -6459832 true false 45 240 255 285 Rectangle -6459832 true false 45 165 255 210 Rectangle -6459832 true false 45 90 255 135 Rectangle -6459832 true false 45 15 255 60 Circle -16777216 true false 61 269 8 Circle -16777216 true false 61 250 8 Circle -16777216 true false 76 269 8 Circle -16777216 true false 76 250 8 Rectangle -16777216 true false 70 3 88 298 Rectangle -16777216 true false 208 4 227 297 Circle -16777216 true false 89 269 8 Circle -16777216 true false 89 250 8 kolajnice3 true 0 Rectangle -6459832 true false 45 164 255 209 Rectangle -6459832 true false 45 239 255 284 Circle -16777216 true false 61 269 8 Circle -16777216 true false 61 250 8 Circle -16777216 true false 76 269 8 Circle -16777216 true false 76 250 8 Rectangle -16777216 true false 70 147 87 297 Circle -16777216 true false 89 269 8 Circle -16777216 true false 89 250 8 Circle -16777216 true false 62 251 6 Circle -16777216 true false 61 269 8 Rectangle -16777216 true false 215 147 232 297 Circle -16777216 true false 61 250 8 Circle -16777216 true false 60 193 8 Circle -16777216 true false 89 172 8 Circle -16777216 true false 60 172 8 Circle -16777216 true false 89 193 8 Circle -16777216 true false 234 171 8 Circle -16777216 true false 234 195 8 Circle -16777216 true false 204 172 8 Circle -16777216 true false 204 195 8 Circle -16777216 true false 204 249 8 Circle -16777216 true false 234 249 8 Circle -16777216 true false 205 270 8 Circle -16777216 true false 234 270 8 kolajnice4 true 0 Rectangle -7500403 true true 45 164 255 209 Rectangle -7500403 true true 45 239 255 284 Circle -16777216 true false 61 269 8 Circle -16777216 true false 61 250 8 Circle -16777216 true false 76 269 8 Circle -16777216 true false 76 250 8 Rectangle -16777216 true false 70 147 87 297 Circle -16777216 true false 89 269 8 Circle -16777216 true false 89 250 8 Circle -16777216 true false 62 251 6 Circle -16777216 true false 61 269 8 Rectangle -16777216 true false 215 147 232 297 Circle -16777216 true false 61 250 8 Circle -16777216 true false 60 193 8 Circle -16777216 true false 89 172 8 Circle -16777216 true false 60 172 8 Circle -16777216 true false 89 193 8 Circle -16777216 true false 204 172 8 Circle -16777216 true false 204 249 8 Circle -16777216 true false 234 196 8 Circle -16777216 true false 233 172 8 Circle -16777216 true false 205 197 8 Circle -16777216 true false 234 250 8 Circle -16777216 true false 234 271 8 Circle -16777216 true false 204 271 8 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 locomotive1 false 0 Polygon -7500403 true true 45 210 45 180 45 150 53 130 151 123 248 131 255 150 255 195 255 210 60 210 Circle -16777216 true false 225 195 30 Circle -16777216 true false 195 195 30 Circle -16777216 true false 75 195 30 Circle -16777216 true false 45 195 30 Line -7500403 true 150 135 150 165 Rectangle -7500403 true true 120 90 180 195 Rectangle -16777216 true false 132 98 170 120 Line -7500403 true 150 90 150 150 Rectangle -16777216 false false 120 90 180 180 Rectangle -7500403 true true 30 180 270 195 Rectangle -16777216 false false 30 180 270 195 Line -16777216 false 270 150 270 180 Rectangle -1 true false 245 131 252 138 Rectangle -1 true false 48 131 55 138 Polygon -16777216 true false 255 179 227 169 227 158 255 168 Polygon -16777216 true false 255 162 227 152 227 141 255 151 Polygon -16777216 true false 45 162 73 152 73 141 45 151 Polygon -16777216 true false 45 179 73 169 73 158 45 168 Rectangle -16777216 true false 112 195 187 210 Rectangle -16777216 true false 264 180 279 195 Rectangle -16777216 true false 21 180 36 195 Line -16777216 false 30 150 30 180 Line -16777216 false 120 98 180 98 locomotive2 false 0 Rectangle -7500403 true true 0 180 300 195 Polygon -7500403 true true 283 161 274 128 255 114 231 105 165 105 15 105 15 153 15 195 15 210 285 210 Circle -16777216 true false 17 195 30 Circle -16777216 true false 50 195 30 Circle -16777216 true false 220 195 30 Circle -16777216 true false 253 195 30 Rectangle -1 true false 11 111 18 118 Rectangle -1 true false 270 129 277 136 Rectangle -16777216 true false 91 195 210 210 Rectangle -16777216 true false 1 180 10 195 Line -16777216 false 290 150 291 182 Rectangle -16777216 true false 165 90 195 90 Rectangle -16777216 true false 290 180 299 195 Polygon -13345367 true false 285 180 267 158 239 135 180 120 15 120 16 113 180 113 240 120 270 135 282 154 Polygon -2674135 true false 284 179 267 160 239 139 180 127 15 127 16 120 180 120 240 127 270 142 282 161 Rectangle -16777216 true false 210 115 254 135 Line -7500403 true 225 105 225 150 Line -7500403 true 240 105 240 150 Rectangle -16777216 false false 15 197 300 178 Rectangle -7500403 true true -26 176 22 196 Rectangle -16777216 false false -17 179 9 192 nakladny vozen false 0 Circle -16777216 true false 253 195 30 Circle -16777216 true false 220 195 30 Circle -16777216 true false 50 195 30 Circle -16777216 true false 17 195 30 Rectangle -16777216 true false 105 90 135 90 Rectangle -16777216 true false 285 180 294 195 Polygon -7500403 true true 15 105 15 120 45 180 45 195 255 195 255 180 285 120 285 105 Rectangle -7500403 false true 15 105 285 195 Rectangle -16777216 true false 6 180 15 195 Polygon -7500403 true true 90 195 105 210 120 195 Polygon -7500403 true true 135 195 150 210 165 195 Polygon -7500403 true true 180 195 195 210 210 195 Polygon -16777216 false false 15 105 15 120 45 180 45 195 255 195 255 180 285 120 285 105 Line -16777216 false 60 105 60 195 Line -16777216 false 240 105 240 195 Line -16777216 false 180 105 180 195 Line -16777216 false 120 105 120 195 Polygon -6459832 true false 15 106 60 83 97 75 133 66 186 76 235 79 285 106 navestna tabula 160m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 Polygon -2674135 true false 168 147 129 169 129 176 168 154 168 148 navestna tabula 240m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 Polygon -2674135 true false 168 147 129 169 129 176 168 154 168 148 Polygon -2674135 true false 168 126 129 148 129 155 168 133 168 127 navestna tabula 80m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 osobny vozen false 0 Polygon -7500403 true true 15 206 15 150 15 135 30 120 270 120 285 135 285 150 285 206 270 210 30 210 Circle -16777216 true false 240 195 30 Circle -16777216 true false 210 195 30 Circle -16777216 true false 60 195 30 Circle -16777216 true false 30 195 30 Rectangle -16777216 true false 30 140 268 165 Line -7500403 true 60 135 60 165 Line -7500403 true 60 135 60 165 Line -7500403 true 90 135 90 165 Line -7500403 true 120 135 120 165 Line -7500403 true 150 135 150 165 Line -7500403 true 180 135 180 165 Line -7500403 true 210 135 210 165 Line -7500403 true 240 135 240 165 Rectangle -16777216 true false 5 195 19 207 Rectangle -16777216 true false 281 195 295 207 Rectangle -13345367 true false 15 165 285 173 Rectangle -2674135 true false 15 180 285 188 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 point true 0 priecestnik true 0 Polygon -16777216 true false 75 150 225 150 225 90 178 22 121 22 75 90 75 150 Rectangle -16777216 true false 138 140 157 299 Polygon -16777216 true false 136 280 175 280 194 300 105 300 123 280 164 280 Circle -7500403 false true 116 31 68 Circle -7500403 false true 161 97 50 Rectangle -16777216 true false 115 60 185 95 Circle -7500403 false true 91 97 50 Rectangle -16777216 true false 75 117 225 149 Circle -955883 true false 98 103 36 Rectangle -16777216 true false 132 86 169 100 Circle -955883 true false 169 103 36 rail signal true 0 Polygon -16777216 true false 75 150 225 150 225 90 178 22 121 22 75 90 75 150 Rectangle -16777216 true false 138 140 157 299 Polygon -16777216 true false 136 280 175 280 194 300 105 300 123 280 164 280 Circle -7500403 false true 116 31 68 Circle -7500403 false true 161 97 50 Rectangle -16777216 true false 115 60 185 95 Circle -7500403 false true 91 97 50 Rectangle -16777216 true false 75 117 225 149 Circle -1184463 true false 98 103 36 Rectangle -16777216 true false 132 86 169 100 Circle -1184463 true false 169 103 36 rail3 true 0 Rectangle -6459832 true false 45 164 255 209 Rectangle -6459832 true false 45 239 255 284 Circle -16777216 true false 61 269 8 Circle -16777216 true false 61 250 8 Circle -16777216 true false 76 269 8 Circle -16777216 true false 76 250 8 Rectangle -16777216 true false 70 147 87 297 Circle -16777216 true false 89 269 8 Circle -16777216 true false 89 250 8 Circle -16777216 true false 62 251 6 Circle -16777216 true false 61 269 8 Rectangle -16777216 true false 215 147 232 297 Circle -16777216 true false 61 250 8 Circle -16777216 true false 60 193 8 Circle -16777216 true false 89 172 8 Circle -16777216 true false 60 172 8 Circle -16777216 true false 89 193 8 Circle -16777216 true false 234 171 8 Circle -16777216 true false 234 195 8 Circle -16777216 true false 204 172 8 Circle -16777216 true false 204 195 8 Circle -16777216 true false 204 249 8 Circle -16777216 true false 234 249 8 Circle -16777216 true false 205 270 8 Circle -16777216 true false 234 270 8 rail4 true 0 Rectangle -7500403 true true 45 164 255 209 Rectangle -7500403 true true 45 239 255 284 Circle -16777216 true false 61 269 8 Circle -16777216 true false 61 250 8 Circle -16777216 true false 76 269 8 Circle -16777216 true false 76 250 8 Rectangle -16777216 true false 70 147 87 297 Circle -16777216 true false 89 269 8 Circle -16777216 true false 89 250 8 Circle -16777216 true false 62 251 6 Circle -16777216 true false 61 269 8 Rectangle -16777216 true false 215 147 232 297 Circle -16777216 true false 61 250 8 Circle -16777216 true false 60 193 8 Circle -16777216 true false 89 172 8 Circle -16777216 true false 60 172 8 Circle -16777216 true false 89 193 8 Circle -16777216 true false 204 172 8 Circle -16777216 true false 204 249 8 Circle -16777216 true false 234 196 8 Circle -16777216 true false 233 172 8 Circle -16777216 true false 205 197 8 Circle -16777216 true false 234 250 8 Circle -16777216 true false 234 271 8 Circle -16777216 true false 204 271 8 signal table 160m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 Polygon -2674135 true false 168 147 129 169 129 176 168 154 168 148 signal table 240m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 Polygon -2674135 true false 168 147 129 169 129 176 168 154 168 148 Polygon -2674135 true false 168 126 129 148 129 155 168 133 168 127 signal table 80m true 0 Rectangle -1 true false 129 97 168 200 Rectangle -16777216 true false 143 200 152 229 Rectangle -16777216 true false 137 229 159 234 Polygon -2674135 true false 168 168 129 190 129 197 168 175 168 169 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 squarer true 0 Rectangle -2674135 true false 133 136 165 165 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 stvorec true 0 Rectangle -2674135 true false 133 136 165 165 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 train false 0 Rectangle -7500403 true true 30 105 240 150 Polygon -7500403 true true 240 105 270 30 180 30 210 105 Polygon -7500403 true true 195 180 270 180 300 210 195 210 Circle -7500403 true true 0 165 90 Circle -7500403 true true 240 225 30 Circle -7500403 true true 90 165 90 Circle -7500403 true true 195 225 30 Rectangle -7500403 true true 0 30 105 150 Rectangle -16777216 true false 30 60 75 105 Polygon -7500403 true true 195 180 165 150 240 150 240 180 Rectangle -7500403 true true 135 75 165 105 Rectangle -7500403 true true 225 120 255 150 Rectangle -16777216 true false 30 203 150 218 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 cab only false 0 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 Rectangle -1 true false 291 158 300 173 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 van side false 0 Polygon -7500403 true true 26 147 18 125 36 61 161 61 177 67 195 90 242 97 262 110 273 129 260 149 Circle -16777216 true false 43 123 42 Circle -16777216 true false 194 124 42 Polygon -16777216 true false 45 68 37 95 183 96 169 69 Line -7500403 true 62 65 62 103 Line -7500403 true 115 68 120 100 Polygon -1 true false 271 127 258 126 257 114 261 109 Rectangle -16777216 true false 19 131 27 142 vystraznik jednokolajovy true 0 Polygon -16777216 true false 61 71 241 71 241 176 241 203 199 241 102 241 60 202 61 71 Rectangle -1 true false 83 213 216 237 Rectangle -16777216 true false 141 241 155 299 Polygon -16777216 true false 136 280 175 280 194 300 105 300 123 280 164 280 Rectangle -2674135 true false 92 220 208 231 Polygon -1 true false 71 69 236 18 228 0 64 52 69 69 70 69 Polygon -1 true false 75 1 240 52 232 70 68 18 73 1 74 1 Polygon -2674135 true false 80 7 230 56 228 64 78 16 80 7 Polygon -2674135 true false 224 6 74 55 76 63 226 15 224 6 Circle -7500403 false true 75 78 72 Circle -7500403 false true 160 80 70 Circle -7500403 false true 117 138 72 Rectangle -16777216 true false 71 110 241 138 Rectangle -16777216 true false 70 168 235 211 Polygon -16777216 true false 69 137 233 109 236 135 151 125 208 168 234 168 235 133 234 110 70 108 69 138 154 125 99 168 70 169 69 136 warning signal true 0 Polygon -16777216 true false 61 71 241 71 241 176 241 203 199 241 102 241 60 202 61 71 Rectangle -1 true false 83 213 216 237 Rectangle -16777216 true false 141 241 155 299 Polygon -16777216 true false 136 280 175 280 194 300 105 300 123 280 164 280 Rectangle -2674135 true false 92 220 208 231 Polygon -1 true false 71 69 236 18 228 0 64 52 69 69 70 69 Polygon -1 true false 75 1 240 52 232 70 68 18 73 1 74 1 Polygon -2674135 true false 80 7 230 56 228 64 78 16 80 7 Polygon -2674135 true false 224 6 74 55 76 63 226 15 224 6 Circle -7500403 false true 75 78 72 Circle -7500403 false true 160 80 70 Circle -7500403 false true 117 138 72 Rectangle -16777216 true false 71 110 241 138 Rectangle -16777216 true false 70 168 235 211 Polygon -16777216 true false 69 137 233 109 236 135 151 125 208 168 234 168 235 133 234 110 70 108 69 138 154 125 99 168 70 169 69 136 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 zavory true 0 Polygon -7500403 true true 253 139 268 139 268 126 299 126 298 191 269 191 269 163 253 163 253 139 Polygon -16777216 false false 256 140 271 141 270 128 296 127 296 187 271 188 271 159 257 159 256 141 Polygon -1 true false 255 159 255 139 1 144 1 154 255 160 Polygon -2674135 true false 226 148 226 159 184 158 184 140 226 140 Polygon -2674135 true false 160 141 160 158 124 157 124 142 160 141 Polygon -2674135 true false 101 142 101 157 73 156 73 143 101 142 Polygon -7500403 true true 255 135 257 131 Circle -16777216 true false 275 143 16 Polygon -2674135 true false 48 150 48 156 21 154 21 144 48 143 zavory1 true 0 Polygon -7500403 true true 253 139 268 139 268 126 299 126 298 191 269 191 269 163 253 163 253 139 Polygon -16777216 false false 256 140 271 141 270 128 296 127 296 187 271 188 271 159 257 159 256 141 Polygon -1 true false 254 161 254 139 46 146 46 153 254 162 Polygon -2674135 true false 217 140 217 161 177 159 177 141 218 140 Polygon -2674135 true false 145 141 145 158 110 156 110 143 145 143 Polygon -2674135 true false 85 144 85 155 59 154 59 145 85 145 Polygon -7500403 true true 255 135 257 131 Circle -16777216 true false 275 143 16 @#$#@#$#@ NetLogo 3.1.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@