Heterogeneous platforms collaborate to execute tasks through different operational models, resulting in the task allocation problem that incorporates different agent models. In this paper, we address the problem of cooperative target allocation for heterogeneous agent models, where we design the task-agent matching model and the multi-agent routing model. Since the heterogeneity and cooperativity of agent models lead to a coupled allocation problem, we propose a matrix-encoding genetic algorithm (MEGA) to plan reliable allocation schemes. Specifically, an integer matrix encoding is resorted to represent the priority between targets and agents in MEGA and a ranking rule is designed to decode the priority matrix. Based on the proposed encoding-decoding framework, we use the discrete and continuous optimization operators to update the target-agent match pairs and task execution orders. In addition, to adaptively balance the diversity and intensification of the population, a dynamical supplement strategy based on Hamming distance is proposed. This strategy adds individuals with different diversity and fitness at different stages of the optimization process. Finally, simulation experiments show that MEGA algorithm outperforms the conventional target allocation algorithms in the heterogeneous agent scenario.