Simple flooding
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
;A. Madani ;Simulation de la diffusion aveugle : simple flooding or blind flooding; turtles-own [ nbre-copies? ;indique le nombre de copies d'un message reçu par un noeud ] to setup ca crt density ;créer plusieurs noeuds, le premier noeud doit initier l'envoi des messages ask turtles [ set xcor random-xcor * 0.98 set ycor random-ycor * 0.98 set shape "circle" set color green set nbre-copies? 0 set label nbre-copies? ] ask turtle 0 [ set nbre-copies? 1 set label nbre-copies? set color red ] creer-liens ;créer des liens entre les noeuds end ;créer des liens entre les noeuds en se basant sur le rayon de couverture : R to creer-liens ask turtles[ let i 0 let ch (other turtles with [distance myself < R]) create-links-with ch ] ergonomie end to broadcast ask-concurrent turtles with [nbre-copies? = 1] [ ask link-neighbors [ a-recu set label nbre-copies? ] ] end to go ;on quite si tous les noeuds ont été atteints, ou au moins un noeud a reçu plus que 100 copies if all? turtles [nbre-copies? != 0] [ stop ] if any? turtles with [nbre-copies? > 100] [ stop ] broadcast clear-links ;;je crois que le déplacement est inutile puisqu'on a utilisé "ergonomie" ;ask turtles [ ;fd 1 ;] creer-liens dessine-graphes ergonomie end to a-recu set nbre-copies? (nbre-copies? + 1) set color red end to ergonomie repeat 10 [ layout-spring turtles links 0.3 (world-width /(sqrt density)) 1 ] end to dessine-graphes set-current-plot "graphe" set-current-plot-pen "pen1" plot count turtles with [color = red] end
There is only one version of this model, created over 12 years ago by Abdellah Madani.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Simple flooding.png | preview | Preview for 'Simple flooding' | over 12 years ago, by Abdellah Madani | Download |
This model does not have any ancestors.
This model does not have any descendants.