Package net.bmahe.genetics4j.neat
Class NeatUtils
java.lang.Object
net.bmahe.genetics4j.neat.NeatUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
compatibilityDistance
(List<Connection> firstConnections, List<Connection> secondConnections, float c1, float c2, float c3) static float
compatibilityDistance
(Genotype genotype1, Genotype genotype2, int chromosomeIndex, float c1, float c2, float c3) static Map
<Integer, Set<Connection>> computeBackwardConnections
(List<Connection> connections) computeBackwardLinks
(List<Connection> connections) computeDeadNodes
(List<Connection> connections, Map<Integer, Set<Integer>> forwardConnections, Map<Integer, Set<Integer>> backwardConnections, Set<Integer> outputNodeIndices) Working backward from the output nodes, we identify the nodes that did not get visited as dead nodescomputeForwardLinks
(List<Connection> connections) partitionLayersNodes
(Set<Integer> inputNodeIndices, Set<Integer> outputNodeIndices, List<Connection> connections) static <T extends Comparable<T>>
List<Species<T>> speciate
(RandomGenerator random, SpeciesIdGenerator speciesIdGenerator, List<Species<T>> seedSpecies, Population<T> population, BiPredicate<Individual<T>, Individual<T>> speciesPredicate)
-
Constructor Details
-
NeatUtils
private NeatUtils()
-
-
Method Details
-
computeDeadNodes
public static Set<Integer> computeDeadNodes(List<Connection> connections, Map<Integer, Set<Integer>> forwardConnections, Map<Integer, Set<Integer>> backwardConnections, Set<Integer> outputNodeIndices) Working backward from the output nodes, we identify the nodes that did not get visited as dead nodes- Parameters:
connections
-forwardConnections
-backwardConnections
-outputNodeIndices
-- Returns:
-
computeForwardLinks
-
computeBackwardLinks
-
computeBackwardConnections
-
partitionLayersNodes
-
compatibilityDistance
public static float compatibilityDistance(List<Connection> firstConnections, List<Connection> secondConnections, float c1, float c2, float c3) -
compatibilityDistance
-
speciate
public static <T extends Comparable<T>> List<Species<T>> speciate(RandomGenerator random, SpeciesIdGenerator speciesIdGenerator, List<Species<T>> seedSpecies, Population<T> population, BiPredicate<Individual<T>, Individual<T>> speciesPredicate)
-