Simulation of glucose regulating mechanism with an agent-based software engineering tool

Article history: Received: 19 August 2018 Accepted: 11 February 2019 Available Online: 20 March 2019 This study provides a detailed explanation of a regulating mechanism of the blood glucose levels by an agent-based software engineering tool. Repast Simphony which is used in implementation of this study is an agent-based software engineering tool based on the object-oriented programming using Java language. Agent-based modeling and simulation is a computational methodology for simulating and exploring phenomena that includes a large set of active components represented by agents. The agents are main components situated in space and time of agent-based simulation environment. In this study, we present hormonal regulation of blood glucose levels by our improved agent-based control mechanism. Hormonal regulation of blood glucose levels is an important process to maintain homeostasis inside the human body. We offer a negative feedback control mechanism with agent-based modeling approach to regulate the secretion of insulin hormone which is responsible for increasing the blood glucose levels. The negative feedback control mechanism run by three main agents that interact with each other to perform their local actions in the simulation environment. The result of this study shows the local behavior of the agents in the negative feedback loop and illustrates how to balance the blood glucose levels. Finally, this study which is thought a potential implementation of agent-based modeling and simulation may contribute to the exploration of other homeostatic control systems inside the human body.


Introduction
Human physiology includes fundamental systems that control the vital functions and processes.Each system has its own functional features.For example, the nervous system is considered as a control center that coordinates all bodily actions and activities, and responds to changes both outside and inside the body [1].The other systems, such as cardiovascular, respiratory, urinary, endocrine, and immune systems, perform their local actions that benefit the internal balance of the body.The internal balance of the body called homeostasis [2] is an important survival process that maintains the keeping of state variables at a constant or stable condition.The endocrine system plays an active role for maintaining homeostasis.It is also known as the hormonal system, which basically regulates metabolic functions such as appetite, mood, sexual, reproduction, growth and development, sleep cycles, and more [3].In this study, we modeled and simulated hormonal regulation of blood glucose level using the agentbased modeling and simulation (ABMS) technique.ABMS is a technique of artificial intelligence.It provides a platform to explain systems behavior based on individual actions and interactions.Individual which is a part of system is defined an agent in ABMS.The agents perform specific tasks depending on rules of agents' actions and interactions in agentbased simulation environment [4][5][6].Agents in accordance with their characteristics are well suitable to represent the system components which presented in this study.ABMS approach has advantage of creating a model compared to other modeling approach based on mathematical and numerical analysis, control theory, biomechanical techniques, etc. [7].ABMS is referred to as "individual-based S. Emek, V. Evren, Ş. Bora / IJOCTA, Vol.9, No. 3, pp.15-20 (2019) model" so that some answers need to find in order to describe the model scenario, like what the agents should be in the model, what the agents' environment is, how to interact with each other and environment, how to define the rules determined the behaviors of agents, what are roles of the agents in the model, and etc. [8,9].
In this paper, we introduce and visualize the process by which the blood glucose levels are regulated by negative feedback control mechanism [10].In order to implement negative feedback control mechanism, we offer three main agents; receptor agent, controller agent and effector agent.These agents interact with each other using the messaging service and run the feedback mechanism.We develop this study in Repast Simphony [11] platform based on the object-oriented programming using Java language.Repast Simphony offers the users and researchers a tool which includes graphical user interface, toolbar to control the simulation processes (start, step, pause, stop, exit, and etc.), displaying agents and their environment, monitoring the output data (time chart, histogram bar), scheduling of simulations, parameters management, and etc.This chapter is organized as follows: Section 2 gives a brief overview of hormonal regulation of blood glucose levels; Section 3 presents the method of this study which offers an agent-based control system; Section 4 provides implementation of case study involving experimental results; Section 5 explains some limitations of this study, and Section 6 concludes with a brief summary of this study.

Hormonal regulation of blood glucose levels
Endocrine system carries out its actions with the hormones produced by the endocrine glands and transmitted to the target cell by the blood circulation.Endocrine gland includes but not limited to pineal gland, pituitary gland, pancreas, ovaries, testes, thyroid gland, parathyroid gland, hypothalamus and adrenal glands.Pancreas secretes two major hormones, insulin and glucagon, that affect blood glucose level.Insulin is produced by the beta cells of the pancreas and glucagon is produced by the alpha cells of the pancreas.Insulin decreases the concentration of glucose in the blood.When blood glucose levels rise, secretion of insulin is triggered.Insulin causes glucose to be converted into glycogen in the liver which is the target tissue.So, glucose is removed from the blood and the blood glucose levels decrease [3,12].All these processes show that hormonal secretions are maintained at optimal levels with negative feedback shown in Figure 1.Our model scenario is created according to the increasing of blood glucose levels after a meal.Blood glucose/sugar levels are the amount of glucose that varies widely throughout bloodstream according to alternate with periods of fasting.In a healthy person, ideal blood glucose range for fasting glucose is between 80-90 mg/dL.Two hours after meal blood glucose concentration must be under the 180 (ideal is under 140) mg/dL.If blood glucose concentration is not less than 140 mg/dL, the person's illness symptoms start to show up [3].

Figure 1. Regulation of blood glucose levels
In Section 3, we introduce our controller model which represents the flow chart shown in Figure 1.

Method
In this study, we developed an agent-based control mechanism to control the blood glucose levels.In our approach, the agent-based control system is composed of a set of dynamic number of autonomous agents.We defined three important agents: a receptor agent, a controller agent and an effector agent [7,13].Figure 2 shows the negative feedback control mechanism that consists of interacting agents.

Figure 2. Negative feedback control mechanism of hormonal regulation of blood glucose levels
Receptor agent senses changes in plasma glucose levels and sends its information to controller agent.We represent the receptor agent as pancreas.Controller agent has a set point.If blood glucose levels above the set point, controller agent sends an insulin message to the effector agent.We represent the effector agent as liver which uptakes glucose and stores as glycogen.Effector agent is responsible for the decreasing in blood glucose levels.Once glucose levels drop below a threshold value, there is no longer enough stimulus for sending insulin message.

Figure 3. UML class diagram that shown agents and their interactions
The unified modeling language (UML) class diagram that shows the interaction of agents is given in Figure 3.
This study is a Repast Simphony project that uses Eclipse integrated development environment (IDE).
The interaction of the agents is provided by the "publish-subscribe" messaging pattern in the interaction package illustrated in Figure 3.Each agent publishes the messages to its listeners and subscribes to the corresponding agent.The listener agent receives the messages and regulates its behavior according to the current environment situation [7,13].

Experimental study
In this study, we have a scenario that shows increase in blood glucose levels according to breakfast, lunch and dinner.The results of the simulation study are illustrated in Figure 4 and Figure 5.In Figure 4, 60 th tick count represents 08.00 am which is time of breakfast.Before breakfast, blood glucose levels fluctuate between 70 and 90 mg/dL.After 60th tick count, eating gradually increases the blood glucose levels.Threshold value of blood glucose levels is set to 120 mg/dL.When the blood glucose levels are more than the threshold value, the controller agent sends insulin message to the effector agent.The insulin levels associated with blood glucose levels increase between 100 th and 150 th tick counts.Effector agent increases insulin levels shown in Figure 5 and decreases the blood glucose levels.Then, it sends the value of blood glucose to receptor agent.Until the blood glucose levels fall below the threshold value, effector agent keeps on sending message.Two hours after breakfast at 240 th tick count, blood glucose levels achieve optimal value.300 th tick count which is time of lunch at 01.00 pm triggers blood glucose levels.Blood glucose levels decrease on insulin control after two hours.In the simulation, minutes is defined by tick count.At 06.00 pm that is time of the last meal, blood glucose level increases about 130mg/dL.At 700 th tick count, decrease of blood glucose levels is observed.

Discussion
This study has some limitations in the creation of the model.We define pancreas as a receptor agent.In the literature [3,14,15], pancreatic islets called islets of Langerhans are clusters of cells located in the pancreas.Pancreatic islets contain beta cells that produce insulin.In this study, beta cells of pancreas may be defined as receptor agents.We define liver as an effector agent.Liver has an important role for glycogen storage.However, skeletal muscle is a major site of glycogen storage [16].Muscle may be added as target tissue of effector agent.
The results of simulation in respect of the parameters are obtained in reference to normal conditions of a healthy adult.Plasma glucose and insulin are simulated hourly, from 08.00 am to midnight, covering the whole day.We are able to obtain and compare simulation data and results based on references in the literature [3,[17][18][19][20].
In this paper, we simulated increase of blood glucose levels and observe insulin levels.In the continuation of this study, we may observe not only the increase in blood glucose level but also the glucagon hormone which is due to the decrease of the blood sugar level.

Conclusion
This study describes implementation of a glucose regulating mechanism using an agent-based software engineering tool.Interacting agents run the regulating mechanism using the messaging service.While exploiting a feedback loop, agents perform their actions and adapt their behaviors.In the result of this study, we observe that how the agent-based control system adjusts to the blood glucose levels after meal.This study deals only with regulation due to the increase in blood glucose level.In the future of this study, case studies such as diabetes which occur due to increase in blood sugar level can be performed by ABMS.

Figure 4 .
Figure 4. Regulation of blood glucose levels after a meal

Figure 5 .
Figure 5. Insulin levels before and after a meal