Insects and fish, which make swarm in nature, are simple organisms as individuals. However, such organisms behave in an orderly manner throughout the swarm by cooperating with each other using simple rules. In this paper, swarm model with variable parameters is proposed. Simulation results showed parameters that allowed the swarm to pass through the confined environment quickly. In case of the variable avoidance speed coefficient and the high-speed coefficient, the effect on the swarm was significant. On the other hand, in case of the variable low-speed coefficient, there was negligible effect on the swarm.