- The project requires unity version 2022.3.20f1 which can be downloaded using unity hub.
- Open the project using unity version 2022.3.20f1.
- Open the Project tab in unity.
- Open the Scenes folder and double click
WaypointsNoObstacle
orWaypointsWithObstacle
. - Under the Hierarchy tab there will be two objects,
Flock
andWaypoints
. The Flock object spawns all the boids and keeps track of them. It also has two childrenBounds
which controls the bounds of the simulation andSpawnPoint
which can be used to control where the boids will spawn from. - Clicking play will start the simulation and once all the waypoints have been reached the simulation will stop and the time taken will be logged to the console tab.
- Go to the Project tab.
- Under the Prefabs folder there will be a Boid prefab, click on it.
- In the inspector window, there will be a script component named
Boid
. - Change these variables and restart the simulation by clicking play. Note that you must restart for the changes to take effect. For testing the social and cognitive variables were varied from 0 to 1. Ensuring they both add up to 1.
- The Technique variable can be used to switch between global and individual data for the PSOP algorithm.