A Behavior Adaptation Algorithm based on Hierarchical Partially Observable Markov Decision Process