favicon back



Op Art and More 

Swarm Behaviour -  Swarm Intelligence

Some sceneries about swarm behaviour

new - March 2024 : Arising and passing of neighborhood groups

Video

This page shows swarm behaviour with different types of individuals (boids) as two-dimensional simulations. The individuals operate by some rules like cohesion, alignment, seperation, and some more rules. Each video shows the result of different capabilities of the individuals, e.g. limited angles of sight or circumferential visibility. You will find the description of properties, rules, used geometry, and software in the documentation (in German only). Each start of a video is based upon a random distribution.

Swarm rules

The virtual creatures must must obey the following rules which are based on the swarm rules established by Craig Reynolds (separation, cohesion and alignment). The further rules introduced here like standstill rule, boundary rule or velocity rule, but also the default of extrapolation of the motion of neighbouring swarm individuals when selecting an anticipatory gradient motion of these individuals are set arbitrarily here:

Standstill rule : standstill is not allowed.

Boundary rule : avoid boundaries.

Separation : avoid collisions - (a collision is indicated in the image by a small green mark)

Neighbourhood rule : perceive neighbourhood group in the field of view

Cohesion and Alignment :

  • follow the arithmetic center of gravity of the neighborhood group

  •                    or alternatively

  • follow the direction of movement of the neighbourhood group (if the gradient option is set)

Gradient rule: when the Gradient option is selected, 50 grid lines in the direction of the gradient is specified as a fixed distance measure, which corresponds to approx. ¼ of the predefined visual range of the virtual creatures

Persistence : If none of the above rules apply, continue straight ahead in the direction of gaze and persist in this movement.

If "Speed" is activated, the following additional rules apply to the individuals, whereby the increase in speed is doubled per step.


Speed rules :

  • Increasing the speed when there is a risk of collision

  • Increasing the speed when there is free sight in front of the boid

  • Increasing the speed when the neighbour flocking group is moving with high speed

The order of the rules given here also reflects the strength of the rules. The upper rules are stronger than the lower ones.

The separation rule is implemented in an algorithm in which a grid field of 10 x 10 grids (pixels) around the individual is checked to determine whether one or more other individuals are located within this field. Towards the neighboring individual with the closest approach, a direction is then taken that leads furthest away from it. The direction of movement of the neighboring individual is also taken into account. For decision variants that allow more than 1 equivalent direction of movement, a random decision is made for the new direction to be taken. If the Speed option is activated, the speed of the individual is increased if the pixel distance is less than 3 raster elements, i.e. a second attempt is made to achieve a greater distance from the neighboring individual. If only a grid spacing of <= 1  is determined as the best solution, this is equivalent to a standstill, i.e. the standstill rule is then violated. Violations of the standstill rule are symbolized by a green mark in the image.

For a detailed description of the symbolism, see Documentation


Swarm structures - dynamics of neighborhood groups

Each boid that has contact with one or more neighbors forms a neighborhood group. A neighborhood group forms a small-scale, virtual focus in the swarm structure. The relationship between the neighbors is represented as a virtual focal point on a small scale for each boid that is in a neighborhood group. The representation of the focal points shows a different view of the swarm, as the overall structure of the swarm becomes clearer.

Within a neighborhood group, the boid uses the other boids belonging to the group for its next directional decision. The directional decision is made in accordance with the above-mentioned rules, which continue to apply with priority.

In addition to the pure focus formation, depending on the given rules, a virtual gradient of the entire neighborhood group can also be formed. The gradient shows in which direction the entire neighborhood group is likely to move in the next step. This creates a significantly greater dynamic in the swarm behavior and the individual boid now also has a projection for its own directional decision and also for its own speed.

Since neighborhood groups depend on the position, the direction of movement, the speed, the given number of members in a neighborhood group and also the all-round view of the boids as well as their visibility, there is often a dynamic emergence of new groups and the demise of existing groups.

Swarm rules - simulation movement of groups of people

When simulating movements of groups of people, a different control system was used, which did not take into account the movements and directions of movement of other Boids, but provides for fixation on a target (at the top of the image). The following swarm rules were applied to each boid in the experiments:

1. Check whether the direction of movement is pointing to the target corridor. If not, optimize the target direction (white marking).

2. If there is no obstruction, then move toward your target corridor (mark white).

3. On contact with another boid (white mark turns gray), move in an alternate direction, as long as this new direction does not point to a reversal of direction with respect to the target point.

4. Otherwise, wait a randomly selected period of time (boid marker turns black, direction indicator turns white), to let another boid pass and adjust the target direction again if necessary (i.e., rules 1, 2 and 3 are executed again).

5. If the direction towards the target corridor is blocked (still gray or black marking of the boid), then search for a free position in the following directions according to the following order:

a) first diagonally right (clockwise)
b) diagonal left
c) 900 right
d) 900 left
e) Backward movements are not allowed

alternative rule e) as another simulation variant: backward movements are allowed

When one direction is clear, resume the path (boid marker turns white again) and then start again with rule 1.

6. if no direction is free, then wait a short self-selected period of time, to let other boids pass (marker turns black, direction indicator turns white). The direction search is temporarily stopped, i.e. the now white direction indicator does not move anymore. Then apply rule 5 again.

In some trials, backward movements were allowed in congestion for rule 5e to allow the boids, to avoid an obstacle with a few steps, thus reducing or even partially dissolving congestion. If backward movements are allowed, then the swarm behavior is reminiscent of the locomotion of ants on a busy ant trail, since blockages then occur much less frequently as a result of the stronger evasive movements. With humans such a behavior is probably only rarely to be expected.

For a more detailed description of swarming behavior and the experiments to simulate swarming behavior in human groups see under Documentation (in German only).
















































































































































































































Video directory

Video 1-11 (2017) : Swarm behavior in animal groups
Video 12 (2022) : Swarm manipulation
Video N1-N2 (2024) : Dynamic of neighborhood groups
Video M1-M4 (2021) : Swarm behavior with groups of people


Swarm behavior in animal groups

Video 1  (1:23 min.):
Accumulation of spacious structures

500 boids
constant velocity
direct connection with up to 7 neighbours
visibility field 90 degree
with margin stop
short paths

Bild Index

Video 2: (0:19 min.):
Accumulation of small groups

properties as in video  1
but circumferential visability

Bild Index

Video 3: (0:38 min.):
Dynamic accumulation and splitting of swarms

500 boids
variable velocity
connection with up to 7 neighbours with gradients
circumferential visability
without margin stop
short paths

Bild Index

Video 4: (0:51 min.):
Face-to-face interaction among boids without gradients

100 boids
variable velocity
direct connection with up tp 3 neighbours
visibility field 90 degree
with margin stop
presentation of eye-contacts and number of connection among neighbours

Bild Index

Video 5: (0:49 min.):
Face-to-face interaction among boids with gradients

100 boids
variable velocity
connection with up to 7 neighbours with gradients
visibility field 90 degree
without margin stop
presentation of eye-contacts and number of connection among neighbours

Bild Index

Video 6: (1:30 min.):
Swarming cluster

2000 boids
variable velocity
direct connection with up to 30 neighbours
visibility field 90 degree
without margin stop
presentation of paths

Bild Index

Video 7: (0:37 min.):
Weak connections inside swarms

properties as in video  6
but direct connections with only 2 neighbours

Bild Index

Video 8: (0:23 min.):
Sections of swarms with high dynamic

2000 boids
variable velocity
connection with up to 7 neighbours with gradients
circumferential visability
without margin stop
presentation of paths

Bild Index

Video 9: (0:22 min.):
Swarms with more cohesion

properties as in video  8
but connection with up to 30 neighbours with gradients

Bild Index

Video 10: (0:44 min.):
Development of moving sense

250 boids
constant velocity
connection with up to 7 neighbours with gradients
visibility field 90 degree
with margin stop
accentuation of moving sense

Bild Index

Video 11: (0:43 min.):
Eye-contact of a single boid

100 boids
variable velocity
20 sec. direct connection with up to 5 neighbours
subsequent with gradients
visibility field 90 degree
with margin stop
accentuation of a single path

Bild Index


Video 12: (1:20 min.) 2022:
Manipulation of swarms

Manipulation starts after 30 seconds of runtime

blue lines: path of manipulators
white/blue dots: Position of manipulators


Number of boids: 250
Manipulators: 25%
Boid field of view: 360 Grad
Viewing distance of a boid: 200 Pixel
Running speed of a boid: variable
Direction decision of a boid: gradient rule
Size of a neighbourhood group: 30 boids

Bild Index


new - March 2024

Video 13: (0:30 min.):
Dynamic of neighborhood groups

A neighborhood group is formed by a common focus of neighbors

Neighborhood groups indicate the structure and movement of the swarm

Video N1 (0:42 min.): Swarm structure

Number of Boids: 250
Field of view of a Boid: 90 degree
Viewing distance of a Boid: 200 pixel
Running speed of a Boid: constant
Directional decision of a Boid: neighborhood rule
Size of a neighborhood group: 6 Boids

Colors:
blew: complete neighborhood group
gray: incomplete neighborhood group
red : Boid

Bild Index



Video N2: (0:31 min.):
Arising and passing of neighborhood groups

Number of Boids: 1500
Field of view of a Boid: 90 degree
Viewing distance of a Boid: 200 pixel
Running speed of a Boid: constant
Directional decision of a Boid: gradient rule
Size of a neighborhood group: 15 Boids

Colors/Symbolism:
blew: complete neighborhood group
gray: incomplete neighborhood group
green: collision detection
redt : Boid

blue or gray squares: Center of the neighborhood group
blue or gray line: target direction (gradient) of the group
Needlepoint: Target position of the neighborhood group

Bild Index



Swarm behaviour with groups of people

Video 13: (1:37 min.):
Uniform movements and disturbances due to increased number of individuals

In this simulation, up to 2000 boids (red coloring) initially migrate largely uniformly towards a target corridor without any major disturbances or obstructions. Subsequently in 3 further phases additional groups (green, orange and cyan) with likewise in each case up to 2000 boids launched from the entire bottom edge with the same target corridor. Due to the increased density and the flow to a common target corridor, there are then numerous encounters (gray marking) and congestion (black marking).

Bild Index


Video 14: (2:29 min.):
Blockade situation

Here, up to 2000 boids are supposed to migrate through a narrow target corridor, which is additionally blocked. Already in the run-up to the migration there are numerous congestions, which also propagate wave-like in the opposite direction to the target direction. As a result of the blockage at the target corridor, an extensive congestion develops, which increasingly encompasses more and more boids. After 1:50 minutes, the blockade at the target corridor is lifted, causing the boids at the target corridor can start moving again.

Bild Index


Video 15: (2:08 min.):
Crossing situation

For 2 groups with a total of up to 4000 boids (red and green), differently positioned entrance and target corridors diagonally opposite each other, so that a crossing situation for the path of the boids arises. In the crossing area and far in front of it, very quickly strongly increasing congestion. An outflow into the destination corridors occurs only slowly. Congestion at the target corridor of group 2 (green) are caused by rule 5a, which should better be replaced by an alternative swarm rule.

Bild Index


Video 16: (2:13 min.):
Congestion resolution

In this scenario, up to 2000 boids are routed to a narrowed target corridor, so that increasing congestion occurs. After 1 minute of runtime, the boids are given the possibility to execute the alternative rule for retrograde movements with rule 5e. This changes the movement behaviour of the boids massively, because in case of a blockade they they now try to avoid congestion by a short backward movement. As a consequence the jam slowly dissolves. This form of movement can also be found in ants, but there is not necessarily a jam, but rather the movement behavior of ants is more variable. Rather, the movement behavior of ants is rather variable and not uniform, so that jams are rather avoided there.

Bild Index