Customer Acquisition using Agent-based Modeling

Building the customer acquisition model as an agent-based model with BPTK.
Keywords

agent-based modeling, abm, agents, events, scenarios, bptk, bptk-py, python, business simulation

Customer Acquisition using Agent-based Modeling

The basic concept behind Agent-based models is quite simple: you populate an environment (the model) with a set of agents. Agents and the environment each have a set of properties and each agent must always be in a defined state.

Agents can perform actions and interact amongst each other and with the environment by sending each other events - the agents react to these events by updating their properties and/or changing their state.

Agents and their environment

Agent-based Modeling with BPTK-Py explains step by step what an agent and a model need; this page builds one. A model is configured in a JSON file, and each configuration of it is a scenario.

Agent-based modeling is a very powerful approach and you can build models using ABM that you cannot build using SD. This power comes at a price though: because each agent is modelled as an individual entity, agent-based models are quite slow.

Setting Up the Model

For the customer acquisition model, we really just need two agents: the company that sends advertising events and the consumers that receive those events. If a consumer becomes a customer, then the consumer starts sending word of mouth events.

This is illustrated in the following diagram:

Customer Acquisition ABM

Note that the advertising budget and the contact rate are properties of the respective agents – this is a glimpse at the power of agent-based modeling, because we could easily set individual contact rates for the consumers or have multiple companies advertising competing products. All these aspects cannot easily be modelled using System Dynamics.

Setting up agents is actually quite simple - all you need to do is register handlers for the events and define the act method.

Note that the company agent defined below accesses the properties advertising_budget and consumers_reached_per_euro. These properties are defined in the scenarios and can then be accessed “magically” as either agent properties or model properties.

The model itself needs a way of instantiating agents - for this you register agent factories, which return an agent of a particular type. In their simplest form an agent factory is just a lambda function.

NOTE: Running an agent-based model takes noticeably longer than running a System Dynamics model, because every agent acts in every step. The population here is deliberately small, so that the model runs in your browser as well.

Setting Up Scenarios

The scenario mechanism works exactly the same for SD DSL, agent-based and hybrid models, so you can load different kinds of model side by side and compare their results.

NOTE: especially for larger models it is much better to keep the model and the scenario definitions in separate files.