New proposal for numerical simulations of systems with a theta-vacuum term