A computer-implemented method for automatically adjusting a haptic effect on a device (330, 420, 520, 620), the computer-implemented method comprising: generating the haptic effect based on one or more haptic parameters; measuring an affective state of a user (210, 410, 510, 610) experiencing the haptic effect by using one or more affective sensors; measuring a context of the user (210, 410, 510, 610) experiencing the haptic effect, the context comprising an interaction of the user (210, 410, 510, 610) with the device (330, 420, 520, 620) at a time that the user (210, 410, 510, 610) experiences the haptic effect; identifying a difference between the affective state and a pre-defined affective state; adjusting at least one value of at least one haptic parameter of the one or more haptic parameters based on the measured affective state of the user (210, 410, 510, 610) and the context of the user (210, 410, 510, 610) to reduce the identified difference; and generating a new haptic effect based on the one or more haptic parameters, wherein the at least one adjusted haptic parameter causes the new haptic effect to be different from the haptic effect; wherein the new haptic effect produces a new affective state of the user (210, 410, 510, 610), wherein the new affective state is more similar to the pre-defined affective state; and automatically adjusting a set of one or more haptic effects based on an affective state of the user, wherein the device (330, 420, 520, 620) automatically introduces variations in the one or more haptic parameters of the set of one or more haptic effects, and measures the affective state of the user using the one or more affective sensors, and gradually learns an optimal set of one or more haptic effects for the specific user (210, 410, 510, 610). generating the haptic effect based on one or more haptic parameters; measuring an affective state of a user (210, 410, 510, 610) experiencing the haptic effect by using one or more affective sensors; measuring a context of the user (210, 410, 510, 610) experiencing the haptic effect, the context comprising an interaction of the user (210, 410, 510, 610) with the device (330, 420, 520, 620) at a time that the user (210, 410, 510, 610) experiences the haptic effect; identifying a difference between the affective state and a pre-defined affective state; adjusting at least one value of at least one haptic parameter of the one or more haptic parameters based on the measured affective state of the user (210, 410, 510, 610) and the context of the user (210, 410, 510, 610) to reduce the identified difference; and generating a new haptic effect based on the one or more haptic parameters, wherein the at least one adjusted haptic parameter causes the new haptic effect to be different from the haptic effect; wherein the new haptic effect produces a new affective state of the user (210, 410, 510, 610), wherein the new affective state is more similar to the pre-defined affective state; and automatically adjusting a set of one or more haptic effects based on an affective state of the user, wherein the device (330, 420, 520, 620) automatically introduces variations in the one or more haptic parameters of the set of one or more haptic effects, and measures the affective state of the user using the one or more affective sensors, and gradually learns an optimal set of one or more haptic effects for the specific user (210, 410, 510, 610).