This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Saves all phenotypic progress back to the genomes. | |
/// </summary> | |
private void PerformLamarkianEvolution(IList<TGenome> genomeList, Func<IAgent, FastCyclicNetwork> networkSelector) | |
{ | |
for (int i = 0; i < _agents.Length; i++) | |
{ | |
var agent = _agents[i]; | |
// Get the network for this teacher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double SampleGaussian(Random random, double mean, double stddev) | |
{ | |
// The method requires sampling from a uniform random of (0,1] | |
// but Random.NextDouble() returns a sample of [0,1). | |
double x1 = 1 - random.NextDouble(); | |
double x2 = 1 - random.NextDouble(); | |
double y1 = Math.Sqrt(-2.0 * Math.Log(x1)) * Math.Cos(2.0 * Math.PI * x2); | |
return y1 * stddev + mean; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97=proba1[32] | |
51=proba2[32*256+35] | |
44=proba2[32*256+38] | |
51=proba2[32*256+39] | |
40=proba2[32*256+48] | |
35=proba2[32*256+49] | |
37=proba2[32*256+50] | |
51=proba2[32*256+51] | |
44=proba2[32*256+52] | |
44=proba2[32*256+53] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Fits a line to a collection of (x,y) points. | |
/// </summary> | |
/// <param name="xVals">The x-axis values.</param> | |
/// <param name="yVals">The y-axis values.</param> | |
/// <param name="inclusiveStart">The inclusive inclusiveStart index.</param> | |
/// <param name="exclusiveEnd">The exclusive exclusiveEnd index.</param> | |
/// <param name="rsquared">The r^2 value of the line.</param> | |
/// <param name="yintercept">The y-intercept value of the line (i.e. y = ax + b, yintercept is b).</param> | |
/// <param name="slope">The slop of the line (i.e. y = ax + b, slope is a).</param> |
NewerOlder