This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

910995
910995 presents ...

2019/4/16

Swarming Robots Showcase

Contains 2 different swarm robotics algorithms:
- Firefly Synchronisation
- Boid Flocking

Must be run on Greenfoot and not through the website as new worlds must be initialised manually.

The pseudo-code for each firefly is as follows:

- Count from 1 to 12 repeatedly in a cycle
- When the count equals 12 flash
- If another firefly flashes when you’re not flashing then increase counter by 1


The pseudo-code for each boid is as follows:

Boid pseudocode:
move forward
update list of neighbours
set rotation to angle average of separation(), alignment(), cohesion()

function Cohesion pseudocode:
calculate direction to centre position of neighbours
return direction to centre

function Alignment pseudocode:
calculate angle average heading of neighbours
return average heading

function Separation pseudocode:
look for neighbours in a smaller radius
calculate direction to centre position of neighbours
move direction to away from centre of neighbours
Return direction away from centre

227 views / 2 in the last 7 days

Tags: simulation with-source

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2019-04-26 22:54:43 UTC Updated code
A new version of this scenario was uploaded on 2019-05-01 20:38:02 UTC
A new version of this scenario was uploaded on 2019-05-01 20:40:18 UTC

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.