Adaptive Gait Switching Control Structure Using Max Plus In Legged Locomotion