In recent years, agent-based simulation has been widely used in the field of social science, which is more effective in research on the formation and evolution of organizations. Therefore, based on theoretical analysis, we constructed an agent-based simulation model, in which blockchain technology is applied in the agricultural product circulation system. The blockchain technology involved in this article is a consortium chain, regardless of public and private chains.
4.1. Model structure
The established simulation model includes farmers, wholesalers, retailers, consumers, and regulators, as well as the interactive behaviors among these five agents, and considers both traditional circulation and blockchain circulation (Fig. 2).
Assuming that there is an agricultural product production base in the initial state, the production base consists of n homogeneous farmers, each of which independently produces s units of agricultural products in each period. The products produced by farmers are classified into two types: safe and unsafe (unsafe products refer to products whose pesticide residues do not meet the national standards). Since quality and safety are important attributes of credit products, only the farmers know the true quality of the products, and other agents cannot identify them. There are m wholesalers and k retailers at the same time. Under the initial conditions, agricultural products are only circulated through the traditional circulation chain. In this mode, the products are sequentially circulated from traditional farmers to the wholesalers, retailers and then consumers, among which the former three agents make a profit from the difference. After the application of blockchain technology, some farmers, wholesalers, and retailers tend to use the blockchain technology, resulting in two chains in the agricultural product circulation system. In the blockchain circulation chain, blockchain farmers conduct transactions directly with blockchain retailers, and blockchain wholesalers mainly undertake the function of logistics. The farmers, wholesalers and retailers can freely switch between traditional mode and blockchain mode under certain conditions.
4.2. Setting of the farmer agent
In the traditional circulation chain, agricultural products produced by farmers are first sold to wholesalers, which are then sold to the retailers. After the application of blockchain technology, the blockchain farmers directly sell the products to the blockchain retailers. Currently, the blockchain wholesalers mainly undertake the transport function. According to the assumption of "economic man" in economics, farmers are profit-seeking, and their attributes are set as farmer identity, honesty, and wealth (Ma 2017). The specific decision-making behavior and conversion rules of farmers are as follows.
Honesty updating. Each farmer has a credit rating, and the change in its value can indicate whether the farmer produces safe products as well as his resistance to the impact of interests. The benefit impact refers to the difference in the expected benefits from the production of safe and unsafe products. If traditional farmers and blockchain farmers are not sampled for inspection, their honesty will be slightly reduced according to Eq. (1). If traditional or blockchain farmers are sampled for inspection by the regulator, their honesty will be increased based on Eq. (2). If any of the blockchain farmers, blockchain wholesalers and blockchain retailers is sampled by the regulator, the honesty of the blockchain farmers will be increased according to Eq. (2). If the traditional and blockchain farmers, blockchain wholesalers and blockchain retailers are not sampled by the regulator, the honesty of the blockchain farmers is decreased according to Eq. (1).
$${Honesty}_{t+1}=(1-{f}^{+}){Honesty}_{t}+minimal\_Honsety$$
1
$${Honesty}_{t+1}=(1-{f}^{-}){Honesty}_{t}+{f}^{-}$$
2
Among them, \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\)t represents the \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\) of a certain farmer in period t. The minimum value of \(\mathbf{H}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\)t is 0. Currently, the farmer is completely dishonest, and all his products are unsafe. When \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\)t is 1, the farmer is completely honest, and correspondingly all his products are safe. As \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\)t increases, the probability of the farmer to produce safe products increases. \({\mathbf{f}}^{+}\in \left(\text{0,1}\right)\) and \({\mathbf{f}}^{-}\in \left(\text{0,1}\right)\) represent the positive and negative impact factor experienced by the farmer, respectively, and if \({\mathbf{f}}^{-}>{\mathbf{f}}^{+}\), the negative factor has a greater impact on the farmer. \(\mathbf{M}\mathbf{i}\mathbf{n}\mathbf{i}\mathbf{m}\mathbf{a}\mathbf{l}\_\mathbf{H}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\) is the minimum value of \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\).
Punishment. There are the following situations in which the farmers will be punished. When the regulators detect some problems in agricultural products during the blockchain circulation, they can directly trace the source through the blockchain technology (Li and Liu 2020), to find out the blockchain farmers that produce unsafe products and impose certain penalties on them. In addition, when the regulators find some problems in the agricultural products of traditional farmers by spot checks, the traditional farmers will also be punished.
Farmers' production decision. Farmers in the production base have two choices: producing safe products or unsafe products. Profit, \(\mathbf{h}\mathbf{o}\mathbf{n}\mathbf{e}\mathbf{s}\mathbf{t}\mathbf{y}\) and other random factors jointly determine the production decision of farmers as shown in Eq. (3).
$$\alpha {k}_{i}+(1-\alpha )p>Honesty$$
3
In the equation, \({k}_{i}\in \left(\text{0,1}\right)\) represents the standardized value of the difference between the two expected benefits to produce safe and unsafe products. Weights \({\alpha }\in \left(\text{0,1}\right)\),\({\rho }\) is any random number on \(\left(\text{0,1}\right)\). If this equation is satisfied, the farmers will produce safe products; otherwise, they will produce unsafe products.
Product trading decision. Traditional farmers sell their products to the wholesalers at the price of P1, and the profit of the farmer is the income minus the production cost (any penalty will be deducted). Blockchain farmers sell their products to the blockchain retailers at price P2, and the profit is the income minus the production and technology costs. Profits will change the attributes of farmers' wealth. If the farmer sells all his products in the current period, regardless of whether the products are safe or unsafe, the transactions between the farmers and wholesalers are conducted at a consistent price P1. Because of blockchain technology, the blockchain farmers have to be responsible for the quality and safety of the agricultural products in the whole process, and as a result, P2 is generally higher than P1. P3 is the price at which the wholesalers sell agricultural products to the retailers. P4 and P5 are the prices of agricultural products sold to consumers by blockchain retailers and traditional retailers, respectively. The calculation of P1, P2, P3, P4 and P5 can be conducted with equations (4)-(8).
$${P}_{1}\left(t\right)={\alpha }{\text{C}}_{\text{u}}+(1-{\alpha }){\text{C}}_{\text{s}}+{{\epsilon }}_{1}\left(\text{t}\right)$$
4
$${P}_{2}\left(t\right)={\alpha }{\text{C}}_{\text{u}}+(1-{\alpha }){\text{C}}_{\text{s}}+{{\epsilon }}_{2}\left(\text{t}\right)$$
5
$${P}_{3}\left(t\right)=(1+{\eta }){P}_{1}\left(t\right)$$
6
$${P}_{4}\left(t\right)=(1+{\beta }){P}_{2}\left(t\right)$$
7
$${P}_{5}\left(t\right)=(1+{\delta }){P}_{3}\left(t\right)$$
8
In these equations, is the random item; \({C}_{s}\) and \({C}_{u}\) indicate the unit cost of producing a safe and unsafe product, respectively; \({\eta }\in \left(\text{0,1}\right)\) ,\({\beta }\in \left(\text{0,1}\right)\), \({\delta }\in \left(\text{0,1}\right)\). If the agricultural products produced by the farmers are detected as unsafe by the regulator, they will be fined B1 per unit, and their honesty will be changed accordingly. For traditional farmers, there are profit functions.
\({\phi }_{1}=s({P}_{1}-{C}_{u})\) : farmers produce unsafe products that are not sampled.
\({\phi }_{2}=s({P}_{1}-{C}_{u}-{B}_{1})\) : farmers produce unsafe products that are detected by regulators.
\({\phi }_{3}=s({P}_{1}-{C}_{s})\) : farmers produce safe products.
Ct is the cost of introducing blockchain technology. For blockchain farmers, there are also three profit functions.
\({\pi }_{1}=s({P}_{2}-{C}_{u}-{C}_{t})\) : blockchain farmers produce unsafe products that are not detected.
\({\pi }_{2}=s({P}_{2}-{C}_{u}-{C}_{t}-{B}_{1})\) : blockchain farmers produce unsafe products that are detected by regulators.
\({\pi }_{3}=s({P}_{2}-{C}_{s}-{C}_{t})\) : blockchain farmers produce safe products.
Conversion strategy. Considering that farmers have certain adaptability and their pursuit of maximum profits, different types of farmers can be converted to each other. The following issues need to be considered in the conversion: The conditions for conversion are mainly based on the comparison of the average income between different types of farmers; the threshold for conversion (G) reflects the resistance of the conversion (Jin and Yuan 2019). When Eq. (9) is satisfied, the type of the farmer will be converted; otherwise, the farmer type will not be changed.
$$\alpha ({\pi }_{i}^{,}-{\pi }_{i})/{\pi }_{i}^{,}+(1-\alpha )p>G$$
9
In the equation, \({{\pi }}_{\mathbf{i}}\) is the current profit of the farmer; \({{\pi }}_{\mathbf{i}}^{\mathbf{\text{'}}}\) is the current average profit of different types of farmers around the farmer; \(\mathbf{p}\in \left(\text{0,1}\right)\); G is the conversion threshold, and its dynamic change can be expressed as follows:
$${G}_{t+1}=(1-{v}_{1}^{+}){G}_{t}+{v}_{1}^{+}$$
10
$${G}_{t+1}=(1-{v}_{1}^{-}){G}_{t}$$
11
$${G}_{t+1}=(1-{v}_{2}^{+}){G}_{t}+{v}_{2}^{+}$$
12
$${G}_{t+1}=(1-{v}_{2}^{-}){G}_{t}$$
13
\({\mathbf{v}}_{2}^{-}>{\mathbf{v}}_{1}^{-}>{\mathbf{v}}_{1}^{+}>{\mathbf{v}}_{2}^{+}\) . \({\mathbf{v}}_{1}^{+}\) indicates that the personal income of the farmer is greater than the average income of different types of farmers without fines. In this case, his/her conversion threshold will be significantly increased. \({\mathbf{v}}_{1}^{-}\) means that the personal income is low without fines, when the conversion threshold will be slightly decreased. \({\mathbf{v}}_{2}^{+}\) means that the personal benefit is high, but a fine is imposed, when the conversion threshold will be slightly increased; \({\mathbf{v}}_{2}^{-}\) means that the farmer has a low income with a fine, when the conversion threshold will be significantly decreased.
4.3. Setting of the wholesaler agent
Product acquisition and sales decision. The blockchain wholesaler obtains a fixed income θ per unit by providing logistics services for the blockchain circulation. The price of agricultural products purchased by traditional wholesalers is P1, and that of agricultural products sold to traditional retailers is P3.
For traditional wholesalers, there are two scenarios for their profit margins.
\({r}_{1}={P}_{3}-{P}_{1}\) , when the agricultural product has not been tested or passed the test.
\({r}_{2}={P}_{3}-{P}_{1}-{B}_{2}\) , when the agricultural products are detected as unsafe.
Punishment. When the agricultural products in the circulation of the wholesaler are detected as unsafe, there are two situations. First, the products transported by the blockchain wholesalers are detected as unsafe, and the unsafe products can be traced through the blockchain technology. In this case, the blockchain farmers producing the products will be punished. Second, the products of traditional wholesalers are detected to be unsafe. In this case, the regulator will impose a penalty of B2 per unit on traditional wholesalers.
Conversion strategy. Wholesalers also obey the assumption of "economic man". After the introduction of blockchain technology, different types of wholesalers can also be converted to each other, but the following conditions need to be considered. The premise of conversion is that there are different types of wholesalers in the circulation system. The conversion conditions are mainly based on the comparison of the average income of different wholesaler types. Conversion threshold G1 is used to evaluate the resistance to conversion. When Eq. (14) is satisfied, the type of wholesalers will be converted.
$$\alpha ({r}_{i}^{,}-{r}_{i})/{r}_{i}^{,}+(1-r)p>{G}_{1}$$
14
In the equation, \({\text{r}}_{\text{i}}\) is the current profit margin of a wholesaler; \({\text{r}}_{\text{i}}^{,}\) is the average profit margin of another type of wholesaler, \({\alpha }\in \left(\text{0,1}\right)\), \(\text{p}\in \left(\text{0,1}\right)\) and G1 is the conversion threshold.
4.4 Setting of the retailer agent
Product acquisition and sales decision. Under the initial conditions, all retailers buy agricultural products from wholesalers. After the introduction of blockchain technology, some traditional retailers are converted into blockchain retailers. There are also two situations at this time. First, the blockchain retailers directly purchase agricultural products at the price of P2 from the blockchain farmers, and pay the transport cost per unit θ of the blockchain circulation, and then sell the products to consumers at the price of P4. Second, traditional retailers buy agricultural products from traditional wholesalers at the price of P3 and sell them to consumers at the price of P5.
At this time, the profit margin function of the blockchain retailer is \({y}_{1}={P}_{4}-{P}_{2}-\vartheta -{C}_{t}\), and that of a traditional retailer is \({y}_{2}={P}_{5}-{P}_{3}\) when the product is not found to be unsafe by random inspection, and \({y}_{3}={P}_{5}-{P}_{3}-{B}_{3}\) when the product is sampled and found to be unsafe.
Punishment. When the blockchain retailer's products are detected to be unsafe, the source of the products can be traced through blockchain technology, and the blockchain farmers who produce unsafe agricultural products will be fined B1 per unit. When the traditional retailer's products are detected to be unsafe, the regulator will impose a fine of B3 per unit.
Conversion strategy. The retailers also have the characteristics of "economic man", and thus different types of retailers can be converted to each other. The following factors need to be considered for the conversion. The premise for the conversion is that after the introduction of blockchain technology, there are different types of retailers. The conversion conditions are also based on the comparison of the average income of different types of retailers. The conversion threshold G2 reflects the resistance to conversion. When Eq. (15) is satisfied, the type of retailers will be converted.
$$\alpha ({C}_{i}^{,}-{C}_{i})/{C}_{i}^{,}+(1-\alpha )p<{G}_{2}$$
15
In the equation, \({\text{C}}_{\text{i}}\) is the current profit margin of a retailer, and \({\text{C}}_{\text{i}}^{,}\) is the average profit margin of other types of retailers, \({\alpha }\in \left(\text{0,1}\right)\), \(\text{p}\in \left(\text{0,1}\right)\), and G2 is the conversion threshold.