Modelling complex market interactions using PDP systems

  • Eduardo Sánchez-Karhunen
  • Luis Valencia-CabreraEmail author
Regular Paper


Last decade has witnessed an increasing effort on modelling and simulation of phenomena within a wide range of areas such as Biochemistry, Ecology, Robotics or Engineering by using membrane computing, providing solutions for relevant problems (signalling pathways, population dynamics, robot control or fault diagnosis, among others). However, for no apparent reasons, other areas have not been investigated to such extent. This is the case of computational economics, where Gh. and R. Păun explored the so-called producer–retailer problem and, in a foundational paper, proposed an initial model making use of membrane computing modelling tools. In the present paper, we design a solution based on population dynamics P systems for an enriched version of that problem. This enhanced model, closer to reality, takes into account several economic issues not considered in the initial model, including: depreciation of production capacity, decision mechanism to increase manufacturing capability, dividends payment and costs associated to production factors. Additionally, the model has been simulated making use of the framework provided by P-Lingua and MeCoSim, and delivering a custom application based on them to reproduce the virtual experiments. Finally, several scenarios have been analysed focusing on different elements included in the model.


Membrane computing Economy Producer–retailer problem Computational modelling Population dynamics P systems 

1 Introduction

The main goal of this paper is to continue extending the success obtained by membrane computing as a modelling tool in different fields (see [2, 3], among others) to a less explored one, namely computational economics. Soon after an initial paper opening the topic [13], few others continued the initial exploring, with approaches as numerical P systems [14] or membrane systems with attributes [8]. However, no further significant attention was paid to this line along the last decade, so this paper aims to regain that focus, deepening into its study.

In the foundational paper [13], generic multiset rewriting rules were proposed for modelling some economic processes associated to the so-called producer–retailer problem. More specifically, it involved the reception of orders from consumers, the production of goods from raw material and the purchase of transactions.

Taking advantage of the latest developments on population dynamics P systems (PDP systems [6], for short), and in order to reinforce the interest in computational economics as a promising research path within the applications of membrane computing, the present paper proposes a model based on PDP systems for an enriched version of the previous producer–retailer problem. This model extends the basic model considered in the previous works, including different economic issues not considered before. All these aspects make the model much closer to real situations. More specifically, it is assumed the presence of a capital market (costs associated to production factors, capacity increase decision mechanisms, depreciation of such production capacity and dividends payment). These elements are explained in detail in Sect. 3, right after introducing some prerequirements setting the context of this work in Sect. 2. The formalization of the model is then presented in Sect. 4. Later, in Sect. 5, the simulation results for different scenarios are discussed. Finally, the main conclusions of this work are outlined in Sect.  6.

2 Preliminaries

This section starts introducing the topic of computational modelling, discussing benefits and drawbacks of some widely spread approaches, such as ordinary differential equations. Then PDP systems are described, this being the choice made in the framework of membrane computing to model the economic processes presented in the following sections.

2.1 Modelling approaches

Traditionally, ordinary differential equations have been the main modelling tool for biological systems. Several drawbacks are associated to this family of techniques: (a) the complexity of the resulting models prevents from using exact solutions, requiring numerical approaches; (b) the introduction of new variables or any other modification, improvement or extension of the model usually requires a reconstruction of the model from scratch and (c) difficulties arise if the processes modeled present a strong discrete nature or the number of copies of the objects involved is small.

On the contrary, membrane computing [12, 16] presents a more recent approach, showing several advantages for modelling biological and non-biological systems. From the interaction of the elements of this modelling framework (objects, membranes, multisets and evolution rewriting rules) it arises a modelling tool with a high degree of generality applicable to many different situations. This framework captures the idea of modularity or extension, allowing the gradual addition or modification of evolution rules or even changes in the membrane structure in a relatively easily way, without changing the type of P system. Besides, parallelism is introduced in a natural way in the model, allowing the operation of multiple elements simultaneously, and there are no limits to the number of variables interacting simultaneously.

The following section will present PDP systems, used to model the phenomena studied along this work.

2.2 Population dynamics P systems

PDP systems (population dynamics P systems) were developed to overcome some known limitations found in previous approaches, as described in [4]. Formally, a PDP system of degree (qm) and \(T \ge 1\) units of time is a tuple \(\varPi =(G,\varGamma ,\varSigma ,T,\{\varPi _{k}: 1 \le k \le m\},\{E_j: 1 \le j \le m\}, R_\text {E})\), where:
  • \(G=(V,S)\) is a directed graph with \(m \ge 1\) nodes, \(V=\{e_1,\ldots ,e_m\}\), \( S \subseteq V \times V\).

  • \(\varGamma \) and \(\varSigma \) are alphabets such that \(\varSigma \subsetneq \varGamma \).

  • \(T \ge 1\) is a natural number.

  • \(\forall k, 1 \le k \le m, \varPi _k =(\varGamma ,\mu ,M_1,\ldots ,M_q,{\mathcal {R}},i_{\text {in}})\), where:
    • \(\mu \) is a rooted tree with \(q \ge 1\) nodes labelled with elements of \(\{1,\ldots ,q\} \times \{0,+,-\}\).

    • \(\forall i, 1 \le i \le q, M_i \in M_f(\varGamma )\) (i.e., they are finite multisets over \(\varGamma \)).

    • \({\mathcal {R}}\) is a finite set of (skeleton) rules, of the type:
      $$\begin{aligned} u[v]_i^\alpha {\mathop {\longrightarrow }\limits ^{\scriptstyle {p}}} u'[v']_i^{\alpha '} \end{aligned}$$
      where \(u,v,u',v' \in M_f (\varGamma ), 1 \le i \le q, \alpha ,\alpha ' \in \{0,+,-\}\), and p is a probability function with domain \(\{0,\ldots ,T\}\). The sum of probabilities of rules whose left hand side (LHS) is \(u[v]_i^\alpha \) is 1 at each instant \(t \, (0 \le t \le T)\).
    • \(i_{\text {in}}\) is a node of \(\mu \).

  • \(\forall j, 1 \le j \le m, E_j \in M_f (\varSigma )\).

  • \(R_\text {E}\) is a finite set of environment rules of the type:
    $$\begin{aligned} (x)_{e_j} {\mathop {\longrightarrow }\limits ^{\scriptstyle {p_1}}} (y_1)_{e_{j_1}},\ldots ,(y_h)_{e_{j_h}} \end{aligned}$$
    where \(x,y_1,\ldots ,y_h \in \varSigma , \{(e_{j},e_{j_i})\in S, 1 \le j \le m, 1 \le i \le h\}\) (object x in environment j is consumed, and sent to \(h \le q\) environments), and \(p_1\) is a probability function with domain \(\{0,\ldots ,T\}\). Also, at each instant \(t \, (0 \le t \le T)\), the sum of all probability function values associated to rules whose LHS is \((x)_{e_j}\) must be 1.
  • There are no skeleton rules conflicting with rules of the environment; i.e., there is no simultaneous occurrence of PDP system skeleton rules \(u[v]_i^\alpha {\mathop {\longrightarrow }\limits ^{\scriptstyle {p}}} u'[v']_i^{\alpha '}\) in the skin membrane of a system \(\varPi _k\) and environment rules of the type \((x)_{e_j} {\mathop {\longrightarrow }\limits ^{\scriptstyle {p_1}}} (y_1)_{e_{j_1}},\ldots ,(y_h)_{e_{j_h}}\), such that \(x \in u\).

  • Each environment \(e_j\) contains exactly one system \(\varPi _k\).

A PDP system \(\varPi \) of degree (qm) can be viewed as a system presenting m environments \(e_1,\ldots ,e_m\) interconnected by edges of a directed graph G. Each of these environments \(e_j\) can only contain symbols of alphabet \(\varSigma \), and a unique ordinary P System \(\varPi _k=(\varGamma ,\mu ,M_1,\ldots ,M_q,{\mathcal {R}},i_{\text {in}})\) with the same skeleton inside each environment, but such that the initial multisets of \(\varPi _k\) depend on \(e_j\) and the probability functions associated with rules of \(\varPi _k\) depend on \(e_j\). Finally, the semantics of PDP systems (the way the different rules are used) depends on the simulation algorithm.

2.3 Economic processes modelling

Differential equation systems have been traditionally used for modelling economic processes. Although these techniques are predominant, many efforts have been made to investigate other modelling techniques such as multi-agent systems [7]. Due to the good performance of membrane computing for modelling the dynamics of biological systems, several attempts have been made to follow this approach in modelling economic processes [1, 8, 10, 11, 13, 14, 15].

Comparing economic and biological processes, a parallelism can be identified between them (see [13]). An economic interpretation can be assigned to different elements of the membrane computing models. The objects in a multiset can represent elements of different nature: monetary units, goods, authorization for transactions, depreciation representation or even production capacities. Membranes can be entities such as producers, consumers, markets or generic places for transactions. Multiset rewriting rules can model a huge variety of processes such as purchase transactions, production of goods or depreciation phenomena involving objects coming from a different or the same membrane.

3 Enhanced producer–retailer model

This section will explore in certain detail the interactions taking place in the reference problem known as the “producer–retailer” problem.

3.1 General description

Informally, the producer–retailer problem can be described as a one good market with several players interacting with each other. In this scenario, a set of producers \(P_i\) transform raw material a produced by a generic source S into units of good d, and a set of retailers \(R_j\) receive orders \({\bar{d}}\) from a generic consumer C. The producers and the retailers try to match units of d with units of \({\bar{d}}\) by means of transactions.

Each player is characterized by a parameter: \(P_i\) has a production capacity, \(R_j\) has a storage capacity, S has a raw material production rate and C has also a demand \({\bar{d}}\) generation rate. Each of these transactions implies the exchange of monetary units associated to the existence of prices. Thus, \(u_S\) represents a monetary unit owned by S. This money has been obtained from \(P_i\), who paid a price for each unit of a. Similarly, \(u_i\) stands for a monetary unit owned by \(P_i\), obtained from \(R_j\), who paid a price for each unit of d. Likewise, certain units of \(v_j\) are owned by \(R_j\), who paid a price for each unit of \({\bar{d}}\). Finally, units represented by object \(u_C\) are owned by C.

Simultaneously, there exist budget restrictions associated to the total number of monetary units owned by each player, introducing the possibility of lack of money, hence making impossible to apply certain rules. Real economy dynamically adjusts its parameters internally to maintain its activity cycle after cycle. Therefore, to get our model closer to real situations, more aspects must be modelled. Firstly, variations of \(P_i\)’s and \(R_j\)’s capacities will be allowed (associated to capital stock depreciation and investment decisions). Secondly, a cyclic monetary flow in the systems will be considered and sources of randomness will be added.

This model is represented in Fig. 1, using circles for players, and double arrow lines for transactions between them.
Fig. 1

Schematic representation of enhanced producer–retailer problem

3.2 Production side

In economic theory, the number \(Y_i\) of goods produced by \(P_i\) is a function \(f_i\) (production function) of the so-called factors of production that specifies how factors are transformed into goods. These factors are the physical inputs used in the production process. Typically, they are classified into three main categories: raw material, labour of workers and capital stock.

For simplicity, we make some assumptions. All \(P_i\) have access to the same technology, thus they share the same production function: \(\forall i (f_i=f)\). Again for the sake of simplicity, labour is not considered as a factor in our model, obtaining the following production function: \(Y_i=f({\text {raw}}\_{\text {material}},{\text {capital}}_i)=f(a,b_i)\), where a represents the total amount of raw material available for production and \(b_i\) represents the total production capacity of \(P_i\). Additionally, we also consider the simplest form for f, where only one unit of a and \(b_i\) are consumed to produce one unit of d. This exchange rate can be easily changed to consider more complex situations.

3.3 Demand side

In the context of the so-called al behaviour model, each individual consumer tries to maximize a utility function \(U_i\). This \(U_i\) quantifies in monetary units the happiness of individuals, associated to their preferences about the simultaneous consumption of multiple disposable goods. Utility is a function of the units of good d obtained (consumption) and the cost of opportunity of time not dedicated to work (leisure): \(U_i=U_i (\text {consumed}\_\text {inputs}) = U_i (\text {consumption,leisure})\).

For simplicity, we make some assumptions. Labour (as complementary to leisure) is not considered in our model. Besides, all consumers have the same utility function (same preferences or standardized behaviour) \(\forall i (U_i=U)\). This gives rise to the concept of representative consumer, that we can model as a generic consumer C. We can, therefore, calculate the sum of the utility functions of all the consumers, obtaining a so-called aggregate demand of d (each unit is denoted by \({\bar{d}}\)). Thus, it is obtained a simplified utility function: \(U_i=U=g({\bar{d}})\).

3.4 Ownership of production factors and stakeholders

In macroeconomic models, factors are property of the aggregate consumer C. Thus, \(P_i\) (and \(R_j\) as intermediate producers) must hire these factors out from its owners paying an amount of money for them (producer’s costs). This will be modeled as costs associated to production capacities.

Typically, C is a stakeholder for \(P_i\) and \(R_j\). Therefore, C expects to receive dividends depending on the benefits obtained by \(P_i\) and \(R_j\). Benefits not distributed remain in the company allowing to pay costs of factors. The initial number of monetary units owned by \(P_i\) and \(R_j\) can be interpreted as the initial investment of C. Finally, to make our system closed, C must also be stakeholder of S. For simplicity, S generates units of a without any production capacity (no production costs).

With the elements mentioned above, multiple monetary flows get enabled: from \(u_i\) and \(v_j\), then to \(u_C\), and from \(u_S\) to \(u_C\). This implies additional flows with respect to those, previously considered, associated to the transactions between \(P_i\), \(R_j\), S and C.

3.5 Investment decision-capacity increase

Each \(P_i\) has to decide what to do with the surplus obtained after purchasing transactions. This is known as the investment—saving decision. There are two possible choices: (1) to dedicate part of it to accumulate more production capacity (i.e., making the choice of capital stock increase); or (2) to keep capacity unchanged, leaving earnings accumulated as savings. This decision should be based on specific facts, and the model to design should detect situations as the lack of production capacity (in these case, capacity should be increased) or the excess of goods (so that capacity should remain unchanged).

3.6 Capital stock depreciation

In macroeconomic theory, there exists a phenomenon suffered by capital stock called depreciation. Typically, it is modeled as: \(K_t=K_{t-1}-D_{t-1}+I_t\), where: \(K_t\) is the capital stock value (production capacity) at time t; \(K_{t-1}\) is the capacity at time \(t-1\); \(D_{t-1}\) is the depreciation of \(K_{t-1}\) and \(I_t\) is the investment at time t. For simplicity, we assume a constant depreciation rate \(\delta \), such that \(D_{t-1}= \delta K_{t-1}\). Thus, the previous equation can be written as: \(K_t= (1-\delta ) K_{t-1}+I_t\). In our model, depreciation is considered as a fixed reduction of the multiplicity of \(b_i\). Therefore, unless we have a mechanism for increasing capacity, after a finite period of time, production capacity will be exhausted.

4 Model formalization

In this section the formalization of the model is described, along with the interpretation of the elements included, parameters involved and an analysis of the different modules of rules taking part in the evolution of the system.

The PDP system designed has a single environment containing a P system with two membranes: membrane 1, mainly used for the operations of goods and orders generation corresponding to the different \(R_j\) and \(P_i\), and membrane 2, mostly devoted to perform the purchase transactions. Formally, this defines a family of PDP systems of degree (2, 1) and \(T \ge 1\) units of time
$$\begin{aligned}\varPi =(G,\varGamma ,\varSigma ,T,\{\varPi _1\},R_\text {E})\end{aligned}$$
  • \(G=(V,E)\), with \(V=\{e_1\}\) and \(E=\{(e_1,e_1)\}\).

  • \(\varGamma =\{b_i,d_i,u_i,c_j,{\bar{d}}_j,v_j,{\bar{e}}_j,f_{j,i},g_i,y_i,z_i,m_i,h_i: 1 \le i \le k_1, 1 \le j \le k_2 \} \cup \{R_1\} \cup \{C,S,{\bar{d}},a,u_C,p,q\}\).

  • \(\varSigma =\emptyset \).

  • \(\varPi _1=(\varGamma ,\mu ,M_1,M_2,{\mathcal {R}}_{\varPi _1},i_{\text {in}})\), where
    • \(\mu = [ [ \, ]_2 ]_1\).

    • \(M_1=\{C,S,R_1\}\cup \{g_i,u_i^{7 k_{i,1}k_{10}}:1\le i\le k_1\}\cup \{v_j^{7 k_{j,3}k_{10}}:1\le j\le k_2\}\).

    • \(M_2=\{c_j^{k_{j,3}}: 1\le j\le k_2 \}\cup \{b_i^{k_{i,1}}: 1\le i\le k_1\}\).

    • \(i_{\text {in}}\).

    • \({\mathcal {R}}_{\varPi _1}\) is described in Sect. 4.2, Modules of rules.

  • \(R_\text {E}=\emptyset \).

As we can see in the definition above, the model presented is parameterized, thus instantiating a specific PDP system for each combination of values for the parameters (see Sect. 4.1 for their description). On the other hand, in order to understand the model, the symbols appearing in the alphabet of the system must be defined:
  • C: aggregate generic consumer.

  • S: raw material supplier.

  • a: unit of supplied raw material provided by S.

  • p: randomness generator for a provision by S.

  • \({\bar{d}}\): unit of aggregate demand from C.

  • q: randomness generator for \({\bar{d}}\) generation by C.

  • \(u_C\): monetary unit owned by C.

  • \(b_i\): unit of production capacity of \(P_i\), \(1 \le i \le k_1\).

  • \(h_i\): unit of production capacity of \(P_i\) before depreciation, \(1 \le i \le k_1\).

  • \(d_i\): unit of good supplied by \(P_i\), \(1 \le i \le k_1\).

  • \(u_i\): monetary unit owned by \(P_i\), \(1 \le i \le k_1\).

  • \(c_j\): unit of capacity of \(R_j\), \(1 \le j \le k_2\).

  • \({\bar{d}}_j\): unit of good demanded by \(R_j\), \(1 \le j \le k_2\).

  • \(v_j\): monetary unit owned by \(R_j\), \(1 \le j \le k_2\).

  • \({\bar{e}}_j\): units demanded by \(R_j\) and authorized for transaction, \(1 \le j \le k_2\).

  • \(f_{i,j}\): authorization for \({\bar{d}}_j\) to be exchanged with \(d_i\), \(1 \le i \le k_1\), \(1 \le j \le k_2\).

  • \(y_i\): unit (in idle state) of aborted purchase transactions considered for capacity increase, \(1 \le i \le k_1\).

  • \(m_i\): randomness generator for \(y_i\), \(1 \le i \le k_1\).

  • \(z_i\): activated unit of aborted purchase transactions considered for capacity increase, \(1 \le i \le k_1\).

  • \(R_1\): for technical reasons.

  • \(g_i\): for technical reasons, \(1 \le i \le k_1\).

As mentioned above, the specific PDP system to instantiate from the schema presented in this work will depend on the specific values of a series of parameters included in the definition. Their description is provided in the next section.

4.1 Model parameters

  • \(k_1\): total number of producers.

  • \(k_2\): total number of retailers.

  • \(k_3\): raw material inserted into the system by S—min value of range.

  • \(k_4\): raw material inserted into the system by S—max value of range.

  • \(k_5\): aggregate demand inserted into the system by C—min value of range.

  • \(k_6\): aggregate demand inserted into the system by C—max value of range.

  • \(k_7\): price fixed by S for each unit of a.

  • \(k_8\): failed purchases considered for increasing capacity—min value.

  • \(k_9\): failed purchases considered for increasing capacity—max value.

  • \(k_{10}\): cost of capital stock per cycle.

  • \(k_{11}\): depreciation rate of capital stock.

  • \(k_{12}\): step of capacity increase.

  • \(k_{13}\): dividend percentage.

  • \(k_{i,1}\): initial production capacity of \(P_i\), \(1 \le i \le k_1\).

  • \(k_{i,2}\): price fixed by \(P_i\) for each unit of \(d_i\), \(1 \le i \le k_1\).

  • \(k_{j,3}\): initial capacity of \(R_j\), \(1 \le j \le k_2\).

  • \(k_{j,6}\): price fixed by \(R_j\)\(\underline{\hbox {for each order of good } j}\), \(1 \le j \le k_2\).

4.2 Modules of rules

Along this section, the main modules of rules taking part in the PDP system designed are explained. However, before entering into details about each particular module, a brief explanation about the way certain randomness is included in some sets of rules is provided.

4.2.1 Introducing randomness in the model

An elegant “PDP-way” of generating randomness in rewriting rules is proposed. Consider the following generic set of rules:

\([ s ] \rightarrow [ s a^{N-L} w^{2L} ]\)        \([ w ] \xrightarrow {0.5} [ \# ]\)        \([ w ] \xrightarrow {0.5} [ a ]\)

Its aim is to generate approximately N units of object a in the range \([a^{N-L},a^{N+L}]\). First, we generate \(a^{N-L} w^{2L}\), thus guaranteeing that at least a number of objects a equals to the lower limit of the range is generated. Secondly, two possible rules are applied to this new symbol w, each one with probability 0.5, transforming w into one unit of a or clearing it. This introduces the random effect introducing variation among different executions of the system, what may lead to any number of objects a within the interval above. In our model, this strategy will be used at the beginning of each cycle to produce an amount of a generated by S, and similarly to generate a number of objects \({\bar{d}}\) produced by C; the same technique will also be applied in the investment decision mechanism. Further developments of the model could consider more sources of variability, possibly involving prices, probabilities of performing transactions between \(P_i\) and \(R_j\), etc.

4.2.2 Module 1: Production factor and demand generation

This module generates the initial conditions of the cycle: ensures raw material availability and restores aggregate demand. The generation of a and \({\bar{d}}\) is randomized using p (respectively, q) to control the range \([k_3,k_4]\) (respectively, \([k_5,k_6]\)) of possible values of a (respectively, \({\bar{d}}\)). The generation of a and \({\bar{d}}\) is unified in a single rule, but rules on p and q remain separated, allowing their independent random behaviour. This operation can be performed with a simple set of rules:
$$\begin{aligned}r_{1} \equiv R_1 s c \, [ \, ]_2^- \rightarrow a^{k_3} p^{k_4-k_3} {\bar{d}}^{k_5} q^{k_6-k_5} s c \, [ \, ]_2^+\end{aligned}$$
$$\begin{aligned} \begin{array}{ccc} \begin{array}{rcl} r_{2} &{} \equiv &{} p \, [ \, ]_2^- \xrightarrow {p=0.5} a \, [ \, ]_2^+ \\ r_{3} &{} \equiv &{} p \, [ \, ]_2^- \xrightarrow {p=0.5} [ \, ]_2^+ \end{array} &{} &{} \begin{array}{rcl} r_{4} &{} \equiv &{} q \, [ \, ]_2^- \xrightarrow {p=0.5} [ \, ]_2^+ \\ r_{5} &{} \equiv &{} q \, [ \, ]_2^- \xrightarrow {p=0.5} {\bar{d}} \, [ \, ]_2^+ \end{array} \end{array} \end{aligned}$$

4.2.3 Module 2: Producer’s costs

The idea of C’s property of factors implies that \(R_j\) and \(P_i\) must pay, at the beginning of each cycle, for their capacities. \(P_i\) must pay a price for each unit of \(b_i\) used, reducing the \(u_i\) owned by \(P_i\) and increasing the \(u_C\) owned by C. Similarly, for each unit of \(c_i\) used by \(R_j\) it must pay a price, reducing the \(v_j\) owned by \(R_j\) and increasing the \(u_C\) owned by C. In the case that \(R_j\) and \(P_i\) are not able to pay for their capacities, they must give up using them and restore the value of each of these capacity units to their proprietaries via \(u_C\) units. For simplicity, a unique cost parameter \(k_{10}\) has been considered for both capacities.
$$\begin{aligned}&r_{9} \equiv u_i^{k_{10}} \, [ b_i ]_2 \rightarrow b_i u_C^{k_{10}} \, [ \, ]_2^+, 1 \le i \le k_1 \\&r_{10} \equiv v_j^{k_{10}} \, [ c_j ]_2 \rightarrow c_j u_C^{k_{10}} \, [ \, ]_2^+, 1 \le j \le k_2 \\&r_{11} \equiv [ b_i ]_2^+ \rightarrow u_C^{k_{10}} [ \, ]_2, 1 \le i \le k_1\\&r_{12} \equiv [ c_j ]_2^+ \rightarrow u_C^{k_{10}} [ \, ]_2, 1 \le j \le k_2 \end{aligned}$$

4.2.4 Module 3: Producer’s and retailer’s operations

In the case of producers, they must pay a price for each unit of a consumed (\(k_7\) monetary units), reducing the number of \(u_i\) owned by \(P_i\) and increasing the corresponding \(u_C\) units owned by C. Similarly, in the case of retailers, for each unit of \({\bar{d}}\) ordered by C to \(R_j\) it must pay a price \(k_{j,6}\) (each retailer can fix a different price), reducing the number of \(u_C\) units owned by C and increasing the corresponding \(v_j\) owned by \(R_j\). Finally, the units of capacity not consumed is transferred from membrane 1 to membrane 2, waiting for later depreciation steps.
$$\begin{aligned} \begin{array}{rcl} r_{14} &{} \equiv &{} a b_i u_i^{k_7} [ \, ]_2^+ \rightarrow u_C^{k_7} [ d_i ]_2^0, 1 \le i \le k_1 \\ r_{15} &{} \equiv &{} {\bar{d}} c_j u_C^{k_{j,6}} \, [ \, ]_2^+ \rightarrow \, [ {\bar{d}}_j v_j^{k_{j,6}} ]_2^0, 1 \le j \le k_2 \\ r_{16} &{} \equiv &{} b_i [ \, ]_2 \rightarrow \, [ b_i ]_2, 1 \le i \le k_1 \\ r_{17} &{} \equiv &{} c_j [ \, ]_2 \rightarrow \, [ c_j ]_2, 1 \le j \le k_2 \end{array} \end{aligned}$$

4.2.5 Module 4: Purchase transactions

There is a first step of generation of transaction authorizations following discrete probability distributions embedded in the rules.
$$\begin{aligned}&r_{18} \equiv [ {\bar{d}}_1 ]_2 \xrightarrow {p_{1,1}=1} [ {\bar{e}}_1 f_{1,1} ]_2 \\&r_{19} \equiv [ {\bar{d}}_1 ]_2 \xrightarrow {p_{1,2}=0} [ {\bar{e}}_1 f_{1,2} ]_2 \\&r_{20} \equiv [ {\bar{d}}_2 ]_2 \xrightarrow {p_{2,1}=0.5} [ {\bar{e}}_2 f_{2,1} ]_2 \\&r_{21} \equiv [ {\bar{d}}_2 ]_2 \xrightarrow {p_{2,2}=0.5} [ {\bar{e}}_2 f_{2,2} ]_2 \\&r_{22} \equiv [ {\bar{d}}_3 ]_2 \xrightarrow {p_{3,1}=0.15} [ {\bar{e}}_3 f_{3,1} ]_2\\&r_{23} \equiv [ {\bar{d}}_3 ]_2 \xrightarrow {p_{3,2}=0.85} [ {\bar{e}}_3 f_{3,2} ]_2 \end{aligned}$$
Let us note that the specific values for the probabilities \(p_{i,j}\) could be adapted for different experiments, simply guaranteeing that \(p_{i,1}+p_{i,2}\) remains 1 for each producer i.
After this rules have been applied, purchase transactions can be performed with probability one. Then, to satisfy the order \({\bar{e}}_j\) carried by \(R_j\), one unit of \(d_i\) is purchased from \(P_i\) by paying a price, hence reducing \(v_j\) and increasing \(u_i\) owned by \(P_i\). Capacities and \({\bar{e}}\) are freed. Finally, free \(b_i\) are transformed into new symbols \(h_i\) waiting for depreciation operations. Further developments of the model could involve adding dynamic probabilities for the previous rules, if considered significant, interesting to address.
$$\begin{aligned} r_{24} \equiv [ d_i {\bar{e}}_j f_{j,i} v_j^{k_{i,2}}]_2 \rightarrow u_i^{k_{i,2}} \, [ h_i c_j ]_2^-, 1 \le i \le k_1, 1 \le j \le k_2 \end{aligned}$$

4.2.6 Module 5: Dividends distribution

C is a stakeholder of the different \(R_j\) and \(P_i\). Consequently, their initial monetary units can be considered the initial investment of C. After purchasing transactions, the remaining monetary units owned by \(R_j\) and \(P_i\) can be interpreted as their benefits. In this context, we can consider a dividend payment controlled by parameter \(k_{13}\). For simplicity, this will be considered only in \(P_i\):
$$\begin{aligned} \begin{array}{rcl} r_{25} &{} \equiv &{} [ v_j ]_2^- \rightarrow v_j [ \, ]_2^0, 1 \le j \le k_2 \\ r_{26} &{} \equiv &{} [ u_i ]_2^- \xrightarrow {p=k_{13}} u_C \, [ \, ]_2^0, 1 \le i \le k_1 \\ r_{27} &{} \equiv &{} [ u_i ]_2^- \xrightarrow {p=1-k_{13}} u_i \, [ \, ]_2^0, 1 \le i \le k_1 \end{array} \end{aligned}$$

4.2.7 Module 6: Capacity depreciation

In Sect. 3.6 the progressive decrease in the values of goods produced was explained. This process can be modelled as a reduction of \(b_i\)’s multiplicity controlled by a depreciation rate \(k_{11}\). For simplicity, this will be considered only in producers \(P_i\). Further developments could extend the depreciation for all actors of the system.
$$\begin{aligned}&r_{31} \equiv [ h_i ]_2^- \xrightarrow {p=1-k_{11}} [ b_i ]_2^0, 1 \le i \le k_1 \\&r_{32} \equiv [ h_i ]_2^- \xrightarrow {p=k_{11}} [ \, ]_2^0, 1 \le i \le k_1 \end{aligned}$$
The global evolution suffered by \(b_i\) can be outlined in the following flow:
$$\begin{aligned} \, [ b_i ]_2^0 \xrightarrow {\text {pay}\_\text {rents}} b_i [ \, ]_2^+ \xrightarrow {\text {production}\_\text {of}\_\text {goods}} [ h_i ]_2^- \xrightarrow {\text {depreciation}\_\text {rules}} [ b_i ]_2^0 \end{aligned}$$

4.2.8 Module 7: Capacity increase decision

If depreciation continues, it will be reached a point of capacity exhaustion that stops system evolution. Thus, paired to depreciation rules we need a capacity increase decision mechanism. A careful analysis of the circumstances accompanying aborted transactions leads us to identify them as good triggers for capacity increase. If those aborted transactions are not a consequence of a lack of producer capacity, it is not necessary to increase it (for instance, if a low demand is detected).
$$\begin{aligned} \begin{array}{rcllll} r_{28} &{} \equiv &{} [ f_{j,i} d_i ]_2^- &{} \rightarrow &{} [ d_i ]_2^0, &{} 1 \le i \le k_1, 1 \le j \le k_2 \\ r_{29} &{} \equiv &{} [ f_{j,i} h_i ]_2^- &{} \xrightarrow {1-k_{11}} &{} [ b_i ]_2^0, &{} 1 \le i \le k_1, 1 \le j \le k_2 \\ r_{30} &{} \equiv &{} [ f_{j,i} h_i ]_2^- &{} \xrightarrow {k_{11}} &{} [ \, ]_2^0, &{} 1 \le i \le k_1, 1 \le j \le k_2 \end{array} \end{aligned}$$
The capacity increase is controlled by parameter \(k_{12}\). To ensure a gradual increase, we introduce a limit to the number of aborted transactions considered (given by the multiplicity of \(y_i\)). Additionally, \(y_i\) is generated randomly in the range \([k_8,k_9]\), using the auxiliary symbol \(m_i\). Symbol \(z_i\) is simply an evolved form of \(y_i\) to determine the exact moment of activating this operation. Finally, non-exhausted units of \(f_{j,i}\) and \(z_i\) are removed.
$$\begin{aligned}&r_6 \equiv g_i [ \, ]_2^0 \rightarrow [ g_i y_i^{k_8} m_i^{k_9-k_8} ]_2^+, 1 \le i \le k_1 \\&r_7 \equiv [ m_i ]_2^+ \xrightarrow {0.5} [ \, ]_2^0, 1 \le i \le k_1 \\&r_8 \equiv [ m_i ]_2^+ \xrightarrow {0.5} [ y_i ]_2^0, 1 \le i \le k_1\\&r_{33} \equiv [ y_i ]_2^- \rightarrow [ z_i ]_2^0, 1 \le i \le k_1\\&r_{34} \equiv [ f_{j,i} z_i ]_2^0 \rightarrow b_i^{k_{12}} [ \, ]_2^+, 1 \le i \le k_1, 1 \le j \le k_2\\&r_{35} \equiv [ f_{j,i} ]_2^+ \rightarrow [ \, ]_2^0, 1 \le i \le k_1, 1 \le j \le k_2 \\&r_{36} \equiv [ z_i ]_2^+ \rightarrow [ \, ]_2^0, 1 \le i \le k_1 \end{aligned}$$

4.2.9 Technical and cleaning rules

Finally, some rules are necessary for technical reasons. For instance, \({\bar{e}}_j\) and \(v_j\) not exchanged represent real received orders and monetary units, so they cannot be eliminated.
$$\begin{aligned} r_{13} \equiv v_j [ \, ]_2^+ \rightarrow [ v_j ]_2^0, 1 \le j \le k_2 r_{37} \equiv [ {\bar{e}}_j ]_2^+ \rightarrow [ {\bar{d}}_j ]_2^0, 1 \le j \le k_2 \end{aligned}$$
On the other hand, symbols \(R_1\) and \(g_i\) are restored to their initial location. Object \(R_1\) controls the generation of objects a and \({\bar{d}}\), while objects \(g_i\) control the generation of the corresponding symbols \(y_i\).
$$\begin{aligned} r_{38} \equiv [ R_1 ]_2^- \rightarrow R_1 [ \, ]_2^0 r_{39} \equiv [ g_i ]_2^- \rightarrow g_i [ \, ]_2^0, 1 \le i \le k_1 \end{aligned}$$

5 Simulation results

The model presented in the previous section was translated into P-Lingua [9] language, and a custom application based on MeCoSim [17] has been prepared to perform virtual experiments simulating different instances of the system under study, thus generating the corresponding PDP systems.

In this section the results of the different experiments are shown for several relevant cases to make clear the effect and contribution of each phenomenon included in the model. Each simulation considers 200 cycles with 5 steps in each cycle, using the DNDP4 algorithm as inference engine (this algorithm, described in [5], focuses in the efficient calculation of the consistent and maximal sets of rules being applied at every step of the computation). The complete relation of parameters used is presented in Table 1.
Table 1

Parameters user for simulation






Total number of producers



Total number of retailers



Units of a inserted into the system by S—min value of range



Units of a inserted into the system by S—max value of range



Units of \({\bar{d}}\) inserted into the system by C—min value of range



Units of \({\bar{d}}\) inserted into the system by C—max value of range



Price fixed by S for each unit of a



# failed purchases considered for increasing capital—min value



# failed purchases considered for increasing capital—max value



Cost of capital stock per cycle



Depreciation rate of capital stock



Step of capacity increase



Dividend percentage


(65, 35)

Initial production capacity of \(P_i\), \(1 \le i \le k_1\)


(13, 13)

Price fixed by \(P_i\) for each unit of \(d_i\)


(50, 30, 20)

Initial capacity of \(R_j\), \(1 \le j \le k_2\)


(15, 15, 15)

Price fixed by \(R_j\) for each order of good j, \(1 \le j \le k_2\)

Case A: (capacity depreciation standalone) Initial capacity of producers are \(k_{1,1}=65\) and \(k_{2,1}=35\), depreciation rate = 0.1 and capacity increase mechanism is deactivated (Fig. 2). As expected, along the cycles capacities are reduced until exhaustion. The slope of these curves is controlled by \(k_{11}\). Clearly, a mechanism of capacity increase is necessary to maintain the evolution of the system.
Fig. 2

Evolution of \(b_i\) in Case A: depreciation standalone

Case B: (capacity depreciation + capacity increase mechanism) In this case, capacity increase mechanism and dividend payment mechanisms are activated (Fig. 3). The step of capacity increase is \(k_{12}=1\); the range of aborted purchase transaction varies from \(k_8=3\) to \(k_9=5\) and the dividend percentage is \(k_{13}=0.01\). As expected, during the evolution of the system, depreciation pushes capacity down and capacity increase mechanism competes with the previous one to maintain system evolution alive.
Fig. 3

Evolution of \(b_i\) in Case B: depreciation and capacity increase mechanism

Case C: (capacity depreciation + capacity increase mechanism + dividend payment deactivated). In this case, the dividend payment mechanism is deactivated (Fig. 4). The depreciation mechanism pushes capacity down, the capacity increase mechanism competes with the previous one to maintain system evolution alive, but all these processes are not possible if there is not enough movement of monetary units between all the actors in the system. Once situation is restored to case B, a stable behavior of \(u_C\) is obtained (Fig. 5).
Fig. 4

Evolution of C monetary units in Case C: dividend payment mechanism deactivated

Fig. 5

Evolution of C monetary units with dividend payment mechanism activated

Clearly the cooperation among these three mechanisms (capacity depreciation, capacity increase decision, and monetary unit flow mechanisms) is crucial for the stable evolution of the system. Figures 678 and 9 show the dynamics of the rest of variables in the system.
Fig. 6

Evolution of retailers’ capacities in line chart and accumulated columns

Fig. 7

Evolution of producers’ capacities in line chart and accumulated columns

Fig. 8

Evolution of retailers’ monetary units in line chart and accumulated columns

Fig. 9

Evolution of producers’ monetary units in line chart and accumulated columns

6 Conclusions

In our work we have proposed an enhanced model for the classical producer–retailer problem. Not only basic interactions between producers and retailers are considered (production of goods from raw material, reception of orders from consumers and purchase transaction to match this goods and orders). In addition to those essential processes, a number of phenomena has been considered to get the model closer to the complexities of real world. We have taken advantage of modularity, one of the main benefits of membrane computing for modelling complex systems. Hence, the successive addition of complexity does not imply the necessity to build the model from scratch every time. Many real economic world interactions have been included in the model as new layers to the basic ones: capital stock depreciation, capacity increase decision mechanism, costs of capital (rents for its owners), dividend payments, and a general idea of making monetary units flow across the system. Additionally, randomness has been introduced, in several steps of the model, by means of a smart mechanism used in PDP world.

As described in previous sections, these ideas have been materialized through a model based on a specific P system framework (more specifically, PDP systems). This model has been then translated into P-Lingua and simulated using MeCoSim, where the system evolution has been analysed in depth. Some remarkable facts are that the final system can evolve autonomously without any exogenous influence, as it could be the provision of a certain number of elements at the beginning of each cycle. Although initial values of variables are settled, they change their values reaching an equilibrium point. Once this stability point has been reached, the system varies slightly around it. From the previous results, we can derive that multiple economic issues can be modeled using membrane computing. Therefore, more efforts must be done in this direction.



This work was partially supported by Grant numbers 61472328 and 61320106005 of the National Natural Science Foundation of China, and by the project TIN2017-89842-P of the Spanish Ministry of Economy, Industry and Competitiveness.


  1. 1.
    Bartosik J. Paun’s systems in modeling of human resource management. Second conference on tools and methods of data transformation, WSU Kielce, 2004.Google Scholar
  2. 2.
    Cardona M, Colomer MA, Pérez-Jiménez MJ, Sanuy D, Margalida A. Modeling ecosystems using P Systems: the bearded vulture, a case study. Lect Notes Comput Sci. 2009;5391:137–56.CrossRefzbMATHGoogle Scholar
  3. 3.
    Cheruku S, Păun A, Romero FJ, Pérez-Jiménez MJ, Ibarra OH. Simulating FAS-induced apoptosis by using P systems. Prog Nat Sci. 2007;17(4):424–31.MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Colomer MA, Lavín S, Marco I, Margalida A, Pérez-Hurtado I, Pérez-Jiménez MJ, Sanuy D, Serrano E, Valencia-Cabrera L. Modeling population growth of Pyrenean chamois (Rupicapra pyrenaica) by using P-systems. Lect Notes Comput Sci. 2011;6501:144–59.CrossRefGoogle Scholar
  5. 5.
    Colomer MA, Pérez-Hurtado I, Pérez-Jimńez MJ, Riscos A. Comparing simulation algorithms for multienvironment probabilistic P system over a standard virtual ecosystem. Nat Comput. 2012;11:369–79.MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Colomer MA, Margalida A, Pérez-Jiménez MJ. Population dynamics P system (PDP) models: a standardized protocol for describing and applying novel bio-Inspired computing tools. PLoS One. 2013;8(4):e60698.CrossRefGoogle Scholar
  7. 7.
    Epstein JM, Axtell R. Growing artificial societies-social science from the bottom up. Washington DC: Brookings Institution Press; 1996.CrossRefGoogle Scholar
  8. 8.
    Freund R, Oswald M, Schirk T. How a membrane agent buys goods in a membrane store. Prog Nat Sci. 2007;17(4):442–8.MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    García-Quismondo M, Gutiérrez-Escudero R, Pérez-Hurtado I, Pérez-Jiménez MJ, Riscos-Núñez A. An overview of P-Lingua 2.0. Lect Notes Comput Sci. 2010;5957:264–88.CrossRefzbMATHGoogle Scholar
  10. 10.
    Korczynski W. On a model of economic systems. Second conference on tools and methods of data transformation, WSU Kielce, 2004.Google Scholar
  11. 11.
    Korczynski W. Paun’s systems and accounting. In: Pre-proceedings of sixth workshop on membrane computing, WMC6, Vienna; 2005. pp. 461–464.Google Scholar
  12. 12.
    Păun G. Membrane computing: an introduction. Berlin: Springer; 2002.CrossRefzbMATHGoogle Scholar
  13. 13.
    Păun Gh, Păun R. Membrane computing as a framework for modeling economic processes. In: Proceedings of SYNASC 05, Timisoara, Romania, IEEE Press; 2005. pp. 11–18Google Scholar
  14. 14.
    Păun G, Păun R. Membrane computing and economics: numerical P Systems. Fundam Inf. 2006;73(1–2):213–27.MathSciNetzbMATHGoogle Scholar
  15. 15.
    Păun G, Păun R. Membrane computing and economics. In: Păun G, Rozenberg G, Salomaa A, editors. The Oxford handbook of membrane computing. New York: Oxford University Press; 2010. p. 632–44.CrossRefGoogle Scholar
  16. 16.
    Păun G, Rozenberg G, Salomaa A, editors. The Oxford handbook of membrane computing. New York: Oxford University Press; 2010.zbMATHGoogle Scholar
  17. 17.
    Pérez-Hurtado I, Valencia-Cabrera L, Pérez-Jiménez MJ, Colomer MA, Riscos-Núñez A. Mecosim: a general purpose software tool for simulating biological phenomena by means of P systems. IEEE fifth international conference on bio-inspired computing: theories and applications (BIC-TA 2010); I 2010. pp. 637–643.Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  1. 1.Research Group on Natural Computing, Department of Computer Science and Artificial IntelligenceUniversidad de SevillaSevilleSpain

Personalised recommendations