Indirect estimation of agent-based models. An application to a simple diffusion model