In behavioral experiments, the hawkmoth Deilephila elpenor can learn both the color and the position of artificial flowers. When very similar colors are used, moths select the correct color during the first test on a given day, thus using a stimulus strategy, but after repeated rewards, they switch to a place strategy and choose the flower in the position where they received the reward. When dissimilar colors are used, the moths continue to select flowers based on color and ignore position. We show how a computational model can reproduce the behavior in the experimental situation. The aim of the model is to investigate which learning and behavior selection strategies are necessary to reproduce the behavior observed in the experiment. The model is based on behavioral data and the sensitivities of the moth photoreceptors. The model consists of a number of interacting behavior systems that are triggered by specific stimuli and control specific behaviors. The ability of the moth to learn the colors of different flowers and the adaptive processes involved in the choice between stimulus-approach and place-approach strategies are reproduced very accurately by the model. The model has implications both for further studies of the ecology of the animal and for robotic systems.