**5. Conclusion**

During the simulation runtime, each agent defined in the negative feedback control mechanism interacts with other agents. All of the agents interact with each other by using Java message service. Java message service supports "publish/subscribe" message delivery model. Receptor agent monitors the change of the body temperature and publishes it to the controller agent who has subscribed to the value. Controller agent receives message that includes the body temperature value. Controller agent compares the body temperature value to its set point value. Controller agent sends a message to the effector agents which start or stop the negative feedback mechanism. Effector agents produce a response based on the message that they receive, and they publish to the receptor agent to correct the deviation with negative feedback. Negative feedback control mechanism achieves a balance between heat production and heat loss. The output of the negative feedback mechanism is illustrated in **Figure 9**.

The simulation has a scenario of fever disease. This scenario achieves a balance with the

**1.** At the initial time, the core body temperature fluctuates between 36.7 and 37.2°C which is an acceptable normal range inside the human body. The set point of the body temperature

**2.** An infection that causes a fever disease is assumed that it starts with increasing the body temperature. The set point of the body temperature is set to 40°C at which the maximum value is assumed by homeostasis. The body temperature is less than the new set point of

**3.** Increased body temperature triggers shiver which is the reaction of the body. Shiver tries to gain the body heat which causes the constriction of the blood vessel called vasoconstriction. The controller agent publishes message "VASOCONSTRICTION" to the effector

agent-based negative feedback control mechanism as follows:

**Figure 8.** Negative feedback control mechanism of thermoregulation [16].

is set to 37°C.

40 Modeling and Computer Simulation

the body temperature.

This chapter has introduced the reader to ABMS, and it described implementations of different case studies utilizing the Repast Simphony toolkit. ABMS offers an extensible way to model biological systems consisting of autonomous and interacting agents which perform their actions and adapt their behaviors. Computer simulation helps the researcher to explore the behavior of a dynamic system. This chapter is concluded by observing interactions of real systems' components in the abstraction level.
