/// <summary> /// info to generate new random networks is used to generate new species /// </summary> public NetworkEvolution(List <EvolutionaryLine <Game> > species, int inputLenght, int outputLenght, int startingSpecieNetworkCount, TemporalNetwork.ActivationFunctions activation = TemporalNetwork.ActivationFunctions.Sine, int layersCount = 1, int minNeurons = 1, int maxNeurons = 6) { this.startingSpecieNetworksCount = startingSpecieNetworkCount; this.species = species; this.activation = activation; this.inputLenght = inputLenght; this.outputLenght = outputLenght; startingLayersCount = layersCount; this.minNeurons = minNeurons; this.maxNeurons = maxNeurons; }
public NetworkEvolution(Game startingState, int speciesCount, int initialSpecieNetworkCount, MutationInfo mutationInfo, TemporalNetwork.ActivationFunctions activation, int inputLenght, int outputLenght, int layersCount, int minNeurons, int maxNeurons) { startingSpecieNetworksCount = initialSpecieNetworkCount; this.startingState = startingState; this.activation = activation; this.inputLenght = inputLenght; this.outputLenght = outputLenght; this.startingLayersCount = layersCount; this.minNeurons = minNeurons; this.maxNeurons = maxNeurons; species = new List <EvolutionaryLine <Game> >(); for (int i = 0; i < speciesCount; i++) { species.Add(new EvolutionaryLine <Game>(startingState, startingSpecieNetworksCount, mutationInfo, activation, inputLenght, outputLenght, layersCount, minNeurons, maxNeurons)); } }
public FittedNetwork(Game game, MutationInfo mutationInfo, TemporalNetwork.ActivationFunctions activationFunction, int inputLenght, int outputLenght, int layersCount, int minNeurons, int maxNeurons) { this.game = game; network = new TemporalNetwork(activationFunction, inputLenght, outputLenght, layersCount, minNeurons, maxNeurons, mutationInfo); fitnessScore = 0; }
/// <summary> /// Starts a new family tree with a random biased network /// </summary> public EvolutionaryLine(Game startingState, int startingNetworkCount, MutationInfo mutationInfo, TemporalNetwork.ActivationFunctions activationFunction, int inputLenght, int outputLenght, int layersCount, int minNeurons, int maxNeurons) { networks = new List <FittedNetwork <Game> >(); for (int i = 0; i < startingNetworkCount; i++) { networks.Add(new FittedNetwork <Game>(startingState, mutationInfo, activationFunction, inputLenght, outputLenght, layersCount, minNeurons, maxNeurons)); } }