Loads an entire population and their chromosome from the XML parameter. The old population is first cleared.
Namespace: RSGeneticAlgorithm
Delphi
|
public
procedure LoadFromXML( const ChromosomesXML: IXMLChromosomes ); reintroduce; overload; virtual;
|
Parameters
ChromosomesXML
Type: IXMLChromosomes
The following example loads the gene descriptions and a representative population from a genetic algorithm domain (read from a file):
Delphi
|
procedure LoadFromFile(const FileName: string);
var
GAXML: IXMLGADomainType;
begin
GAXML := LoadGeneticAlgorithm(Filename).Domain;
RSGeneticAlgorithm1.Genes.LoadFromXML( GAXML.GenoType );
RSGeneticAlgorithm1.Population.LoadFromXML( GAXML.Chromosomes );
end;
|
|