geneticengine.algorithms.gp.cooperativegp ========================================= .. py:module:: geneticengine.algorithms.gp.cooperativegp Attributes ---------- .. autoapisummary:: geneticengine.algorithms.gp.cooperativegp.a geneticengine.algorithms.gp.cooperativegp.b Classes ------- .. autoapisummary:: geneticengine.algorithms.gp.cooperativegp.CooperativeGP Module Contents --------------- .. py:data:: a .. py:data:: b .. py:class:: CooperativeGP(grammar1, grammar2, function, representation1 = None, representation2 = None, population1_size = 100, population2_size = 200, coevolutions = 1000, random = None, kwargs1 = None, kwargs2 = None) Bases: :py:obj:`Generic`\ [\ :py:obj:`a`\ , :py:obj:`b`\ ] CooperativeGP takes two representations and a function that pits two individuals against each other. Given grammar1 and grammar 2, a population of each is generated and evolved one after the other. The fitness function is the same for both evolutions, but first minimizes the function, and the second maximizes the fitness. It runs for a given number of iterations defined by the coevolutions parameter. Creates a new object to co-evolve species1 and species2. :param grammar1: Grammar of species1 :type grammar1: Grammar :param grammar2: Grammar of species2 :type grammar2: Grammar :param function: Function that returns a score for a battle between one individual of species1 and another of species2 :type function: Callable[[a,b], float] :param representation1: Representation of species1 :type representation1: Representation :param representation2: Representation of species2 :type representation2: Representation :param population1_size: Population size of species1 :type population1_size: int :param population2_size: Population size of species2 :type population2_size: int :param coevolutions: How many iterations of a pair of evolutions :type coevolutions: int :param random: The random number generator :type random: Source :param kwargs1: The extra arguments for the GP object of species1 :type kwargs1: dict :param kwargs2: The extra arguments for the GP object of species2 :type kwargs2: dict .. py:attribute:: g1 .. py:attribute:: g2 .. py:attribute:: ff .. py:attribute:: population1_size :value: 100 .. py:attribute:: population2_size :value: 200 .. py:attribute:: coevolutions :value: 1000 .. py:attribute:: representation1 .. py:attribute:: representation2 .. py:attribute:: kwargs1 .. py:attribute:: kwargs2 .. py:attribute:: random .. py:method:: search()