Adaptive animat navigation based on a flexibility model for the environment