Cognitive dynamics in a automata gas