Created
April 4, 2010 03:45
-
-
Save gidili/355077 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function [ Population ] = genHighDiversityPop(GenomeLength, FitnessFcn, options) | |
%generateHighDensityPopulation generates initial population of rules | |
% This function generates popSize rules of size chromSize. The rules are | |
% generated with pseudo-uniform distribution of densitites of 1s, spanning from | |
% very low to very high as this facilitates evolution. | |
%constants | |
chromSize = GenomeLength; | |
popSize = 100; | |
% thresholds go from 0 (all 0) to 1 (all 1) - need to play with params | |
thresholdVector = linspace(0.1,0.9,popSize); | |
% vectors are per row | |
Population = bsxfun(@lt,rand(popSize, chromSize),thresholdVector'); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment