Dynamic patterns in similarity-based cooperation: an agent-based investigation