R&D Competition Versus R&D Cooperation in Oligopolistic Markets with Evolving Structure