Trafic BDI Scenario Simulation
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
;;; Include files for communication and BDI agents __includes ["communication.nls" "bdi.nls" "coordinates.nls" "UserAgent.nls"] globals [passengers-left passengers-on-taxis passengers-arrived crashed current-light num-cars-stopped roads intersections list-distance list-path-waypoint list-distance-path list-dist-path list-links list-all-path list-total-distance waypoint-count number-waypoint list-waypoints strating-point path previous-waypoint total-distance final-distance fp] breed [houses house] breed [ works work] breed [people-arrived person-arrived] patches-own [distance-work road street-name is-intersection? ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Setting up the Experiment ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all set current-light nobody set num-cars-stopped 0 set number cars-number + 2 set count-down 10 ;set n 2 set crashed 0 ask patches [ set road 0 set distance-work -1] setup-streets setup-cars setup-work label-patches reset-ticks end to setup-streets let px min-pxcor while [px <= max-pxcor] [ ask patches with [pxcor = px or pxcor = px + 1 or pxcor = px + 2] [set pcolor grey set road road + 1] ask patches with [pycor = px or pycor = px + 1 or pycor = px + 2] [set pcolor grey set road road + 1] ask patches with [road = 2] [set pcolor 4 set is-intersection? true set intersections intersections + 1] set px px + 8 ] end to setup-work create-works 1 [ set shape "building store" set Label "Work" set size 4 set heading 0 set color Blue setxy 15 7 ask patches with [distance myself = 0] [set pcolor green set distance-work 0 ] ] create-works 1 [ set shape "house" set Label "Home" set size 4 set heading 0 set color Blue setxy -19 -17 ] end to label-patches while [any? patches with [distance-work < 0 and road > 0] ] [setup-distances-work] end to setup-distances-work let labeled-patches patches with [distance-work >= 0] ask labeled-patches [ let dis distance-work ask neighbors4 with [distance-work < 0 and road > 0] [set distance-work dis + 1] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Running the Experiment ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to go ask cars [car-behaviour] tick end ;;; Place the turtle somewhere where there is noboby else and there is a road. to rand-xy-co-on-road let x 0 let y 0 loop [ set x random-pxcor set y random-pycor if not any? turtles-on patch-at x y and [road > 0] of patch-at x y [setxy x y stop] ] end
There is only one version of this model, created about 9 years ago by AAMAS 2017.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Trafic BDI Scenario Simulation.png | preview | Preview for 'Trafic BDI Scenario Simulation' | about 9 years ago, by AAMAS 2017 | Download |
This model does not have any ancestors.
This model does not have any descendants.