Cooperation among nodes is fundamental for the operation of mobile ad hoc networks (MANETs). In such networks, there could be selfish nodes that use resources from other nodes to send their packets but that do not offer their resources to forward packets for other nodes. Thus, a cooperation enforcement mechanism is necessary. Trust models have been proposed as mechanisms to incentive cooperation in MANETs and some of them are based on game theory concepts. Among game theoretic trust models, those that make nodes’ strategies evolve genetically have shown promising results for cooperation improvement. However, current approaches propose a highly centralized genetic evolution which render them unfeasible for practical purposes in MANETs. In this article, we propose a trust model based on a non-cooperative game that uses a bacterial-like algorithm to let the nodes quickly learn the appropriate cooperation behavior. Our model is completely distributed, achieves optimal cooperation values in a small fraction of time compared with centralized algorithms, and adapts effectively to environmental changes.