Understanding the power of stigmergy of anonymous agents in discrete environments