We have been investigating a new behavior arbitration mechanism based on the biological immune system. The behavior arbitration mechanism and the biological immune system share certain similarities since both systems deal with various sensory inputs (antigens) through interactions amongmultiple competence modules (lymphocytes and/or antibodies). We have demonstrated the flexible arbitration abilities of our proposed method; however, we have not shown a solution to the problem: how do we prepare an appropriate repertoire of competence modules? In this paper, in order to constructan appropriate immune network without human intervention, we try to incorporate an offline metadynamics function into our previously proposed mechanism. The metadynamics function is an adaptation realized by varying the structure of the immune network. To accomplish this function, we use agenetic algorithm with a devised crossover operator. Finally, we verify our method by carrying out simulations.