Jurnal Teknik Industri Vol. No. August 2024, pp. ISSN : 1978-1431 print | 2527-4112 online Agent-Based Modeling and Simulation for Farmer Decision Making Nila Nurlina a*. Dhanan S. Utomo b. Tri Retno Setiyawati a. Masculine Muhammad Muqorobin a a Department of Industrial Engineering. Tidar University. Jl Kapten Suparman 39 Magelang. Indonesia b Centre for Sustainable Road Freight. Heriot-Watt University. Edinburg Campus EH14 4AS. UK * Corresponding author: nila. nurlina@untidar. ARTICLE INFO ABSTRACT Article history Received. December 27, 2023 Revised. May 9, 2024 Accepted. July 31, 2024 Available Online. August 31, 2024 Shallots are a highly demanded, perishable commodity whose fluctuating prices pose significant risks to farmers, affecting their income stability. This research aims to model and simulate the selling decisions of shallot farmers using Agent-Based Modeling (ABM). The model represents the individual behaviors of farmers and buyers, focusing on decisions to either delay or immediately sell harvested shallots. Key variables such as market prices, inventory levels, and profit expectations were incorporated into the model. Primary data were collected from observations of shallot farmers in Nganjuk. East Java. In contrast, secondary data were sourced from the Indonesian Central Statistics Agency (BPS). The simulation results indicate farmers maximize their profits by selling shallots when the minimum sales profit margin reaches 20%. Farmers tend to postpone sales when market prices fall by drying the shallots, reducing market supply, and elevating The study concludes that delaying sales can be an effective strategy to stabilize prices and enhance profitability, particularly when dried shallots command higher prices than fresh ones. These findings offer valuable insights for developing agricultural policies to optimize farmers' income while mitigating price volatility risks. Keywords Agent-based modeling Shallot Farmer Strategy This is an open access article under the CCAeBY-SA license. Introduction The agricultural sector is crucial to any country's economy and food security . Shallots are one of the most widely cultivated commodities by farmers . , . , with consistently high demand . and consumption across the globe . In Indonesia, the supply of shallots fluctuates significantly, particularly during the rainy season . , which leads to volatility in both stock and market prices. As a seasonal and perishable product, shallots are essential commodities contributing to inflation . Prices at the wholesale and retail levels are heavily influenced by farm-level prices . While market prices can fluctuate widely, prices for farmers often remain low, especially during peak harvest Agricultural activities are influenced by both internal and external factors, many https://doi. org/10. 22219/JTIUMM. Vol25. No2. http://ejournal. id/index. php/industri jurnal@umm. Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. ISSN : 1978-1431 print | 2527-4112 online Jurnal Teknik Industri Vol. No. August 2024, pp. of which are beyond farmers' control. Internal factors are manageable by farmers, whereas external factors, such as price fluctuations, are not . These external factors, particularly price instability, significantly affect farmers' decision-making processes regarding sales . , . Sales decisions are further influenced by factors such as inventory costs and future market forecasts, which introduce risks and uncertainties into farmers' incomes. Understanding farmer behavior is vital for developing policies to stabilize market prices and ensure profitability. Farmers' incomes can be optimized if they sell shallots at the right time and under favorable conditions, balancing profitability with income risk Observations of farmers in East Java show that, when faced with uncertain prices and demand, they either sell their entire harvest or over 50% of it when market prices are high. Conversely, they postpone sales during low market prices, although delaying sales results in weight loss during storage . Farmers must develop effective strategies to stabilize and increase their income . However, not all farmers can optimize the conditions required for their agricultural activities. This study examines how farmers' behaviors and strategies influence their decisions in the face of uncertain shallot prices and demand. Johnson, et al. analyzed key variables influencing farmer decision-making, focusing on the qualitative impact of these decisions on farmer losses. However, their approach did not fully capture the complexity of decision-making interactions within the agricultural system. To improve farmers' income, enhancing their ability to manage price risks effectively . Previous studies have explored the behavior and attitudes of wheat farmers toward risk using the Equally Likely Certainty Equivalent approach. However, this method fails to explain complex system interactions . One promising tool for modeling farmer behavior is Agent-Based Modeling (ABM) . ABM is particularly beneficial due to its capacity to simulate interactions between agents in a social network . For example, it has been widely applied in the agricultural sector to simulate the impact of buyer-seller relationships in agri-food products . Although ABM has been extensively used to model various aspects of agricultural behaviorAisuch as farmers' adoption of precision agriculture . , smart agriculture for food security . , and decision-making based on rainfall for crop cultivation . Airesearch on its application to farmers' sales decisions remains limited. Moreover, while ABM has been applied to simulate optimal farming strategies in regions such as northern India, these studies have not specifically addressed how farmers make decisions regarding the sale of their produce . Despite the extensive research on agricultural decision-making, previous studies have not fully explored how individual farmers decide the timing and method of selling their crops, particularly in the context of fluctuating market conditions. It presents a significant gap in understanding the detailed dynamics behind farmers' sales decisions. Unlike previous research, which often overlooks the complexity of these decisions, this study employs Agent-Based Modeling (ABM) to simulate the selling behavior of shallot ABM remains underutilized in this area, and its application offers a novel approach to understanding the interactions between market conditions and farmer decision-making processes. This research aims to model shallot farmers' selling decisions using ABM, providing valuable insights into their behavior under various market This approach contributes to developing more effective agricultural policies and strategies to optimize profitability while mitigating risks. The model developed in this study highlights farmers' strategies to increase their income and serves as a foundation for improving sales procedures and marketing strategies. The contributions of this research include offering a comprehensive model that simulates farmers' decision-making processes, enhancing the understanding of how farmers respond to market fluctuations. Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. Jurnal Teknik Industri Vol. No. August 2024, pp. ISSN : 1978-1431 print | 2527-4112 online and laying the groundwork for policy development aimed at supporting farmers in managing price volatility. Methods Numerous studies have examined how farmers respond to price risks . , . , . , . Specifically, research on post-harvest risk analysis for shallot farmers has identified price fluctuations as a significant risk that can lead to financial losses . , . This study aims to model and simulate the behavior of farmers in making selling decisions under fluctuating demand and prices. The modeling process utilizes Agent-Based Modeling (ABM), a widely used approach for simulating individual behaviors within a system . , . In ABM, agents are represented as autonomous entities interacting with one another, making it suitable for studying the complex decision-making processes of farmers and buyers . Unlike previous studies, this research focuses explicitly on employing ABM and simulation as a platform for understanding how farmers decide when and how to sell their harvest. The core assumption in this model is that all farmers have the same skill level in cultivating shallots. The data used for the model consists of both primary and secondary Primary data were collected through direct interviews with farmers and traders. In contrast, secondary data were sourced from national statistics, reports from the National Food Agency, and Bank Indonesia. The agents in this study are divided into two groups: farmers and buyers. Farmers represent those involved in shallot production, while buyers represent traders who purchase the harvested crops. Figure 1 illustrates the interaction between these two types of agents, highlighting their respective roles in the model. Farmers either sell fresh shallots or choose to dry and sell them when market prices drop, depending on The income generated by farmers is determined by the size of their land and production costs. At the same time, buyer purchase prices are influenced by factors such as market stock, demand, and overall market prices, which are subject to high In the developed model, all farmers plant the same type of seed, and no additional production costs due to pests are considered. Figure 1. Research Design Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. ISSN : 1978-1431 print | 2527-4112 online Jurnal Teknik Industri Vol. No. August 2024, pp. 1 Modelling Variables are developed into conceptual models to enhance the reliability of system The variables used in this research include market price, market demand, market stock, and land area. Modeling starts with the creation of farmer and buyer agents. Farmers are characterized by inventory and capital, while buyers are represented by their capital attributes. Figure 2. Model Framework Figure 2, which illustrates the model framework, details the algorithm used in the agent-based modeling. This framework evaluates farmer income as a critical factor influencing sales decisions. The market price is treated as a global variable accessible to all agents. The simulation operates on a time-based function that dictates when farmers plant, stop planting, and wait for the harvest period. This research models the behavior of farmers in the business process of selling fresh shallots, with the option to sell dried shallots if prices drop below profitable levels. Farmers can delay the sale of their harvested shallots for up to 3 months. After this period, shallots experience increased depreciation due to temperature and humidity conditions in the case study area, which are unsuitable for long-term storage. The profit margin affecting farmer behavior is modeled in Equation . Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. Jurnal Teknik Industri Vol. No. August 2024, pp. OcycE ycEycycuyceycnyc ycoycaycyciycnycu = Oc ycu100% ya ISSN : 1978-1431 print | 2527-4112 online . Where total profit ycE is the difference between the total income from shallot sales and the total costs incurred in production and distribution, total revenue ya represents the total sales value of all shallots sold. The model also simulates changes in farmers' inventory, which directly impacts their capital. Equation . represents the formula for calculating the farmer's inventory. yaycaycycoyceyc ycnycuycyceycuycycuycyc = ycO . a ycu ycEyc. V is the existing inventory of farmers. L is the planted-land area, and Pm is the maximum farmer's production. The larger the planted area, the more inventory the farmer will have. The farmer's inventory will increase when the harvest season arrives. This simulation also models the price negotiations between sellers and buyers in Equation . OP = . -BPM) * MP Here, ycCycE is the offer price presented by the buyer. BPM is the buyer's profit margin, and MP is the market price. The offered price accounts for the market price, with the constant 1 representing a fixed factor in the model. Model verification was performed by checking the programming logic in the NetLogo software and validating the algorithm. The model was successfully verified, with no errors detected during the simulation. Validation was further strengthened through expert judgment, involving professionals with over 20 years of experience in the shallot The decision behavior of farmers revolves around whether to sell shallots immediately or postpone the sale. The primary goal of farmers is to achieve higher profits. If the profit margin exceeds 20%, the farmers will sell their harvest, reducing their The sale will be postponed if the expected profit margin is unmet. During this delay, farmers dry the shallots for two weeks. If the profit margin exceeds 20%, the dried shallots are sold despite potential depreciation risks. However, if the minimum profit margin is still not achieved, the shallots are stored for up to three months. Once this storage period ends, the farmers will sell all remaining shallots to generate the capital needed for replanting. Historical data shows that dried shallots consistently fetch higher prices than fresh ones. 2 Data Used The data used for the simulation consists of both primary and secondary sources. Primary data were gathered through interviews and observations of shallot farmers in the Nganjuk area. East Java. Indonesia. A total of 10 shallot farmers participated in the study. The collected data include harvest, planting, depreciation, average yield, and the waiting period between harvests. Secondary data were obtained from the Indonesian Central Statistics Agency (BPS). Shallots are typically ready for harvest after 60 days. Approximately 40% of the harvested shallots are retained for the next planting cycle. High-quality seeds are sourced from shallots stored for 3 months, as these tend to sprout more rapidly. However, 80% of farmers in the study area use seeds that have only been stored for 2 months to meet their planting needs. Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. ISSN : 1978-1431 print | 2527-4112 online Jurnal Teknik Industri Vol. No. August 2024, pp. The planting-to-harvest period is 60 days, followed by a 60-day waiting period before replanting. Farmers must choose the sales strategy that maximizes profitability. Fluctuating demand and market prices influence their decision to sell immediately or delay sales. To secure higher profits, farmers often delay sales. however, this comes with the risk of depreciation in stored shallots. In this model, the shallot storage system is designed to help maintain stable prices in the market. Figure 3. Price Fluctuation Figure 3 illustrates price fluctuations and shows shallot prices have experienced significant variability. The lowest price at the producer level between 2022 and 2023 occurred in November 2023 at Rp 16,400, while the highest price was Rp 45,650 in August 2022 . The high rainfall during the rainy season in 2022 reduced shallot production in certain areas, increasing demand. In response, the government set reference purchase prices for fresh shallots between Rp 18,500 and Rp 20,000 and dried shallots between Rp 25,000 and Rp 32,000 . According to BPS, the average profit margin for traders purchasing shallots from farmers ranged from 19. 23% to 21. 75% in 2022. These data points provide the foundation for the simulation. Results and Discussion The simulation using Agent-Based Modeling (ABM) successfully replicated the real-life conditions of shallot farming activities. The results showed that shallot farmers generally plant after a 60-day cycle, followed by a waiting period of 50 days before The farmers' income fluctuated significantly depending on market prices, ranging from Rp 7,000 to Rp 33,000 during the simulation period. The model interface was designed with setup, go, and input parameters that allowed flexibility in the simulation. These input parameters included the minimum and maximum land area, production costs, market price ranges, and the farmers' targeted profit margins. This flexibility enabled the simulation to capture the dynamics of shallot farming under different economic conditions. Figure 4 illustrates the model interface used in the simulation process, showing the interaction between farmers and buyers. The buying and selling shallots algorithm is based on real-world negotiation dynamics. During the harvest season, buyers with sufficient capital would negotiate prices with farmers. The shallots were sold immediately Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. Jurnal Teknik Industri Vol. No. August 2024, pp. ISSN : 1978-1431 print | 2527-4112 online if the negotiated price met the farmer's minimum profit margin of 20%. However, if the price offered was below this threshold, the farmers opted to postpone sales and dry the shallots in order to secure a better price. The simulation demonstrated that drying the shallots before selling could be profitable, allowing farmers to wait for more favorable market conditions. The drying process continued until the farmers could obtain a price that met or exceeded the 20% profit margin. This strategy effectively mitigated the risks associated with market fluctuations and increased overall profitability. Figure 4. Model Interface Furthermore, in the modeling process, the algorithm governing the buying and selling of shallots between farmers and buyers is detailed in Algorithm 1. This algorithm outlines the negotiation process that occurs during each harvest season. When a buyer with sufficient capital approaches a farmer, they negotiate the sale price of the shallots. Suppose the offered price meets or exceeds the farmer's minimum profit margin of 20%. The transaction is completed in that case, and the farmer sells the shallots. However, suppose the offered price is below this threshold. In that case, the farmer will delay the sale and dry the shallots. The drying process allows the farmer to hold the shallots until market conditions improve, ensuring they achieve the desired profit margin before selling. Algorithm 1 in Figure 5 illustrates this negotiation and decision-making process, which is crucial in optimizing the farmer's income while navigating market volatility. Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. ISSN : 1978-1431 print | 2527-4112 online Jurnal Teknik Industri Vol. No. August 2024, pp. Figure 5. Decision-Making Process The simulation results using the agent-based modeling approach are illustrated in Figure 6 to Figure 8. Figure 6 shows the total farmer inventory over 456 days. The simulation revealed that the farmer's inventory decreased during the planting season as their stocks were used for planting. Conversely, during the harvest season, the inventory increased as new shallots were harvested. The inventory level would then decline when buyers purchased the shallots and transactions were made. Figure 7 presents the total capital held by farmers over 465 days, illustrating how capital fluctuated based on their sales decisions. During the planting season, the graph showed a decrease in capital due to the costs associated with replanting. However, during the harvest season, capital increased as farmers sold their shallots, reflecting an upward trend in financial resources. Figure 8 highlights the total market stock of shallots. The market stock increased when farmers sold their produce. In contrast, stock levels decreased when farmers postponed sales in response to unfavorable market prices. The simulation also demonstrated that market stock tended to decline during planting. Farmers generally maintained their inventory when market prices were low and did not meet their desired profit margins. In such cases, drying the shallots was employed to delay sales. Historical data indicated that dried shallots consistently maintained more stable prices than fresh shallots. By adopting this strategy, farmers could manage their inventory more effectively, reducing the risk of overstock and ensuring higher profitability when market conditions improved. The findings from this study have significant implications for both farmers and For farmers, using an Agent-Based Modeling (ABM) approach to simulate selling decisions offers practical insights into optimizing their profits by adjusting their sales strategies based on market conditions, delaying sales by drying shallots when low prices allow farmers to maintain a stable income and minimize losses due to price This strategy enhances individual profitability and contributes to market stability by reducing the risk of oversupply during periods of low demand. From a policy perspective, the results emphasize the importance of supporting farmers in adopting more flexible sales strategies, such as improving storage facilities and providing access to market information. Policymakers can use the insights from this research to develop programs that encourage adopting such practices, thereby helping farmers mitigate the risks associated with price volatility. Additionally, the simulation Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. Jurnal Teknik Industri Vol. No. August 2024, pp. ISSN : 1978-1431 print | 2527-4112 online model offers a valuable tool for predicting market behaviors, enabling more informed decisions on agricultural policy and intervention strategies that promote economic stability and food security. Figure 6. Total Farmer Inventory Figure 7. Total Farmer Capital Figure 8. Total Market Stock Conclusion This research demonstrates that shallots, as one of the most widely cultivated commodities, are highly susceptible to price fluctuations in the global market, which can Please cite this article as: Nurlina. Utomo. Setiyawati. , & Muqorobin. Agent-Based Modeling Simulation Farmer Decision Making. Jurnal Teknik Industri, 25. , 119Ae130. https://doi. org/10. 22219/JTIUMM. Vol25. No2. ISSN : 1978-1431 print | 2527-4112 online Jurnal Teknik Industri Vol. No. August 2024, pp. lead to significant financial losses for farmers. Through agent-based modeling, this study successfully explains and predicts the behavior patterns of farmers and buyers in the buying and selling of shallots. The results indicate farmers can optimize their profits by selling when the minimum sales profit margin is 20%. When market prices decline, delaying sales and drying the shallots proves to be an effective strategy, as it reduces market supply, increases prices, and ultimately leads to higher profits for dried shallots than fresh ones. Despite the valuable insights provided by this study, there are some limitations. The model assumes that all farmers have the same skills and access to resources, which may not accurately reflect real-world conditions where disparities in knowledge, technology, and resources exist. Additionally, this study focuses primarily on the timing of sales without fully considering other factors that could influence farmer behavior, such as climate conditions, pest infestations, or access to market information. For future research, it is recommended to explore how the type of seed used by farmers influences the timing of harvest, production costs, and overall yield. Since different seeds may impact harvest time and shallot quality, further analysis of this variable could enhance the understanding of farmer decision-making in sales strategies. Moreover, incorporating more detailed environmental and market factors into the model could provide a more comprehensive view of the challenges faced by shallot farmers. Declarations Author contribution: We declare that all authors contributed equally to this paper and approved the final paper. Funding statement: No funding was received for this work. Conflict of interest: The authors declare no conflict of interest. Additional information: No additional information is available for this paper. References