The automatic training of agent-based simulators can be a complex task because of (a) their common nondeterministic behavior and (b) their complex relationships between their input parameters and the outputs. This work presents a technique called ATABS for automatically training agent-based simulators. This technique is based on a novel mechanism for generating random numbers that reduces the variability of the global results. This work provides a framework that automates this training by considering the relationships between the simulation parameters and the output features. This technique and framework have been applied to automatically train two different simulators. The current approach has been empirically compared with the most similar alternative. The results show that ATABS outperforms this alternative considering (1) the similarity between simulated and real data and (2) the execution time in the training process. The ATABS framework is publicly available. In this way, it ensures not only the reproducibility of the experiments, but also allows practitioners to apply the current approach to different agent-based simulators. (C) 2016 Elsevier B.V. All rights reserved.