model RandomWalk
global {
bool use_wander <- true;
init {
create bug number: 10 with: [location::location];
}
}
species bug skills: [moving] {
float speed <- float(0.003);
rgb color <- rnd_color(255);
reflex RW_1 when: not use_wander {
heading <- int(360 * rnd(7)/8);
do move speed: speed;
}
reflex RW_2 when: use_wander {
do wander speed: speed ;
}
aspect default {
draw circle(2) color: color;
}
}
experiment RandomWalk type: gui {
output{
display map {
species bug;
}
}
}
--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.