You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get or assign an innovation number for a structural mutation. If this exact mutation (same nodes and type)
1482
+
has already occurred in the current generation, returns the existing innovation number. Otherwise, increments
1483
+
the global counter and assigns a new innovation number.
1484
+
1485
+
:param int input_node: The input node ID for the connection
1486
+
:param int output_node: The output node ID for the connection
1487
+
:param str mutation_type: Type of mutation: ``'add_connection'`` (new connection), ``'add_node_in'`` (connection from original input to new node), ``'add_node_out'`` (connection from new node to original output), or ``'initial_connection'`` (connection in initial population)
1488
+
:return: The innovation number for this structural mutation
1489
+
:rtype::pytypes:`int <typesnumeric>`
1490
+
1491
+
.. py:method:: reset_generation()
1492
+
1493
+
Clear generation-specific tracking at the start of a new generation. This method should be called at the
1494
+
beginning of each generation's reproduction phase. It clears the generation_innovations dictionary but preserves
1495
+
the global_counter so innovation numbers never repeat.
1496
+
1497
+
.. py:method:: get_current_innovation_number()
1498
+
1499
+
Get the current (most recently assigned) innovation number.
1500
+
1501
+
:return: The current value of the global counter
1502
+
:rtype::pytypes:`int <typesnumeric>`
1503
+
1450
1504
.. py:module:: math_util
1451
1505
:synopsis: Contains some mathematical functions not found in the Python2 standard library, plus a mechanism for looking up some commonly used functions (such as for the species_fitness_func) by name.
0 commit comments