In the work we present in this thesis we initially make a review of the evolution of the human computer interaction, from the very first and scarce computers until the present moment, when technological breakthroughs have allowed that, in many of the scenarios in which our everyday life take place, we were surrounded by a wide range of electronic devices with which we interact in order to consume some of their services. We will elaborate on how this technological diffusion has introduced information systems in fields beyond the work context, such as education or our homes, and it has given rise to the appearance of the known as intelligent ambients, in which the systems that are in the environment have to adapt themselves to the user and the context of the environment. This adaptation raises some challenges, since interaction with users takes place in new contexts. Particularly, this work identifies two key factors that intelligent ambient should take into account to make the appropriate decisions and perform the appropriate actions in order to achieve a better adaptation to users and context. These factors are the influence of emotions on the interaction, on one side, and the use of the historic contextual information. Due to that, we make a review of both the approaches of decision making systems biased by emotions from the field of affective computing, and the approaches of context-aware systems. Then we present the ant colony optimization metaheuristic as a generic starting point from which we can design systems that take into account the key factors identified. Finally, we elaborate on the two algorithmic approaches based on ant colony optimization we have designed: one for decision making biased by emotions, and another for the use of the available contextual information (including the historical one) as a basis for foreseeing which contextual situations will occur with a higher probability in the nearest future. For both approaches we present through case studies how their use on a problem domain would be, and also the experimental results that show they achieve the goals set.