Motion pattern prediction in dynamic environments