// This file is a part of the Framsticks GenoFX library. // Copyright (C) 2002-2011 Maciej Komosinski. See LICENSE.txt for details. // Refer to http://www.framsticks.com/ for further information. #include "geno_ftest.h" #include "nonstd.h" //randomN, rnd01 /** \file Sample output (simple examples of various genetic operations): \anchor geno_ftest_example \include geno_ftest_example Produced by the source: \include geno_ftest.cpp */ #define FIELDSTRUCT Geno_ftest static ParamEntry GENOtestparam_tab[]= //external access to ftest genetic parameters { {"Genetics: ftest",1,1,}, {"ftest_mut",0,0,"Mutation probability","f 0 1",FIELD(prob),"How many genes should be mutated during single mutation (1=all genes, 0.1=ten percent)",}, {0,}, }; #undef FIELDSTRUCT Geno_ftest::Geno_ftest() { par.setParamTab(GENOtestparam_tab); par.select(this); supported_format='t'; //'0' for f0, '1' for f1, etc. prob=0.1; } ///The only letters allowed are A,T,G,C int Geno_ftest::checkValidity(const char* gene) { if (!gene[0]) return 1; //empty is not valid bool ok=true; int i; for(i=0;i