A model of knowledge reuse for the fast adaptation to similar tasks