[galib] galib Digest, Vol 51, Issue 1

Anselmo Pitombeira anselmop at sc.usp.br
Mon Oct 1 13:11:17 EDT 2007


Hi, Tim. I have tried to load from a file a previously stored 
population, but I failed. If you glance at the documentation, you'll see 
that the GAPopulation class has a method called read(istream &). I tried 
to use it, but it wasn´t working and I gave it up. I was interested in 
storing the actual state of the population so that I could resume 
evolution in a later time. This would be very useful, since the 
executions of my GAs last dozens of hours. It will be great if you 
manage to retrieve a population from a file.

Good luck

Anselmo

Eng. Anselmo Pitombeira
 
Laboratório de Simulação e Controle
NUMA - Núcleo de Manufatura Avançada
Programa de Pós-Graduação em Engenharia Mecânica
EESC-USP
 
www.simulacao.eesc.sc.usp.br
 
Tel: +55 16 3373 9432/ +55 16 3376 1279



galib-request at mit.edu escreveu:
> Send galib mailing list submissions to
> 	galib at mit.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mailman.mit.edu/mailman/listinfo/galib
> or, via email, send a message with subject or body 'help' to
> 	galib-request at mit.edu
>
> You can reach the person managing the list at
> 	galib-owner at mit.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of galib digest..."
>
>
> Today's Topics:
>
>    1. Dumping Population and restarting (TIMOTHY RONALD PHILLIPS)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 29 Sep 2007 10:51:31 +0100
> From: "TIMOTHY RONALD PHILLIPS" <t.r.phillips at newcastle.ac.uk>
> Subject: [galib] Dumping Population and restarting
> To: <galib at mit.edu>
> Message-ID:
> 	<011571DA626E824EA97EF8AD253F5A1CCB07F8 at moonraker.campus.ncl.ac.uk>
> Content-Type: text/plain;	charset="us-ascii"
>
> I am interested in storing the current generation of solutions to files,
> and being able to start the GA from the population stored in a file. I
> am at present using a Dec2Bin representation
>
> Any suggestions on how I would do this? I have got the the phenotype
> writing to file using STD_OFSTREAM, which will write the phenotype of
> the population to file using the code below
>
> float Objective(GAGenome &);
>
> int main(int argc, char **argv)
> {
>
> 	ofstream outfile;
>
> ...
> while(!ga.done())
> 	{
> 		++ga;
> 		Gen=Gen+1;
> 		ofstream outfile;
> 		char myname [50];
> 		sprintf_s(myname, 50,
> "29-09-07--10-00-IncBestSolGen%d.dat\n", Gen);
> 		outfile.open(myname, (STD_IOS_OUT | STD_IOS_TRUNC));
> 		
>
> 		//fopen_s( &stream, "Filename.dat", "w" );
>
> 		for (int popmem=0; popmem<ga.populationSize(); popmem++)
> 		{
> 	
> outfile<<((ga.population().individual(popmem)))<<"\n";
> 		}
> 		outfile.close();	;
> 	}
> How would I go about importing this as the start population? Could the
> best genomes also be populated by importing from file in a similar way?
>
> Thank you for you assistance
>
>
> Tim
>
>
>
> ------------------------------
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib
>
>
> End of galib Digest, Vol 51, Issue 1
> ************************************
>
>
>   



More information about the galib mailing list