4.2.02. flocking simulation

BSL_GH_109_M

Loading

Date published: August 23, 2022

PROCEDURE 

1. Define the particle properties. A negative value life span means the particles won’t degenerate 
2. 
Define the rule defining agent properties of the particles including the maximum speed, force, and vision radius and angle 
3. Create a base box
4.
Define a box emitter. With the continuous flow to false, particles will only be emitted once
5. Define the box as an environment
6.
Combine the particle settings and emitters to the system component, which requires a timer component to run
7.
Use the engine component to run the system, which requires a timer component to run and a button to reset the simulation
8.
Agent rules are applied after the system. The Contain force keeps the agents to stay away from the environment boundary
9.
With the Get Neighbours component, agent rules are applied to specific particles that are located close together. This is defined by the radius and vision angle multiplier
10.
In a flocking simulation we will apply the following force:
  a.
Cohesive force to attract agents together 
  b.
Separate force to keep agents from hitting each other 
  c. Align force to let agents steer towards the same direction 
  d.
View force to let agents steer away when another agent blocks its way
11.
The Deconstruct Particle component extracts agents’ points and vectors
12.
Preview the vectors of the agents

This exercise is using Grasshopper version 1.0.0007 
References: Alex Fischer, Quelea – Agent-Based Design for Grasshopper(by lxfschr), https://www.food4rhino.com/app/quelea-agent-based-design-grasshopper, Accessed August 6, 2020.

Software

Rhino 

Plugins

course files

Flocking Simulation.zip

5.03 MB | 791 downloads