Programming stigmergic coordination with the TOTA middleware