In this paper, we try to acquire various behavior patterns of autonomous exploration agent using several learning environments. In case of previous learning methods using a single behavior rule set, it is hard to acquire the behavior that covers all learning environments. In our method, we divide learning environments into some primitive environments whose properties differ each other, and then generate modules that are specialized for each primitive environment. To optimize behavior rules of agents, we adopt Graph Structured Program Evolution (GRAPE) which can automatically generates graph structured programs. In unknown environments, each module is switched by a program named “switcher”. The switcher selects the module that acts better in a neighboring environment. Through several experiments, our method achieved higher exploration rate in unknown environments compared to simple GRAPE, random search, and the method that switches modules randomly.