Computational Chemotaxis in Ants and Bacteria over Dynamic Environments