Adaptive Framework for Ambient Intelligence in Rehabilitation Assistance