Implementation of a regulatory gene network to simulate the TH1/2 differentiation in an agent-based model of hypersensitivity reactions. Motivation: An unbalanced differentiation of T helper cells from precursor type TH0 to the TH1 or TH2 phenotype in immune responses often leads to a pathological condition. In general, immune reactions biased toward TH1 responses may result in auto-immune diseases, while enhanced TH2 responses may cause allergic reactions. The aim of this work is to integrate a gene network of the TH differentiation in an agent-based model of the hyper-sensitivity reaction. The implementation of such a system introduces a second level of description beyond the mesoscopic level of the inter-cellular interaction of the agent-based model. The intra-cellular level consists in the cell internal dynamics of gene activation and transcription. The gene regulatory network includes genes-related molecules that have been found to be involved in the differentiation process in TH cells. Results: The simulator reproduces the hallmarks of an IgE-mediated hypersensitive reaction and provides an example of how to combine the mesoscopic level description of immune cells with the microscopic gene-level dynamics. Availability: The basic version of the simulator of the immune response can be downloaded here: http://www.iac.cnr.it/ filippo/C-ImmSim.html