This folder contains the files and dataset necessary to recreate the results from the paper: Meibodi, N., Abbasi, H., Schubö, A. et al. Distracted by Previous Experience: Integrating Selection History, Current Task Demands and Saliency in an Algorithmic Model. Comput Brain Behav 7, 268–285 (2024). https://doi.org/10.1007/s42113-024-00197-6 Contents: • attention_models.py: the models are here. Run this file (and also the next .py files) in python 3.8. • Maximum_Likelihood.py: this code finds RT distribution by fitting several functions on the data. The results are presented in Appendix A. • attention_model_conditions.py: generalized linear model. The results are presented in Appendix C. • PlotFunctions_attentionModel.py: all the functions needed to plot the modeling results are in this file. It is called and used in attention_models.py. • torch_hessian.py: computation of Hessian matrix, it is needed in 'attention_models.py' to compute Laplace approximation for model comparison. • torchjson.py: helps to save tensors in json files • Data.xlsx: the dataset. • Description of the uploaded dataset.docx: data format and the content of Data.xlsx is described here. Acknowledgments This work was supported by the DFG SFB-TRR 135 (222641018) “Cardinal Mechanisms of Perception,” projects C6 and B3, and “The Adaptive Mind,” funded by the Excellence Program of the Hessian Ministry for Science and the Arts.