Many patterns of affiliative behaviour have been described for primates, for instance: reciprocation and exchange of grooming, grooming others of similar rank, reconciliation of fights, and preferential reconciliation with more valuable partners. For these patterns several functions and underlying cognitive processes have been suggested. It is, however, difficult to imagine how animals may combine these diverse considerations in their mind. Although the co-variation hypothesis, by limiting the social possibilities an individual has, constrains the number of cognitive considerations an individual has to take, it does not present an integrated theory of affiliative patterns either. In the present paper, after surveying patterns of affiliation in egalitarian and despotic macaques, we use an individual-based model with a high potential for self-organisation as a starting point for such an integrative approach. In our model, called GrooFiWorld, individuals group and, upon meeting each other, may perform a dominance interaction of which the outcomes of winning and losing are self-reinforcing. Besides, if individuals think they will be defeated, they consider grooming others. Here, the greater their anxiety is, the greater their motivation to groom others. Our model generates patterns similar to many affiliative patterns of empirical data. By merely increasing the intensity of aggression, affiliative patterns in the model change from those resembling egalitarian macaques to those resembling despotic ones. Our model produces such patterns without assuming in the mind of the individual the specific cognitive processes that are usually thought to underlie these patterns (such as recordkeeping of the acts given and received, a tendency to exchange, memory of the former fight, selective attraction to the former opponent, and estimation of the value of a relationship). Our model can be used as a null model to increase our understanding of affiliative behaviour among primates, in particular macaques.