D. Olivier
Damien.Olivier@gmail.com
Capacités cognitives d'une communauté résultant des interactions multiples entre ses entités.
La perception des entités est locale, la réalisation est collective.
to initPatches
ask patches [
if ( random-float (( world-width * world-height) / (nbObjets * couleurs)) < 1)
[
set pcolor ( random couleurs ) * 20 + red
]
]
end
to-report compteLarvesIdem [coul]
let nb 0
ask neighbors [
if (pcolor = coul)
[set nb nb + 1]
]
report nb
end
to couvain
ask turtles [
ifelse ( color = white )
[ if ( pcolor > 0 )
[if ((compteLarvesIdem pcolor) < (random 6))
[ set color pcolor
set pcolor 0
]
]
]
[ if ( pcolor = 0 )
[
if ((compteLarvesIdem color) > (1 + random 2))
[ set pcolor color
set color white
]
]
]
set heading heading + random 45 - random 45
fd 1
]
end