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 transpiles the XMILE model into an SD DSL model and does so again whenever you change it in the visual modeling environment, as XMILE Step by Step explains. So you can model in Stella Architect and experiment with scenarios in a notebook.

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, which XMILE Step by Step explains.

{
    "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:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      marketSaturation
    constant:       advertisingBudget
    constant:       advertisingSuccess
    constant:       consumersReachedPerEuro
    constant:       contactRate
    constant:       initialCustomers
    constant:       initialPotentialCustomers
    constant:       wordOfMouthSuccess
Scenario: low_word_of_mouth
--------------------------
    stock:          customers
    stock:          potentialCustomers
    flow:           customerAcquisition
    converter:      acquisitionThroughAdvertising
    converter:      acquisitionThroughWordOfMouth
    converter:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      marketSaturation
    constant:       advertisingBudget
    constant:       advertisingSuccess
    constant:       consumersReachedPerEuro
    constant:       contactRate
    constant:       initialCustomers
    constant:       initialPotentialCustomers
    constant:       wordOfMouthSuccess
Scenario: high_word_of_mouth
--------------------------
    stock:          customers
    stock:          potentialCustomers
    flow:           customerAcquisition
    converter:      acquisitionThroughAdvertising
    converter:      acquisitionThroughWordOfMouth
    converter:      consumersReachedThroughAdvertising
    converter:      consumersReachedThroughWordOfMouth
    converter:      marketSaturation
    constant:       advertisingBudget
    constant:       advertisingSuccess
    constant:       consumersReachedPerEuro
    constant:       contactRate
    constant:       initialCustomers
    constant:       initialPotentialCustomers
    constant:       wordOfMouthSuccess

We directly plot the scenarios:

NOTE: Once the XMILE file has been transpiled, the model runs without the software that created it - on the Python engine or on the Rust engine.