Cooperation is the foundation of many protocols in wireless networks. Without cooperation, the performance of a network significantly decreases. Hence, all nodes in traditional networks are required to cooperate with each other. In this paper, instead of traditional networks, a network of rational and autonomous nodes is considered, which means that each node itself can decide whether to cooperate with its neighbor or not and performs something that benefits it. We have used Alternative Prisoner’s Dilemma game which is one of the classic games in the field of game theory, to model node's behavior in a nontraditional network. Then, by providing an approach based on Learning Automata, we've tried to encourage the nodes to cooperate with each other.