Customer Acquisition as an XMILE Model

Running a Stella Architect XMILE model with BPTK using a scenario file.
Keywords

xmile, stella architect, system dynamics, scenarios, bptk, bptk-py, python, business simulation

Customer Acquisition as an XMILE Model

Many modelers prefer to build models using visual modeling environments and not directly in code. One such environment is Stella Architect. Using Stella Architect, you can build System Dynamics models visually. You can then import them into Python using BPTK and work with them much like with any other model.

The framework automatically re-transpiles the XMILE model if changes are made in the visual modeling environment. So you can model in Stella Architect and experiment with scenarios in a notebook.

Transpiled models work stand-alone, so you can run them anywhere independently of the modeling environment.

Setting Up The Model

This is what our customer acquisition model looks like in Stella Architect:

Stella Architect

Setting Up The Scenarios

To work with XMILE models, all we have to do is set up a scenario file in the scenarios folder.

The scenario file tells the framework where to find the XMILE model and which scenarios to set up.

In our case the file looks like this - the only difference to the SD DSL scenario definition is the inclusion of the XMILE source.

{
    "xmile_customer_acquisition":
    {
        "source":"simulation_models/customer_acquisition_xmile.stmx",
        "model":"simulation_models/customer_acquisition_xmile",
        "scenarios":
        {
          "base": { },

        "low_word_of_mouth":{
            "constants":{
                "wordOfMouthSuccess":0.001
            }
        },
        "high_word_of_mouth":{
            "constants":{
                "wordOfMouthSuccess":0.1
            }
        }
        }
    }
}

As soon as we instantiate bptk, the framework automatically searches the scenarios folder for scenarios and loads them.

Let’s list all the scenarios and equations the framework finds.

Available Equations:
Scenario Manager: xmile_customer_acquisition
Scenario: base
--------------------------
    stock:          customers
    stock:          potentialCustomers
    flow:           customerAcquisition
    converter:      acquisitionThroughAdvertising
    converter:      acquisitionThroughWordOfMouth
    converter:      advertisingBudget
    converter:      advertisingSuccess
    converter:      consumersReachedPerEuro
    converter:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      contactRate
    converter:      initialCustomers
    converter:      initialPotentialCustomers
    converter:      marketSaturation
    converter:      wordOfMouthSuccess
Scenario: low_word_of_mouth
--------------------------
    stock:          customers
    stock:          potentialCustomers
    flow:           customerAcquisition
    converter:      acquisitionThroughAdvertising
    converter:      acquisitionThroughWordOfMouth
    converter:      advertisingBudget
    converter:      advertisingSuccess
    converter:      consumersReachedPerEuro
    converter:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      contactRate
    converter:      initialCustomers
    converter:      initialPotentialCustomers
    converter:      marketSaturation
    converter:      wordOfMouthSuccess
Scenario: high_word_of_mouth
--------------------------
    stock:          customers
    stock:          potentialCustomers
    flow:           customerAcquisition
    converter:      acquisitionThroughAdvertising
    converter:      acquisitionThroughWordOfMouth
    converter:      advertisingBudget
    converter:      advertisingSuccess
    converter:      consumersReachedPerEuro
    converter:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      contactRate
    converter:      initialCustomers
    converter:      initialPotentialCustomers
    converter:      marketSaturation
    converter:      wordOfMouthSuccess

We directly plot the scenarios:

NOTE: Once the XMILE file has been transpiled into a Python model, the framework is independent of the XMILE file. All simulation is done in Python. The software that was used to create the XMILE file is not needed by the BPTK framework.