This project aims at defining smart policies for the selection of the individuals that must be tested during an epidemics with the goal of maximizing the effectiveness of selective quarantine measures. The starting point of this project is to model epidemics using stochastic cellular automata and to devise ways to estimate the probability that each individual is infected. This probability estimation can be used as a guideline to prescribe the tests. This project aims at tackling the most relevant practical (tuning and validation of the model) and theoretical (estimation of the probability and design of the policies) aspects to make this idea a viable tool to support the decisions during an epidemics.