Agent-based modeling (ABM) has been increasingly used by scientists to study a wide range of phenomena in physics, chemistry, and biology. In these models, each element (agent) follows local, simple rules, and the overall macroscopic pattern emerges from these multiple local behaviors. Despite its roots in the natural sciences, ABM is highly relevant to research in the social sciences. The recent decades have seen a surge in social-science studies employing ABM, and more recently it has also been used to illustrate aspects of cognitive development, collaboration, and group work. In this paper, we describe a model to explain sudden leaps in cognition observed in a science classroom when students switch between the use of two types of epistemological resources. The model confirms that reliance on brute-force search is very sensitive to increased complexity of the content, whereas selective search is initially less efficient but more accurate for complex content.