Ever wondered how thousands of birds manage to coordinate and fly together in massive flocks? I certainly have. I had even more specific questions come to think of it. Does some leader bird choose the direction in which they all fly? If so, how do birds elect this leader bird (democratically I hope)!? And how often does this leader bird get overthrown?

To solve my problems, I side-stepped biology and once again landed in my preferred quantitative realm of simulations. Take a look below at the exciting simulation that I put together (adapted from the NetLogo model library).

Simulation of Birds flocking tendency from random initial positions

It’s pretty mesmerising watching the initially scattered birds, slowly but surely flocking together over time. So how do they do it? We can explain the phenomenon through something called Agent Based Modeling.

So, what is Agent Based Modeling (ABM)?

Put simply, ABM involves simulating an environment where individual agents interact amongst each other. Our aim is to assess the effect on the overall environment (aggregate results) based on the continuous interactions of these agents over time.

So how does ABM relate to the birds above? Well, we can think of each bird as an agent. This bird/agent belongs in an environment and has certain rules that help govern its actions and interactions over time. Through simulating the interactions of these agents (birds) with each other over time, we get the aggregate result of flocking, as portrayed in the simulation above.

The first point to make is that we’ve answered one of our questions already – there is no leader bird (sorry Trump)! The flocking is merely the result of the interactions of thousands of individual agents bringing out this aggregate phenomena.

So the next logical question is, what are the specific rules that govern these birds? Before you go ahead and look at them below, take another look at the simulation and try think of a few possible rules (hint: there are only 3) yourself that you think that each bird adheres to. Once you’ve given it a shot scroll down and check them below…

  1. CohesionBirds will tend to move toward other birds that are near them. Intuitively this makes sense right? Safety in numbers!
  2. Alignment Birds will tend to fly in the same direction as other birds. i.e. They turn to fly in the same direction as other birds near them. Again this makes sense right? Why not just follow the other guy!
  3. Separation Birds will turn to avoid flying into other birds too close to them. Perhaps the most straightforward, no-one likes a high speed bird collision!

That’s it. With this same set of logic adhered to by each bird, the initial random scattering of them evolves into the fascinating flocking we’ve seen above.

Going beyond just birds…

Okay, so I’m sure you thinking, what does this all have to do with the blockchain. The birds? Nothing really. Agent Based Modeling is what we are actually interested in. So how will Agent Based Modeling help with blockchain problems?

Maybe before we move from birds straight to the blockchain, lets look at ABM in the context of something less earthy, and more financial. Say, some economy. Imagine this economy had 100 firms selling and producing an identical good. These firms could invest, determine production, leverage themselves through debt (borrowing at some firm specific interest rate, dependent on the fixed policy rate and firm specific risk), accumulate profits etc…

Next, imagine we wanted to determine the effect of a change in monetary policy where a massive hike in interest rates occurred (lets say a jump from 7.5% to 10%) on the aggregate output of the economy. Instead of us relying on some macro assumption that attempts to model the effects of this aggregate change, we can turn to ABM. To reiterate, ABM is simulating lots of agents interacting in an environment in order to determine some aggregate result.

So what we do, is create an ABM. Each of the 100 firms is an agent which obeys specific rules. The process of their investments, production etc… is all programmed and well-defined. We then simulate the aggregate performance of these 100 firms over time. In the first simulation we can keep the interest rate pegged at 7.5%. In the second run, we simulate the effects of the interest rate hike at Time=500 (indicated by the dashed line).

The performance of a simulated economy with a 2.5% interest rate hike (dashed line)

The graphic above shows the horror that would technically occur if the government where to go ahead with that ridiculous interest rate hike (to give you some context, in South Africa, this rate normally moves 0.25% when adjusted). The aggregate output in the economy would promptly decline, and continue in that direction. This in stark contrast with the continued cyclical nature exhibited by the constant interest rate.

So back to blockchain…

There is no denying that we live in an increasingly complex world. Testament to this fact is the fascinating tech being researched and discovered. Blockchain is one of these new and complex things, where people just haven’t quite figured it out yet. We all know blockchain tech still has a myriad of problems as it stands (scalability, politics, etc…). Adding to this, each new blockchain project introduces its own layer of complexity, most often laden with assumptions as to how stakeholders will interact in its ecosystem and the aggregate results it would produce. Sound familiar?

ABM gives us the necessary framework to understand what the aggregate results in our blockchain project may be, through allowing these stakeholders to interact in our environment over time.

Don’t get me wrong, ABM is no silver bullet! Also, yes, of course there are assumptions you will need make when constructing your model. Specifically about the initial behaviour of the stakeholders in your model. However, the beauty lies in the fact that ABM will allow projects to either back up or discredit their… “Insert lofty ICO promise here”.

I am busy working some exciting stuff in the ABM space and can’t wait to share more with you at a later stage.

Disclaimer: This post relies on the ideas and models from the following resources: Economics with Heterogeneous Interacting Agents: A Practical Guide to Agent-Based modeling (Alessandro Caiani et al.) and the NetLogo model library