Publication Cover
Mathematical and Computer Modelling of Dynamical Systems
Methods, Tools and Applications in Engineering and Related Sciences
Volume 30, 2024 - Issue 1
136
Views
0
CrossRef citations to date
0
Altmetric
Research Article

The bass diffusion model: agent-based implementation on arbitrary networks

& ORCID Icon
Pages 364-384 | Received 28 Feb 2024, Accepted 28 Apr 2024, Published online: 19 May 2024

ABSTRACT

The goal of this study is to model Bass diffusion and its extensions on complex networks, including scale-free networks with arbitrary power-law exponent and assortative degree correlations. For this purpose we employ a combination of the free software packages networkX and NetLogo. Some new results obtained in the agent-based simulations (and differing from those in mean-field approximation) are the following. The introduction of assortative correlations in scale-free networks has the effect of delaying the adoption peak in the Bass model, compared to the uncorrelated case. The peak time depends strongly also on the maximum degree effectively present in the network. For diffusion models with threshold on signed network, a high level of clustering tends to cause adoption blockades. By analysing statistical ensembles of assortative networks generated via Newman rewiring one observes a remarkable strong correlation between the average degree of first neighbours kˉnn(k) and the average clustering coefficient Cˉ(k).

1. Introduction

In the quantitative analysis of complex systems, in particular for applications to social science and economics, agent-based simulations represent a valid alternative and complement to modelling techniques based on ordinary or stochastic differential equations. Agent-based simulations benefit from the steady increase in available computational power. They allow to represent the behaviour of single individuals and to discover the dynamical emergence of collective behaviour and interactions at an aggregate level.

We are mainly interested in this work into agent-based diffusion models of innovation and technological change, a phenomenon of great economic and social relevance, systematically studied since the 1960s (Rogers Citation2010) and mathematically formalized through the Bass equation and its developments (see e.g. Bass Citation1969; Norton and Bass Citation1987; Jiang and Jain Citation2012; Guidolin Citation2023). The review by Kiesling et al (Citation2012). summarizes briefly the classical theory of Bass and describes all the main agent-based models of innovation diffusion, incorporating contents of previous reviews (Garcia Citation2005; Dawid Citation2006; Peres et al. Citation2010). Kiesling et al. emphasize the importance of agent-based models for overcoming issues and limitations of the analytical models through an individual-based modelling approach.

More specifically, we will consider the implementation of diffusion models on complex networks. This is an essential aspect for social science models, independently from their detailed formulation. In our previous work we investigated the Bass equation on many kinds of scale-free networks in Heterogeneous Mean Field approximation (Bertotti et al. Citation2016b, Citation2016a, Citation2019). Recently we developed some numerical techniques, based on Newman rewiring, for the explicit construction of scale-free networks with assortative degree correlations (a typical feature of social networks). On these networks it is possible to solve the Bass equations for each node. The codes were first written in C++ and Mathematica, then in Python, taking full advantage of object-based programming with the powerful package networkX (Hagberg et al. Citation2008; Platt Citation2019; Son et al. Citation2023; Di Lucchio and Modanese Citation2024).

We recall that the original Bass equation of innovation diffusion is (Bass Citation1969)

(1) dF(t)dt=[1F(t)][p+qF(t)](1)

where F(t) is the cumulative fraction of adopters at time t, p is called the innovation coefficient and q the imitation coefficient. The initial condition is usually chosen as F(0)=0 and there is clearly in general a stationary asymptotic solution F(t)=1 when t. When the diffusion process occurs on a network, the model can be extended, in mean-field approximation, to give a system of n ordinary differential equations, where n is the maximum degree present in the network. We then have

(2) dGi(t)dt=[1Gi(t)]p+iqh=1nP(h|i)Gh(t),i=1,,n(2)

where Gi(t) is the fraction of potential adopters with i links that at time t have adopted the innovation, divided by the network degree distribution P(i), i.e. by the probability that a randomly chosen individual has i links. The elements P(h|i) of the degree correlation matrix express the conditional probability that an individual with i links is connected to one with h links. The summation has the task of ‘distributing’ the imitation process over all the neighbours of a node taking into account this conditional probability.

Some typical features of the networks generated by Newman rewiring are represented in . shows an r-K plot of some small network ensembles generated with different target correlations and, for comparison, two ‘clouds’ of Barabasi-Albert networks built with a standard stochastic preferential attachment process. The quantities r and K represent respectively the Newman assortativity coefficient and the network average of the average nearest neighbor degree of each node. In terms of the degree distribution P(k) and of the average nearest neighbor degree function kˉnn(k), one has K=kP(k)kˉnn(k) (the node degree k varies in an interval [kmin,kmax]). The use of r-K plots is quite natural for assortative and disassortative rewiring. When the rewiring preserves the degree distribution, the variations Δr and ΔK in a rewiring step are univocally related by

Figure 1. Location in the r-K plane of some small statistical ensembles of scale-free networks, each one with 1000 nodes. The barabasi-albert-1 and barabasi-albert-2 networks are generated with a standard preferential attachment process, in which new nodes are attached respectively to 1 and 2 existing nodes. Their maximum degree is variable, which accounts for the larger dispersion. In the other “clouds” the degree distribution is fixed through a configuration model algorithm; the different realizations have been obtained by Newman rewiring with assortative target correlations for BM1 and BM2 (Di Lucchio and Modanese Citation2024), and with uncorrelated target correlations for the remaining ones. The plot coordinates r and K represent respectively the Newman assortativity coefficient and the network average of the nearest-neighbor degrees of the nodes (see exact definition in the text, and also see the general relation between ΔK and Δr, according to which in a degree-conserving rewiring ΔK and Δr always have opposite signs).

Figure 1. Location in the r-K plane of some small statistical ensembles of scale-free networks, each one with 1000 nodes. The barabasi-albert-1 and barabasi-albert-2 networks are generated with a standard preferential attachment process, in which new nodes are attached respectively to 1 and 2 existing nodes. Their maximum degree is variable, which accounts for the larger dispersion. In the other “clouds” the degree distribution is fixed through a configuration model algorithm; the different realizations have been obtained by Newman rewiring with assortative target correlations for BM1 and BM2 (Di Lucchio and Modanese Citation2024), and with uncorrelated target correlations for the remaining ones. The plot coordinates r and K represent respectively the Newman assortativity coefficient and the network average of the nearest-neighbor degrees of the nodes (see exact definition in the text, and also see the general relation between ΔK and Δr, according to which in a degree-conserving rewiring ΔK and Δr always have opposite signs).

Figure 2. An example of an assortative network obtained via Newman rewiring from a scale-free configuration model network with 1000 nodes and critical exponent γ=2.5. Typical values of r and K for networks of this kind are shown in . The minimum degree of the nodes is 2 and their average degree about 4. Note the strongly connected central region, where the hubs link preferentially to other hubs (compare ). The long chains in the periphery are due to the probabilistic enforcement in the rewiring of a large value of the correlation P(2|2).

Figure 2. An example of an assortative network obtained via Newman rewiring from a scale-free configuration model network with 1000 nodes and critical exponent γ=2.5. Typical values of r and K for networks of this kind are shown in Figure 1. The minimum degree of the nodes is 2 and their average degree about 4. Note the strongly connected central region, where the hubs link preferentially to other hubs (compare Figure 4). The long chains in the periphery are due to the probabilistic enforcement in the rewiring of a large value of the correlation P(2|2).

(3) ΔK=Lσq22N(AD+BC)ABCDΔr(3)

where L is the total number of links in the network, N the total number of nodes, σq2 the variance of the excess degrees of the nodes, and A, B, C, D are the degrees of the nodes involved in the rewiring step (Bertotti and Modanese Citation2020). Both r and K are relevant for diffusion processes on the network. Greater assortativity generally leads to an accelerated diffusion in the initial stages (Di Lucchio and Modanese Citation2024), while a larger K decreases the epidemic threshold (Pastor-Satorras and Vespignani Citation2001, Citation2002, Citation2004; Boguñá and Pastor-Satorras Citation2002; Boguñá et al. Citation2003b, Citation2003a, Citation2004; Barthélemy et al. Citation2004, Citation2005; Pastor-Satorras et al. Citation2015). shows an example of a scale-free assortative network obtained with the configuration model followed by rewiring with a target correlation matrix.

In this work we also show how the assortative scale-free networks generated by our codes can be quickly exported in standard graphml format into the simulation software NetLogo, in order to implement on them the agent-based Bass diffusion model. As recalled in Section V, NetLogo is widely used for agent-based simulations; it has some built-in network structures, but is quite limited under this respect. The Python connector PyNetLogo can be used to control NetLogo and to perform a numerical and statistical analysis of the results of the simulations. In Section 2 we report the results of agent-based simulations with assortative networks. Section 2 A describes a relation occurring, in assortative scale-free networks, between the function kˉnn(k) and the clustering-degree function C(k). A strong correlation was found computing the average of C(k) over an ensemble of networks generated by rewiring. In Section 2 B we review some recent applications of NetLogo to the Bass diffusion model with improved dynamical rules (e.g. including marketing-mix utility functions, analysis of brands, cathegories of adopters, opinion leaders etc.). This review is motivated by the fact that the techniques described in Section 5 and 2 for assortative networks and for the peak diffusion time could in principle be applied to all these models.

Section 3 describes the implementation in NetLogo of the Bass model on arbitrary signed networks, following and extending the work by Mueller and Ramkumar (Citation2023). The extension concerns mainly the network aspect, in the sense that any network which can be generated in networkX, including our assortative scale-free networks and modifications (for example, with cuts in the power law tail), or custom-built small-world networks etc., can be transformed into a signed network with given probability of positive/negative links or also with a continuous random distribution of their weights. Then, any kind of transition rules compatible with NetLogo, like those reviewed in Section 2 B, can be implemented on these networks. Results confirm Mueller’s observation that the presence of a threshold for diffusion based on the computation of positive and negative feedback of neighbours hinders the process of spreading, depending on the clustering properties of the network itself. This process is dependent on both the amount and the weight of negative links, provided that there is a random distribution of the seed.

2. Agent-based simulations with assortative networks

By performing agent-based simulations of Bass diffusion with the techniques described above and in the APPENDIX (Section 5), one can obtain information about peak diffusion times, to be compared with the results of models based upon differential equations.

In Di Lucchio and Modanese (Citation2024) we have computed peak diffusion times on scale-free assortative networks generated via configuration model and Newman rewiring. A large system of coupled differential equations was used, namely one equation for each node. This was possible because realizations of the networks were available, and not only their probabilistic degree distribution and correlation functions. It turns out that, unlike in the mean-field approximation, the diffusion peak is reached earlier in assortative than in uncorrelated networks. One also observes a strong dependence on the maximum degree effectively present in the network: the larger this degree, the shorter the peak diffusion time.

These results are confirmed by the agent-based simulations: see . It is further observed that when the maximum degree is very large, the peak time is delayed for uncorrelated networks. Note that here the Bass coefficients p and q have been chosen to be smaller than in Di Lucchio and Modanese (Citation2024), since all agent-based models include a finite time for the spreading process of the technology.

Table 1. Examples of peak times and maximum values for the derivative of the Bass diffusion curve (‘adoption rate’), observed in assortative networks with correlations of the BM1 type (Di Lucchio and Modanese Citation2024) and in uncorrelated networks. All networks have scale-free exponent γ=2.5, number of nodes N=1000, minimum degree kmin=2 and have been generated via configuration model plus Newman rewiring. The parameters for the Bass diffusion equations are p=0.025, q=0.155. One observes that the diffusion peak is reached earlier in assortative than in uncorrelated networks.

2.1. Relation between assortativity and the clustering-degree function C(k)

Considerations on the role of clustering in diffusion processes (see also Section 3) suggest to use our algorithm of Newman rewiring for investigating the relation between clustering and assortativity in scale-free networks. This is a further example of the advantage of using full statistical ensembles of networks with pre-defined correlations. Only in such ensembles can certain correlations become evident.

On the relation between clustering and assortativity only a few empirical studies have been published, limited to the total clustering coefficient C. For example, in (Holme and Zhao Citation2007) a weak positive correlation between C and r has been reported. Looking at four sets of biological networks, it was found that their representation in an r-C plane occupied a bounded region with elongated shape.

A qualitative analysis of our assortative networks obtained with Newman rewiring, like that in , indicates that the densely connected core is made of hubs of intermediate size. These nodes have a degree around a value k0 such that the function kˉnn(k) is close to its maximum at k0; they are thus able to find in the network approximately k0 neighbors of similar degree. On the contrary, the hubs with kk0 cannot find enough assortative partners with similar degree, and therefore lie on the decreasing part of the kˉnn(k) plot. It can be expected that the assortative core has a high clustering level, and this can be quantitatively confirmed by computing the average over several rewiring cycles of the function C(k) which gives the mean clustering coefficient of the nodes of the network having degree k.

The function C(k) has been previously evaluated for some large real social networks (Hardiman et al. Citation2009) and for a class of rewired BA networks (Tam et al. Citation2008), but is otherwise little known. We find that in a statistical ensemble of uncorrelated scale-free networks built via configuration model, C(k) is very small and exhibits a random behavior (see , obtained through Newman rewiring with uncorrelated target). Using a correlated target, the function changes completely and clearly shows a high level of clustering in the assortative core, see . Codes are available at https://github.com/Ladilu/Mueller_Bass_accessible.

Figure 3. Top: cloud of kˉnn(k) functions for a cycle of 20 newman rewirings with uncorrelated target, starting from a scale-free configuration-model network with γ=2.5. Bottom: average of the clustering C(k) as a function of degree over the same ensemble. Networks with 15,000 nodes. Approx. 130000 rewirings per each cycle. Note the small values of the clustering coefficient at all degrees.

Figure 3. Top: cloud of kˉnn(k) functions for a cycle of 20 newman rewirings with uncorrelated target, starting from a scale-free configuration-model network with γ=2.5. Bottom: average of the clustering C(k) as a function of degree over the same ensemble. Networks with 15,000 nodes. Approx. 130000 rewirings per each cycle. Note the small values of the clustering coefficient at all degrees.

Figure 4. Top: cloud of kˉnn(k) functions for a cycle of 20 newman rewirings with assortative target, starting from a scale-free configuration-model network with γ=2.5. Bottom: average of the clustering C(k) as a function of degree over the same ensemble. Note the high level of maximum clustering in the assortative core of the network and the strong correlation between the curves kˉnn(k) and C(k). Networks with 15,000 nodes. Approx. 130000 rewirings per each cycle.

Figure 4. Top: cloud of kˉnn(k) functions for a cycle of 20 newman rewirings with assortative target, starting from a scale-free configuration-model network with γ=2.5. Bottom: average of the clustering C(k) as a function of degree over the same ensemble. Note the high level of maximum clustering in the assortative core of the network and the strong correlation between the curves kˉnn(k) and C(k). Networks with 15,000 nodes. Approx. 130000 rewirings per each cycle.

2.2. Other agent-based models of bass diffusion

This Subsection contains a brief review of recent results on agent-based simulations of the Bass diffusion model. The techniques described above for assortative networks and for the peak diffusion time could be applied to all these models. In Section 3, however, we will focus on the version proposed by Mueller and Ramkumar (Citation2023) on signed networks, which requires some specific steps for assigning the weights of the graph edges.

Kiesling et al (Citation2012) describe several applications of agent-based Bass diffusion models. They can serve either as intuition aids for the purpose of theory building or as tools to analyse real-world scenarios and obtain policy recommendations, also in sight of future management decisions which need some form of support. The latter stream of research integrates the Bass model with further elements which were not introduced at first in (Bass Citation1969), namely the marketing mix factors: product, price, promotion and distribution.

An analysis of brands was implemented in (Schramm et al. Citation2010). The adopters are divided in three categories: pioneers, early adopters and late adopters. The model combines brand-level diffusion curves in order to form a product-type diffusion curve. In order to know the marketing mix parameters for the brands it is enough to have an initial evaluation of the brand agents’ characteristics and of the proportion of the adopters. Then, an individual threshold can be built at the microlevel for simulating with NetLogo the diffusion at the macro level of a given product category. In this real-world scenario the network is fixed but in principle an extension to heterogenous networks is allowed and encouraged.

Another simulation dynamics is based on the concept of critical mass for diffusion, introduced systematically by Watts and Dodds (Citation2007) as constituted by individuals who are easily influenced by ‘influentials’, namely the ones who contribute to create the determinant opinion about a single product. The influentials came to occupy a central place in the literature dealing with diffusion of innovations, of which one main example is the previous 1995 edition of (Rogers Citation2010). They are also called opinion leaders and they are especially relevant to the diffusion of certain technologies such as mobile phones and computers, which change the social behaviour of people.

One study which examines the opinion leaders’ role by means of agent-based simulations is (Van Eck et al. Citation2011). It is found that innovative behaviour of opinion leaders yields a higher adoption percentage; in addition to that, another advantage of the presence of opinion leaders is a faster diffusion process, as it was measured from simulations. The threshold for adoption is calculated using a simplified version of the model by (Delre et al. Citation2007). In the latter study, the probability of adoption for an agent i is given by

(4) ai,j=P(Ui,jUi,MIN)(4)

where

(5) Ui,j=βjxi+(1βj)yi(5)
(6) yi=qjpi1otherwise0(6)
(7) xi=Aihi1otherwise0(7)

Here, Ui,j is the utility agent i has if it adopts innovation j and Ui,MIN specifies its minimum utility requirement. The individual preference yi and the local social influence xi on the agent i are both threshold functions, whereas βj represents how strong the social influence effect is in the market of the product j. In the definition of the social influence part, pi is the individual preference of agent i and qj is the quality of innovation j. In the definition of the individual part, hi is the threshold value for the fraction of adopters in i’s personal network, namely the value that must be overcome in order to activate adoption for agent i. Ai is the fraction of adopters in the L-th order set of alters of agent i – the alters are the agents included in i’s personal network. Both L=1 and L=2 were examined in Delre et al. (Citation2007). In a later work (Delre et al. Citation2007), the local social influence was re-defined as

(8) xi=aihi1otherwise0(8)
(9) ai=adoptersiadoptersi+nonadoptersi(9)

where ai is the percentage of adopters in i’s personal network.

In the model by Bohlmann et al (Citation2010) a threshold defines the minimum proportion of adopters among all those connected to individuals before they can adopt. The simulation is carried out with 1600 agents, of which 50 are selected randomly as innovators who have adopted at the earliest stage of the innovation. This external influence is fixed consistently among all topologies of the network. The agent examines the status of the immediate neighbourhood; if the percentage of the adopters exceeds the threshold, the agent adopts with probability 0.5. Four topologies are selected: cellular automata, random network, small world network (random and small world use Poisson distribution, their average number of links per vertex are the same), power-law network (BA network). Five levels of the adoption threshold are allowed: 0,01, 0.05, 0.10, 0.15, 0.20. The peak time is compared for the different topologies and a threshold of 0.05. All simulations show a diffusion cascade for the lower values of the threshold, the percentage diminishes from 100% to less than 100% when the threshold reaches the values of 0.15 and 0.20. The adoption threshold negatively affects the number of new adopters at the point of peak adoption. The effects are less pronounced for the random network under diffusion cascade. The network topology has a more pronounced effect on diffusion processes for higher adoption thresholds. At a high threshold level of 0.20, the random network fails to diffuse at all, whereas the other networks have pronounced differences in their peak adoption times. A model in which the agents belong to one of two market segments is proposed for a first analysis of the peak of the adoption and is foreseen as a future application for agent-based simulations of an heterogeneous market configuration. For what regards the findings related to social influence in networks, the strength of communication links between innovators and followers is analysed. The discovery of significant prime communicator nodes in a network allows innovation development practices to be better calibrated to realistically multiple market segments.

In the work of Delre et al. (Citation2010), the graph is fully connected, the percentage of initial adopters is fixed and they are randomly distributed. In contrast to percolation models without social influence, in this model it is possible that an agent first does not adopt when being informed about the product, but later, when several neighbours have adopted, he or she may decide to adopt as well because of the increased social utility of the product. If agent i is informed about product g and he or she decides to adopt it, he or she is considered an adopter until the end of the simulation. For the purpose of choosing a suitable network configuration a more realistic version of the scale-free network (Amaral et al. Citation2000) is adopted. Here, when a new node is attached to the network, the probability of all the other nodes of being selected for the attachment is still proportional to the number of nodes they already have, but it decays exponentially due to a fixed probability h to become inactive at any moment of the process. The scale-free network of Amaral et al. also yields a power law distribution of links for low connected links, but the number of links decays faster when the probability h increases. In other words, the scale-free network model is generalized as follows: Vertices are classified into one of two groups, the active and the inactive. All vertices are created active but in time they can become inactive, namely they cannot receive any more links. The constraints that are responsible for the transition of the vertices from active to inactive lead to cut-offs on the power law decay of the tail of connectivity distribution and when they are strong enough no power law region is visible. The studies by Delre address mostly the scientific question of whether hubs are effectively influential in realistic networks that can offer a model for concrete markets. It turns out that in practice the role of the highly connected nodes is to help informing a large number of agents about the innovation and not to persuade them directly. This conclusion about the social influence aspect is the one that is relevant to our work, because we also deal with modelling of decisions.

The very recent work by Kotthoff and Hamacher (Citation2022) proposes a general formulation for ABM simulations with an arbitrary number of agents. The authors identify a common method to simulate the diffusion of innovations with ABMs in the literature and formulate this method in a general ABM. While discussing the theoretical paper by Delre et al. (Citation2010) they propose to simplify the two-step function used in this work by including an information barrier in the utility function which avoids the first stage of the adoption process. In general, they state that the decision of the agent at time t to adopt the innovation and hence to change its adoption status from 0 to 1 is only influenced by the attributes Xn(t). The attributes of agent n are the input for the utility function

(10) un,t=u(Xn(t),α)R(10)

which describes the willingness of agent n to adopt the innovation at time t. The adoption becomes more likely if the value of the utility function is large. Here, α is the vector of the K free parameters in the model. In (Kotthoff and Hamacher Citation2022) the model calibration is also addressed with a special reference to the data for photovoltaic technology diffusion. In our study we have no empirical data for testing the different sets of parameters and we refer to previous theoretical work. For the cases in which it is pointless to consider the adoption behaviour of every single agent, especially when the available data is not sufficient, building a model that aggregates the decisions of agents in subgroups can be successfull, as done in Henry and Brugger (Citation2017). To which subgroup an agent belongs can be defined by the agent’s location, age, or comparable characteristics, and being able to define subgroups of agents in the model is especially useful to model spatio-temporal data.

It is important to mention that transitions between nodes’ different states have been modelled in SIR epidemic diffusion studies by means of Markov processes, which actually allow to go beyond the mean field model – see for example the GEMF model in (Sahneh et al. Citation2013) – with a time-based reconstruction of the transient region and the introduction of the study of metastable states. It was correctly stated in (Banisch et al. Citation2012) that this approach is based on time correlations and differs from the one of agent-based models, which actually work on cross-correlations and therefore generates the final state from the transient by means of interaction. The differential equations that must be solved in the case of a Markov process are generally yielding a space state far too big both for analytical and numerical solutions; on the other side, Markov chains analysis and ABM (Agent Based Models) techniques do not overlap in a simplified way. In other words, it is not possible to directly reconstruct the state of the agents form their memory data but statistical analysis has to be performed. We believe that usage of ABM on previously constructed large networks constitutes a valid alternative to real datasets analysed by means of Markov Chains, within the limits offered by the computational constraints. The usage of the Python language allows to re-create large graphs that would take an excessive amount of time in NetLogo and therefore allows for a better numerical treatment of the problem.

3. The bass model on signed networks

In their work of 2023 (Mueller and Ramkumar Citation2023), Mueller and Ramkumar note that most models of innovation diffusion assume that relationships in a network are of a positive nature, in the sense that adoption by an agent generates a probability of adoption by the agents connected to it. Some authors, however, have also considered inverted influence effects in the form of negative word of mouth or foe relationships. In terms of the network, these approaches involve so-called signed graphs or nets, friendship-foe relationship networks or networks with negative weights. Earlier works involving signed networks are cited in (Mueller and Ramkumar Citation2023) and mainly concern Heider’s model of balanced sentiments in social networks and opinion dynamics models.

Barbuto et al (Citation2019) use a practical definition of diffusion of innovation based on (Rogers Citation2010) and social network analysis. Taking into account the existing literature (Banerjee et al. Citation2013) based on centrality statistics and a regression model, they construct an adapted linear regression analysis which requires a choice of coefficients and the consideration of some parameters like degree centrality, betweenness, clustering coefficient. Barbuto et al. consider how the literature shows that one can obtain different diffusion rates by changing the so-called injection points (IP), or early adopters distribution. They perform agent-based model simulations with NetLogo in which the agents who have adopted reconsider their preference at every iteration step, namely they receive information from neighbours, pass information to neighbours and finally decide to adopt if the preference for the new technology is greater than a fixed adoption threshold. In order to augment the model reality and in sight of practical applications with empirical data, they introduce the disappointment extension, which includes the possibility that the innovation disappoints the adopter. When this case occurs, the model provides a possible third action for the ordinary agent, to reduce its preference towards the innovation by a variable amount (between 25 and 75%). In this version of the model, the disappointment is modelled as a random event which affects a variable fraction of the population (between 0 and 25%). The results of the ABM simulations indicate that the individual properties of the IPs are not primarily responsible for the diffusion process. Instead, the density and clusterization of the network play a significant role.

The model proposed in (Mueller and Ramkumar Citation2023) for agent-based simulation employs a network (first random, then small-world or BA) with N agents and L links where the sign of existing links are randomly switched from positive to negative, with a probability pn. This random distribution of negative links in the network is in contrast with balance theory, which assumes that some triangles in signed networks are likely to be found.

It is then assumed that an agent i adopts the innovation at each timestep according to a threshold condition, namely if the sum (θfFOE+θ+) is strictly positive. Here θ represents the number of first neighbours who have already adopted and are connected to the agent through a negative link, and similarly for θ+. The coefficient fFOE describes the strength of the negative influence and typically varies between −3 and 0; the value −1 represents the case in which a negative link has the same strength as a positive one. When fFOE is a simple fraction, an interesting step-wise foe effect is observed in the final adoption rate; for example, if fFOE=0.5, then it takes exactly 2 negative links to counter the effect of a positive link, and therefore for fFOE slightly larger than that value the adoption rate has a positive jump.

Simulations are performed with a custom-made code (not available), varying mainly the parameters pn, fFOE and the kind of network. The starting scenario is a random network with 300 nodes, 900 links and a population of 3% initial adopters randomly chosen. The principal output of the simulations is the final percentage of adopters. While in the traditional Bass model the entire population eventually adopts the innovation, here the presence of a threshold has the consequence that a certain number of individuals never adopt, especially if their neighbours are connected with negative links. These ‘resistant’ nodes also become an obstacle for the adoption of their contacts with positive links, because they make it harder to reach the threshold. The whole process depends strongly on the parameters pn and fFOE. In fact, the curves displaying the final adoption rate as a function of pn (‘share negative ties’) always have a decreasing behaviour, like an inverted S-curve passing from 100% final adoptions when pn=0 to approx. 0% when pn=1.

The reference curve with fFOE=0 is markedly higher than the curve with, e.g. fFOE=1: in the middle of the graph, with pn=0.5, the observed difference is about 40% in the final adoption rate. For comparison, the differences in the adoption rate due to the effect of the network for equal pn and fFOE are at most a few percent. They are more significant at large pn, as relative value, when the final adoption rate is small. In addition to random networks, BA and small-world networks are employed. Their exact features are not specified in the paper. It is recalled that, as general criteria, a high clustering level of the network facilitates diffusion in the case of complex contagion, while a small average path length and a fat tail in the degree distribution are beneficial for simple contagion processes (Delre et al. Citation2007; Centola et al. Citation2007; Kiesling et al. Citation2012; Tur et al. Citation2018; Ramkumar et al. Citation2022). In the presence of many negative links one expects for BA networks several adoption blockades in the network periphery, where a single resistant node can block many others, due to the low clustering. On the other hand, in small-world networks the regions with high clustering are more frequently blocked. In order to confirm these hypotheses, Mueller and Ramkumar produce graphs which relate the nodes’ degrees to their probability of being a final non-adopter.

As anticipated in the Introduction, in this work we reproduce and extend the model of (Mueller and Ramkumar Citation2023) by applying it to a wide set of networks generated with networkX using the configuration model and Newman rewiring. These networks are imported into NetLogo, and then NetLogo performs the agent-based simulations using the threshold transition rule of (Mueller and Ramkumar Citation2023) (see simplified example in ). In order to assign negative signs to some links with a pre-defined probability pn, we use the following trick. NetLogo allows to assign to each link a random weight with uniform distribution in a user-defined interval. It is easy to check that if the interval is equal to (α,1), where α=pn/(1pn), then the total probability to obtain a negative weight is actually pn. Since in the transition rule only the sign of the link matters, and not its weight, this implementation is equivalent to that of (Mueller and Ramkumar Citation2023), further allowing to simulate, if needed, a more general situation in which the weights of the links play a role. In other words, one could simulate a model in which links can influence diffusion positively or negatively with a continuous distribution of strengths.

3.1. Parallel runs of NetLogo simulations

The already mentioned tool named PyNetLogo for connecting NetLogo with a Python environment can also be used in order to run a set of simulations and collect the desired statistics. This feature is generally described in https://pynetlogo.readthedocs.io/en/latest/; in that context the ipyparallel Python package is proposed, for the purpose of running on 4 clusters the subsequent simulations. The document also describes the use of pandas data-frames for further analysis. In the current problem it was found that actually the package concurrent_futures better satisfies our needs of fast and secure parallelization of the tasks, with the number of max_workers of PoolExecutor set to 4. This allows to exploit the 4 processors that we have currently available. It takes a few tens of seconds to run 100 simulations, then the analysis must be performed separately by means of data-frame statistics and writing to files for plotting with Gnuplot. For our purposes, extracting values for the maximum adoption rate and calculating the mean and standard deviation of each data-frame maximum are the desired statistical output. In this way two curves have been reconstructed for the study of the Mueller-Ramkumar model, using a random network with 3% initial seed for diffusion and setting two values of the parameter fFOE, namely 1 and 2. The two datasets show the behaviour of the maximum adoption rate as a function of the percentage of negative links – see .

Figure 5. Plot of the two curves that can be obtained for the values fFOE=1, fFOE=2 in (θfFOE+θ+) according to the Mueller-Ramkumar scheme for the threshold needed for adoption. On the x-axis the percentage of negative links in the network is represented, on the y-axis the percentage of the number of adoptions can be found.

Figure 5. Plot of the two curves that can be obtained for the values fFOE=−1, fFOE=−2 in (θ−⋅fFOE+θ+) according to the Mueller-Ramkumar scheme for the threshold needed for adoption. On the x-axis the percentage of negative links in the network is represented, on the y-axis the percentage of the number of adoptions can be found.

3.2. Results with mueller-ramkumar threshold model on assortative and uncorrelated networks

The set of 100 runs of Netlogo achieved by means of parallel computing with PyNetLogo and the concurrent_future Python package was repeated in order to obtain more statistics about the effect of Mueller threshold on the diffusion on an assortative network generated by means of the configuration model function and Newman rewiring with correlations of the BM1 type (Di Lucchio and Modanese Citation2024). The random negative links are added with 50% probability in NetLogo after the graphml format of the network is loaded and the results are compared with the ones obtained by means of an analogous procedure but starting from an uncorrelated network. The output for different maximum degrees from a start configuration of 500 nodes and a scale law with γ=2.5 are presented in . It is visible how the diffusion is higher in the uncorrelated case; the values are demonstrated to be stable by the small size of the standard deviation.

Figure 6. Some NetLogo views of the agent dynamics for adoption with the Mueller threshold and ffoe=1 in a simplified random network. The agents that have not adopted are initially colored in blue, the seed agents are highlighted in orange, adoptions are represented by yellow color. The network has 100 nodes and wiring probability 0.05.

Figure 6. Some NetLogo views of the agent dynamics for adoption with the Mueller threshold and ffoe=−1 in a simplified random network. The agents that have not adopted are initially colored in blue, the seed agents are highlighted in orange, adoptions are represented by yellow color. The network has 100 nodes and wiring probability 0.05.

Table 2. Examples of diffusion values with the mueller-ramkumar threshold as it is observed in assortative networks with correlations of the BM1 type, γ=2.5, N=500, kmin=2 and in uncorrelated networks. The assortative networks have been generated via configuration model plus Newman rewiring.

4. Conclusions

In this article a new framework for diffusion studies on networks was proposed, based on numerical codes written in Python-networkX and NetLogo. Although these free software packages are well-known and widely employed, their combined use is not simple (networkX is for network generation and analysis, NetLogo for agent-based simulations). A connector tool called PyNetLogo is available and partially documented; it also allows to run parallel simulations via the ipyparallel Python package. There are no previous examples in the literature, however, of the application of these methods to established diffusion models which have been defined and analysed in the past with systems of differential equations. Besides the specific models considered in this work (Bass model and Mueller-Ramkumar threshold model), several other models can potentially benefit from agent-based simulations on networks. Some of them have been briefly reviewed in Section 2.B.

In our work we have performed an analysis of the emerging features of the dynamics of preference diffusion about technology, based on ABM simulations. We recall that both Markov Chain Approaches (MCA) and Agent Based Models (ABM) have an empirical usage and the most general subject where both research lines ground their common root is structure (or pattern) generation. While in the context of MCA, patterns emerge from time correlations or memory effects in the lifetime of a system, in the context of ABM the emerging structures are mostly related to cross-correlations between the agents. We have focused on the latest approach, providing a first statistical analysis of the main emerging quantitative characteristic features, namely the diffusion maximum and the peak time for diffusion. We believe that also opinion models with other interaction mechanisms could benefit from a descriptive representation given through our scheme, constituted by an input network provided by Python rewiring and NetLogo simulations for the diffusion on these imported graphs.

This study differs from other diffusion studies involving ABM and networks because it allows to perform simulations on network that are definitely more complex than those employed in previous simulations. Namely, one can employ scale-free networks with any power-law exponent, networks with various kinds of assortative degree correlations, and potentially any networks which can be built using the configuration model for the degree distribution and Newman rewiring for the degree correlations. Moreover, the part of network generation as well as the part of agent-based simulation have been developed with powerful but standard free software which is extensively documented by a wide users community, and continuously expanded.

The main emerging behaviour that can be inferred from the results of the simulations concerns: (a) The peak time of diffusion in the total population, which depends in a complex way on the features of the single interactions. In fact, the results of the agent-based model differ from those of the mean-field approximation; the difference is more remarkable when the degree of the largest hub effectively present in the network is high (while in the mean-field approximation all degrees are ‘virtually present’, with a certain probability). (b) In the Mueller-Ramkumar model the emerging behaviour concerns mainly the total fraction of final adopters, which has been computed in dependence on the network parameters, as an average over many simulations.

The main results of the simulations are summarized in , where diffusion times are compared for assortative and uncorrelated networks and differential equation results are put together with the agent-based approach outcome. The findings for Mueller’s model are presented in , for both assortative and uncorrelated networks. This is useful for social network analysis, because social networks are typically assortative. The uncorrelated networks represents the most simplified model for diffusion and therefore constitute a baseline case for a comparative approach.

What this paper adds to social, economics, and market studies is, we believe, a new efficient technique for developing agent-based models. Concerning the issue of how decision makers would benefit of the proposed models, it is clear that the findings of this work can only be used in conjunction with results from other works more specialized on applications to economics, marketing and policy-making. Such applications are beyond our present scopes. A recent overview of strengths and criticism of agent-based modelling of new product market diffusion has been given in (Rand and Stummer Citation2021).

Acknowledgment

This work was financially supported by the Free University of Bolzano-Bozen with the research project NMCSYS-TN2815. G.M. is a member of INdAM (Istituto Nazionale di Alta Matematica). Open Access publication was supported by the Open Access Publishing Fund of the Free University of Bozen-Bolzano.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Funding

The work was supported by the Libera Università di Bolzano [NMCSYS-TN2815].

References

  • Amaral LAN, Scala A, Barthelemy M, Stanley HE. 2000. Classes of small-world networks. Proc Natl Acad Sci USA. 97(21):11149–11152. doi: 10.1073/pnas.200327197.
  • Bakshy E and Wilensky U. 2007. Netlogo-mathematica link. Center for connected learning and computer-based modeling, Evanston (IL): Northwestern University; [accessed 24 Oct 2011]. http://ccl.northwestern.edu/netlogo/mathematica.html
  • Banerjee A, Chandrasekhar AG, Duflo E, Jackson MO. 2013. The diffusion of microfinance. Science. 341(6144):1236498. doi: 10.1126/science.1236498.
  • Banisch S, Lima R, Araújo T. 2012. Agent based models and opinion dynamics as Markov chains. Soc Networks. 34(4):549–561. doi: 10.1016/j.socnet.2012.06.001.
  • Barbuto A, Lopolito A, Santeramo FG. 2019. Improving diffusion in agriculture: an agent-based model to find the predictors for efficient early adopters. Agric Econ. 7(1):1–12. doi: 10.1186/s40100-019-0121-0.
  • Barthélemy M, Barrat A, Pastor-Satorras R, Vespignani A. 2004. Velocity and hierarchical spread of epidemic outbreaks in scale-free networks. Phys Rev Lett. 92(17):178701. doi: 10.1103/PhysRevLett.92.178701.
  • Barthélemy M, Barrat A, Pastor-Satorras R, Vespignani A. 2005. Dynamical patterns of epidemic outbreaks in complex heterogeneous networks. J Theor Biol. 235(2):275–288. doi: 10.1016/j.jtbi.2005.01.011.
  • Bass FM. 1969. A new product growth for model consumer durables. Manage Sci. 15(5):215–227. doi: 10.1287/mnsc.15.5.215.
  • Bertotti ML, Brunner J, Modanese G. 2016a. The bass diffusion model on networks with correlations and inhomogeneous advertising. Chaos, Solitons Fractals. 90:55–63. doi: 10.1016/j.chaos.2016.02.039.
  • Bertotti ML, Brunner J, Modanese G. 2016b. Innovation diffusion equations on correlated scale-free networks. Phys Lett A. 380(33):2475–2479. doi: 10.1016/j.physleta.2016.06.003.
  • Bertotti ML, Modanese G 2019. The bass diffusion model on finite barabasi-albert networks. Complexity. 2019:6352657. doi: 10.1155/2019/6352657.
  • Bertotti ML, Modanese G. 2020. Network rewiring in the r-K plane. Entropy. 22(6):653. doi: 10.3390/e22060653.
  • Boguñá M, Pastor-Satorras R2002. Epidemic spreading in correlated complex networks. Phys Rev E. 66(4):047104. doi: 10.1103/PhysRevE.66.047104.
  • Boguñá M, Pastor-Satorras R, Vespignani A. 2003a. Absence of epidemic threshold in scalefree networks with degree correlations. Phys Rev Lett. 90(2):028701. doi: 10.1103/PhysRevLett.90.028701.
  • Boguñá M, Pastor-Satorras R, Vespignani A. 2003b. Epidemic spreading in complex networks with degree correlations. In: Statistical mechanics of complex networks. Berlin/Heidelberg: Springer-Verlag; p. 127–147.
  • Boguñá M, Pastor-Satorras R, Vespignani A. 2004. Cut-offs and finite size effects in scale-free networks. Eur Phys J B. 38(2):205–209. doi: 10.1140/epjb/e2004-00038-8.
  • Bohlmann JD, Calantone RJ, Zhao M. 2010. The effects of market network heterogeneity on innovation diffusion: an agent-based modeling approach. J Prod Innovation Manage. 27(5):741–760. doi: 10.1111/j.1540-5885.2010.00748.x.
  • Centola D, Eguíluz VM, Macy MW. 2007. Cascade dynamics of complex propagation. Physica A. 374(1):449–456. doi: 10.1016/j.physa.2006.06.018.
  • Dawid H. 2006. Agent-based models of innovation and technological change. Handb Comput Econ. 2:1235–1272.
  • Delre SA, Jager W, Bijmolt TH, Janssen MA. 2007. Targeting and timing promotional activities: an agent-based model for the takeoff of new products. J Bus Res. 60(8):826–835. doi: 10.1016/j.jbusres.2007.02.002.
  • Delre SA, Jager W, Bijmolt TH, Janssen MA. 2010. Will it spread or not? the effects of social influences and network topology on innovation diffusion. J Prod Innovation Manage. 27(2):267–282. doi: 10.1111/j.1540-5885.2010.00714.x.
  • Delre SA, Jager W, Janssen MA. 2007. Diffusion dynamics in small-world networks with heterogeneous consumers. Comput Math Organ Th. 13(2):185–202. doi: 10.1007/s10588-006-9007-2.
  • Di Lucchio L, Modanese G. 2024. Generation of scale-free assortative networks via newman rewiring for simulation of diffusion phenomena. Stats. 7(1):220–234. doi: 10.3390/stats7010014.
  • Garcia R. 2005. Uses of agent-based modeling in innovation/new product development research. J Prod Innovation Manage. 22(5):380–398. doi: 10.1111/j.1540-5885.2005.00136.x.
  • Guidolin M. 2023. Innovation diffusion models: theory and practice. Hoboken, New Jersey: John Wiley & Sons.
  • Hagberg A, Swart P, and Chult DS. 2008. Exploring network structure, dynamics, and function using NetworkX. Tech. rep., Los Alamos (NM) (United States):Los Alamos National Lab.(LANL).
  • Hardiman SJ, Richmond P, Hutzler S. 2009. Calculating statistics of complex networks through random walks with an application to the on-line social network Bebo. Eur Phys J B. 71(4):611–622. doi: 10.1140/epjb/e2009-00292-2.
  • Henry AD, Brugger HI. 2017. Agent-based explorations of environmental consumption in segregated networks. In: Social Systems Engineering: The Design of Complexity. John Wiley and Sons; p. 197–214.
  • Holme P, Zhao J. 2007. Exploring the assortativity-clustering space of a network’s degree sequence. Phys Rev E. 75(4):046111. doi: 10.1103/PhysRevE.75.046111.
  • Jaxa-Rozen M, Kwakkel JH. 2018. Pynetlogo: linking NetLogo with Python. J Artif Soc Soc Simul. 21(2). doi: 10.18564/jasss.3668.
  • Jiang Z, Jain DC. 2012. A generalized Norton–bass model for multigeneration diffusion. Manage Sci. 58(10):1887–1897. doi: 10.1287/mnsc.1120.1529.
  • Kiesling E, Günther M, Stummer C, Wakolbinger LM. 2012. Agent-based simulation of innovation diffusion: a review. Cent Eur J Oper Res. 20(2):183–230. doi: 10.1007/s10100-011-0210-y.
  • Kotthoff F, Hamacher T. 2022. Calibrating agent-based models of innovation diffusion with gradients. J Artif Soc Soc Simul. 25(3). doi: 10.18564/jasss.4861.
  • Mueller M, Ramkumar S. 2023. Signed networks-the role of negative links for the diffusion of innovation. Technol Forecast Soc. 192:122575. doi: 10.1016/j.techfore.2023.122575.
  • Norton JA, Bass FM. 1987. A diffusion theory model of adoption and substitution for successive generations of high-technology products. Manage Sci. 33(9):1069–1086. doi: 10.1287/mnsc.33.9.1069.
  • Pastor-Satorras R, Castellano C, Van Mieghem P, Vespignani A. 2015. Epidemic processes in complex networks. Rev Mod Phys. 87(3):925. doi: 10.1103/RevModPhys.87.925.
  • Pastor-Satorras A, Vespignani R. 2001. Epidemic dynamics and endemic states in complex networks. Phys Rev E. 63(6):066117. doi: 10.1103/PhysRevE.63.066117.
  • Pastor-Satorras A, Vespignani R. 2002. Epidemic dynamics in finite size scale-free networks. Phys Rev E. 65(3):035108. doi: 10.1103/PhysRevE.65.035108.
  • Pastor-Satorras A, Vespignani R. 2004. Evolution and structure of the internet: a statistical physics approach. Cambridge, UK: Cambridge University Press.
  • Peres R, Muller E, Mahajan V. 2010. Innovation diffusion and new product growth models: a critical review and research directions. Int J Res Mark. 27(2):91–106. doi: 10.1016/j.ijresmar.2009.12.012.
  • Platt EL. 2019. Network science with python and NetworkX quick start guide: explore and visualize network data effectively. Birmingham: Packt Publishing Ltd.
  • Ramkumar S, Mueller M, Pyka A, Squazzoni F. 2022. Diffusion of eco-innovation through inter-firm network targeting: an agent-based model. J Cleaner Prod. 335:130298. doi: 10.1016/j.jclepro.2021.130298.
  • Rand W, Stummer C. 2021. Agent-based modeling of new product market diffusion: an overview of strengths and criticisms. Ann Oper Res. 305(1):425–447. doi: 10.1007/s10479-021-03944-1.
  • Rogers E. 2010. Diffusion of innovations. New York, USA: Simon and Schuster.
  • Sahneh FD, Scoglio C, Van Mieghem P. 2013. Generalized epidemic mean-field model for spreading processes over multilayer complex networks. IEEE/ACM Trans Netw. 21(5):1609–1620. doi: 10.1109/TNET.2013.2239658.
  • Schramm ME, Trainor KJ, Shanker M, Hu MY. 2010. An agent-based diffusion model with consumer and brand agents. Decis Support Syst. 50(1):234–242. doi: 10.1016/j.dss.2010.08.004.
  • Sklar E. 2007. Netlogo, a multi-agent simulation environment. Artif Life. 13(3):303–311. doi: 10.1162/artl.2007.13.3.303.
  • Son S, Choi EJ, Lee SH. 2023. Revisiting small-world network models: exploring technical realizations and the equivalence of the Newman–watts and Harary models. J Korean Phys Soc. 83(11):879–889. doi: 10.1007/s40042-023-00921-8.
  • Tam WM, Lau FC, and Tse CK. 2008. Construction of scale-free networks with adjustable clustering. Proceedings of 2008 International Symposium on Nonlinear Theory and its Applications; Sep 7–10; NOLTA’08, Budapest, Hungary. p. 257–260.
  • Thiele JC, Kurth W, Grimm V. 2012. Agent-based modelling: tools for linking NetLogo and R. J Artif Soc Soc Simul. 15(3):8. doi: 10.18564/jasss.2018.
  • Tur EM, Zeppini P, Frenken K. 2018. Diffusion with social reinforcement: the role of individual preferences. Phys Rev E. 97(2):022302. doi: 10.1103/PhysRevE.97.022302.
  • Van Eck PS, Jager W, Leeflang PS. 2011. Opinion leaders’ role in innovation diffusion: a simulation study. J Prod Innovation Manage. 28(2):187–203. doi: 10.1111/j.1540-5885.2011.00791.x.
  • Watts DJ, Dodds PS. 2007. Influentials, networks, and public opinion formation. J Consum Res. 34(4):441–458. doi: 10.1086/518527.

Appendix:

Main Features of Netlogo Simulations

NetLogo is a free simulation software for agent-based models, widely used in the social and economic sciences (Sklar Citation2007). The transition rules which define the behavior of the agents can be set with a high degree of flexibility. We gave in (Di Lucchio and Modanese Citation2024) a first example of agent dynamics corresponding to the classical network Bass model, with a suitable renormalization of the imitation coefficient q in order to allow comparison among different network topologies.

In the simulation one can distinguish between adoptions due to network/social effects (the Bass q-term) and those due to “broadcast” effects (the Bass “advertising” p-term). The values of the p and q parameters are fixed as global variables, or global. In the setup part of the code the agents are defined, with possible states of adopter or non-adopter. In the network setup part, the procedures create-network and make-node create the new nodes and attach them to the existing nodes according to the prescriptions for Barabasi-Albert networks (only of type-1, i.e., with one link for each new node), Erdös-Renyi random networks or simple ring small-world networks. In the graphical interface, a visualization layout is generated; alternatively, one can import arbitrary networks in graphml format, as explained below. The number of initial adopters (“seed”) can be chosen in the user interface, in addition to the total number of agents, or population, and to the parameters of social influence and broadcast influence.

The adopt procedure for social influence adoptions starts with a count of the number k of nearest neighbors of each node in the network; if the agent on this node has not yet adopted, it adopts with a probability equal to qk/k, where k is the network average of k. The adopters change color in the graphical interface and their total is updated and represented as a function of time (i.e., of the number of steps or “ticks”), to build a typical S-shaped curve.

The derivative of the S curve cannot be directly obtained; however, it is possible to manipulate the data produced by the model through the use of extension modules and connectors. Two well-known available connectors are the Mathematica (Bakshy and Wilensky Citation2007). and R (Thiele and Kurth Citation2012) Python tools. Here the PyNetLogo connector was used (Jaxa and Kwakkel Citation2018), namely a library that allows to control NetLogo by means of the Python programming language. PynetLogo can be called from a main program in order to launch a simulation and to do some straightforward statistical analysis. To this end, one further needs the package ctype, for wrapping the dll libraries and calling functions in shared libraries, and the module os, in order to import the environment variable corresponding to JAVA_HOME. Also PyNetLogo must be imported and the command netlogo = pynetlogo.NetLogoLink(gui=False) uses the script core.py in PyNetLogo to create a link with NetLogo. Underneath, the NetLogo JVM is accessed through JPype. Once the link with the Java Machine is established, the command netlogo.load_model allows to open the file with the NetLogo code. The netlogo.command line can be used to start the setup and create-network procedures. One example was shown in (Di Lucchio and Modanese Citation2024) and is available at https://github.com/Ladilu/python-bass-accessible. Then, the netlogo.repeat_report command is used for returning the desired data (in our case, the number of agents that have adopted) from NetLogo to the Python workspace. This action can be repeated for a certain number of ticks of the simulation. Some basic examples, not related to the current study, are available at https://pynetlogo.readthedocs.io/en/latest/.

In our case the duration of the simulation has been set to 100 ticks, well beyond the saturation of the diffusion curve. Then the result is transformed into a pandas data-frame and the derivative of the curve is obtained by the diff method. In this way one can identify the adoption peak time tmax, namely the time at which the number of new adoptions per unit time reaches its maximum. This quantity is useful for characterizing the Bass diffusion process when there are no initial adopters. Such a characterization is not possible in the pure SI model, in which being the p-term absent, diffusion does not start without an initial seed. Therefore in the SI model the peak time depends strongly on the initial conditions and cannot be easily put in relation, e.g., to the network topology.

For a random graph the network setup is different. The procedure wire4 creates the links with a probability set in the user interface. A window in the user interface displays a list of the nodes’ degrees and can be programmed to show the average degree. For importing an external graph, e.g. in the case of scale-free assortative networks, an extension of the software is needed called nw extension, with the command nw:load-graphml. See code examples at https://github.com/Ladilu/Mueller_Bass_accessible.