Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)
BestIndNew = colbestind(ColBestOpt, BestIndOld, Chrom, ObjV, RankCh)
Collect best individuals during an optimization run This functions collects the best individuals during an optimiztaion run. The user defines, how many individuals (variable values and corresponding objective values - even multi-objective) are collected. The function takes care, that no individual is collected twice (comparison of variable values). It may be specified, that only one individual per objective value is collected (then, the objective values are compared, and not the variable values). Syntax: BestIndNew = colbestind(ColBestOpt, BestIndOld, Chrom, ObjV, RankCh) Input parameter: ColBestOpt- (optional) Cell array containing parameters for collection of best individuals ColBestOpt{1} = ColIndPartPop: (optional) scalar containing the number of individuals to collect (when smaller 1, the value specifies the number as part of the population, otherwise floor(ColIndPartPop) individuals are collected) example: 0.1 means, that 10% of the individuals of the population are copied to BestIndNew, it is assured, that these individuals are different from BestIndOld 1 (or 1.001) means, that only 1 individual is collected the number of copied individuals is only smaller, when not enough different individuals are found (different variable values) if omitted or NaN, 0.1 is assumed ColBestOpt{2} = ColIndCompWhat: (optional) scalar indicating, what should be compared (when checking for identical/not useful individuals) 0: Check only for identical variable values 1: Check for identical objective values and identical variable values 2: Check only for identical objective values if omitted or NaN, ColIndCompWhat = 0 is assumed ColBestOpt{3} = ColIndWriteFile: (optional) scalar indicating, if the good individuals should be written to file, the file name is given in ColIndFileName (ColBestOpt{3}) 0: do not write to file 1: write good individuals to file if omitted or NaN, ColIndFileName = 0 is assumed ColBestOpt{4} = ColIndFileName: (optional) string defining the file name for the collected good individuals if omitted or NaN, ColIndFileName = straddtime('BestIndCollected.txt') is assumed BestIndOld- Cell array containing previous best individuals {1} contains variables, {2} contains objective values Chrom - Matrix containing individuals of current generation ObjV - Vector/Matrix containing objective values of current generation RankCh - Vector containg fitness values (from ranking) of individuals in Chrom Output parameter: BestIndNew- Cell array containing best individuals from BestIndOld and from Chrom See also: geamain2
This function calls | This function is called by |
---|---|