And then they experiment: Add in 50,000 newcomers, say, and invest heavily in education. How does the artificial society change? The model tells you. Don’t like it? Just hit that reset button and try a different policy.

The goal of the project is to give politicians an empirical tool that will help them assess competing policy options so they can choose the most effective one. It’s a noble idea: If leaders can use artificial intelligence to predict which policy will produce the best outcome, maybe we’ll end up with a healthier and happier world. But it’s also a dangerous idea: What’s “best” is in the eye of the beholder, after all.

“Because all our models are transparent and the code is always online,” said LeRon Shults, who teaches philosophy and theology at the University of Agder in Norway, “if someone wanted to make people more in-group-y, more anxious about protecting their rights and their group from the threat of others, then they could use the model to [figure out how to] ratchet up anxiety.”

The Modeling Religion Project—which has collaborators at Boston’s Center for Mind and Culture, and the Virginia Modeling, Analysis, and Simulation Center, as well as the University of Agder—has been running for the past three years, with funding from the John Templeton Foundation. It wrapped up last month. But it’s already spawned several spin-off projects.

The one that focuses most on refugees, Modeling Religion in Norway (MODRN), is still in its early phases. Led by Shults, it’s funded primarily by the Research Council of Norway, which is counting on the model to offer useful advice on how the Norwegian government can best integrate refugees. Norway is an ideal place to do this research, not only because it’s currently struggling to integrate Syrians, but also because the country has gathered massive data sets on its population. By using them to calibrate his model, Shults can get more accurate and fine-grained predictions, simulating what will happen in a specific city and even a specific neighborhood.

Another project, Forecasting Religiosity and Existential Security with an Agent-Based Model, examines questions about nonbelief: Why aren’t there more atheists? Why is America secularizing at a slower rate than Western Europe? Which conditions would speed up the process of secularization—or, conversely, make a population more religious?

Shults’s team tackled these questions using data from the International Social Survey Program conducted between 1991 and 1998. They initialized the model in 1998 and then allowed it to run all the way through 2008. “We were able to predict from that 1998 data—in 22 different countries in Europe, and Japan—whether and how belief in heaven and hell, belief in God, and religious attendance would go up and down over a 10-year period. We were able to predict this in some cases up to three times more accurately than linear regression analysis,” Shults said, referring to a general-purpose method of prediction that prior to the team’s work was the best alternative.