Report as inappropriate.
Identical to the other Swarming Robots Showcase projects.
This project has had the BoidWorld last instantiated so the algorithm can be seen on the Greenfoot website without downloading the project.
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
Cohesion is shown with a red arrow
Alignment is shown with a blue arrow
Seperation is shown with a green arrow
Want to leave a comment? You must first log in.
2019/5/1
2019/5/1
2019/5/2