NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled because this model uses extensions.)


This model intends to explore how quality issues for some individuals on a network can increase the risk of churn thanks to influential factors.


When the model is set up it creates the number of individuals defined by the user in the *number-of-agents* and defines the links according the parameter *connection-probability*.

### Agents

The agents represent the individuals of the social network being created based on the parameter *number-of-agents*. The number of connections is defined based on the *connection-probability*. Everyone has its own characteristics that are represented by:

- **churn?** identify if the customer has churned. It is initialized as False for the whole network.

- **contract?** identify customers who have contracts with a given company. Customers with contracts usually tend to go up to the end of it to avoid fines, so we consider that customer will not churn before the termination of a contract. The number of agents defined with contracts is calculated based on the *contract-percentage*.

The parameter *threshold-contract-reneweal* defines what should be the satisfaction level to a customer renewal a contract.

- **remaining-ctr-time** identify the time to the end of contracts with a given company. For agents with *contract?* equals True, it is initialized based on random number on the interval [0, 12].

- **quality-sensitiveness** scale from zero to one defining how much a change in price affects the customer perception of value. It is initialized based on random number on the interval [0, 1].

- **price-sensitiveness** scale from zero to one defining how much a change in quality affects the customer perception of value. It is initialized based on random number on the interval [0, 1].

- **network-sensitiveness** ;; scale from zero to one defining how much a change in the network opinion affects the customer perception of value. It is initialized based on random number on the interval [0, 1].

- **price-assessment** identify how the customer asses the price of the service.

- **quality-assessment** identify how the customer asses the quality of the service

- **network-assessment** identify how the network of the customer assess the service

- **satisfaction-level** it is calculated based on an equation that considers the average weight for satisfaction based on three elements price, quality and network influence.

### System Dynamics

This model works with the inertia concept, in a way that we need to have an external factor to provoke a change in the satisfaction level of an individual. These perturbations to the system are introduced when the user reports a problem of quality that affects agents according *percentage-affected*.

ask turtles [
if color != red [
ifelse random-float 1.0 < percentage-affected [
if quality-assessment > 0 [
set quality-assessment quality-assessment - .1
set color yellow
set number-quality-issues number-quality-issues + 1
set label int (satisfaction-level * 100)
[set color blue]
] ]

When the model is running at each tick the agent’s satisfaction is updated and if the satisfaction level is lower than .6 and the customer do not have a contract then it will churn. At each iteration the *remaining-ctr-time* is decreased by one unit of time.

The formula used to calculate the satisfaction of an individual is a weighted average of price, quality and network influence perception. The level of importance that is used to weight is defined by the parameters that can be modified by the user: *price-importance*, *quality-importance* and *network-importance*.

to calculate-satisfaction

if any? link-neighbors [
set network-assessment sum [satisfaction-level] of link-neighbors / count link-neighbors]
let weighted-satisfaction quality-sensitiveness * quality-assessment + price-sensitiveness * price-assessment + network-sensitiveness * network-assessment
let overall-weight quality-sensitiveness + price-sensitiveness + network-sensitiveness
set satisfaction-level weighted-satisfaction / overall-weight


### Assumptions

- the company will not invest in any marketing campaigns to raise the value perception of the agents.
- the model stops if all the customers have churned.


1) Define the parameters you want to simulate moving the sliders to the values you identify as appropriate to your initial analysis. Then you need to set up the network and to do so you have two alternatives:

- SETUP NETWORK: in this case all agents will be initialized with the same properties that define the customer satisfaction based on the parameters of price, quality and network influence defined on the sliders.

- SETUP NETWORK WITH RANDOMNESS: here we introduce some randomness on the parameters, taking a standard deviation of 10% of the original parameter. This will allow that some agents be under and others above the average.

2) Press the button GO to start running the model and reach the stabilization of the network satisfaction level.

3) Introduce some perturbations using the button REPORT PROBLEM OF QUALITY, it will reduce the level of satisfaction of individuals and impact also on its neighbors.


### Network Assessment

At the beginning we need some ticks to stabilize the overall satisfaction level , this happens due to the fact that we initialize all agents with the property *network-assessment* value set to 1, but at each tick we update the calculation based on the neighbors, as each individual has different parameters that compose the satisfaction we need some ticks to reach the actual initial state.

### Inertia

If no problem is reported there will be no events of churn. It means that our model is not affected by any other factor outside the context of customer and company.

### Churn

Check how many issues need to be reported to have a complete churn on the network for different configurations of the network.


Try increasing the network-importance and check the influence on the churn when compared to smaller values for this parameter.

In the company statistical data simulate different configurations of customer level of satisfaction with price and quality.


Try modelling a scenario with competitors where we also simulate what would be the new distribution of the network considering that customers can move from one company to another when they are not satisfied.

Analyze a network created with real world data collected from companies using the idea of the model 'Network Import Example'.

Introduce some marketing initiatives that can improve the assessment of the individual and of the whole network.


The primitive generate-random from NetLogo nw extension was used to easily create a random that creates links based on a predefined connection probability.

We used the agentset feature to identify the neighbors of a given individual and collecting the opinion of them on the service.


The model 'Simple Viral Marketing' allows you to explore the relationship between different centrality measures, and different network types, and see if the interactions between them make for faster or slower spread of a product.


This model was inspired by the concepts of CUSTOMER-INFLUENCE FACTOR MODELING, in which the idea of integrating traditional machine learning techniques to agent based model in order to get better insights for business purposes, presented by:

Reis Pinheiro, Carlos Andre. Social Network Analysis in Telecommunications. Hoboken, New Jersey, Wiley, May 2011.

The network generation code was inspired by the library model 'NW General Examples', that demonstrates various features of the Netlogo NW extension.


Copyright 2020 Erika Fonseca.

![CC BY-NC-SA 4.0](

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Erika Fonseca at

(back to the NetLogo User Community Models)