From yi.zong at risoe.dk Fri Apr 4 07:09:03 2008
From: yi.zong at risoe.dk (yi.zong@risoe.dk)
Date: Fri, 04 Apr 2008 13:09:03 +0200
Subject: [galib] how to use GaLib as a shared library
Message-ID: <7F526FDC6908FB4AA1985F13F0AFAC140252E1F2@EXCHG-VS1.risoe.dk>
Dear Matthew Wall,
Could you tell me, how I can use your GaLib as a shared library, when I
using it?
Thank you in advance,
I am looking forward to your response.
Yi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20080404/02c1f08c/attachment.htm
From mike at vee.net Sun Apr 6 06:14:07 2008
From: mike at vee.net (Michael Gratton)
Date: Sun, 06 Apr 2008 20:14:07 +1000
Subject: [galib] buffer overflow with long score file filenames
Message-ID: <1207476847.18185.10.camel@tremelay>
Hi,
Using long paths (>64 bytes) for the score file name causes a buffer
overflow in galib247.
The attached patch fixes this. It just removes the string copy in
GAGeneticAlgorithm::setptr() before calling
GAStatistics::scoreFilename(), because that method makes a copy anyway.
Cheers,
/Mike
--
? Michael Gratton. Geeknik since 1976.
?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gaNscoreFilename-length.patch
Type: text/x-patch
Size: 536 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/galib/attachments/20080406/c69b2022/gaNscoreFilename-length.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.mit.edu/pipermail/galib/attachments/20080406/c69b2022/attachment.bin
From yi.zong at risoe.dk Tue Apr 8 03:41:58 2008
From: yi.zong at risoe.dk (yi.zong@risoe.dk)
Date: Tue, 08 Apr 2008 09:41:58 +0200
Subject: [galib] how to compile GaLib as a shared library?
Message-ID: <7F526FDC6908FB4AA1985F13F0AFAC140252E5C6@EXCHG-VS1.risoe.dk>
Dear all,
Anybody can tell me how can I use GaLib as a shared library (libga.so) instead of a static library (libga.a)?
Thanks in advance,
Yi
Yi Zong
Post doc
Phone direct +45 4677 5045
Mobile
yi.zong at risoe.dk
Wind Energy Department
Ris? National Laboratory for Sustainable Energy
Technical University of Denmark - DTU
Building 118, P.O. Box 49
DK-4000 Roskilde, Denmark
Tel +45 4677 4677
Fax +45 4677 5083
www.risoe.dtu.dk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20080408/deb36600/attachment.htm
From brian_barkey at juno.com Tue Apr 8 12:31:11 2008
From: brian_barkey at juno.com (Brian Barkey)
Date: Tue, 8 Apr 2008 10:31:11 -0600
Subject: [galib] galib Digest, Vol 57, Issue 3
Message-ID: <20080408.103111.336.4.brian_barkey@juno.com>
Hi Yi,
It very much depends on which compiler you use. I use Borland
builder . And I think I posted my method here some time ago. (years?)
Good luck!
Brian Barkey
Also, I kind of remembered that M. Wall wanted links/info about work
produced from his library. Does he still want it or is there a website
with it listed?
>
> Dear all,
>
> Anybody can tell me how can I use GaLib as a shared library
> (libga.so) instead of a static library (libga.a)?
>
> Thanks in advance,
>
>
>
> Yi
>
>
>
>
>
> Yi Zong
> Post doc
> Phone direct +45 4677 5045
> Mobile
> yi.zong at risoe.dk
>
>
> Wind Energy Department
> Ris? National Laboratory for Sustainable Energy
> Technical University of Denmark - DTU
> Building 118, P.O. Box 49
> DK-4000 Roskilde, Denmark
> Tel +45 4677 4677
> Fax +45 4677 5083
> www.risoe.dtu.dk
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
http://mailman.mit.edu/pipermail/galib/attachments/20080408/deb36600/atta
chment-0001.htm
>
> ------------------------------
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib
>
>
> End of galib Digest, Vol 57, Issue 3
> ************************************
>
>
From wong_anurak at yahoo.com Sat Apr 19 04:24:19 2008
From: wong_anurak at yahoo.com (ter xx)
Date: Sat, 19 Apr 2008 01:24:19 -0700 (PDT)
Subject: [galib] Could you help me to solver this problem
Message-ID: <346379.97745.qm@web52904.mail.re2.yahoo.com>
Dear sir.
This is my frist time for using your galib. I download the galib247 and create the library with command
nmake /f makefile.vcpp
and then i get the galib.lib with some warning as below
[Warning....]
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
cd ga
nmake /nologo /f makefile.vcpp
lib.exe /nologo /out:ga.lib garandom.o gaerror.o GAParameter.o GAStatist
ics.o GABaseGA.o GASStateGA.o GASimpleGA.o GAIncGA.o GADemeGA.o GADCrowdingGA.o
GASelector.o GAScaling.o GAPopulation.o GAGenome.o GABinStr.o gabincvt.o GAAllel
e.o GA1DBinStrGenome.o GA2DBinStrGenome.o GA3DBinStrGenome.o GABin2DecGenome.o G
A1DArrayGenome.o GA2DArrayGenome.o GA3DArrayGenome.o GATreeBASE.o GATree.o GATre
eGenome.o GAListBASE.o GAList.o GAListGenome.o
GAList.o : warning LNK4221: no public symbols found; archive member will be inac
cessible
GATreeGenome.o : warning LNK4221: no public symbols found; archive member will b
e inaccessible
GATree.o : warning LNK4221: no public symbols found; archive member will be inac
cessible
GA3DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GA2DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GA1DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GAAllele.o : warning LNK4221: no public symbols found; archive member will be in
accessible
ga is now up-to-date
cd ..
cd examples
nmake /nologo /f makefile.vcpp
cd ..
[End Warning]
and after i use the galib.lib in my program. I develop my program with vc++.net base on window vista businees version and visual studio 2008. this is my some code :
[code]
#include
#include
//#include "ga/GASStateGA.h"
#pragma once
float Objective(GAGenome &);
ref class IntegerSolver
{
public:
IntegerSolver(void);
float Objective(GAGenome & g)
{
//GA1DArrayGenome &genome = (GA1DArrayGenome &)g;
float score=0.0;
int count=0;
// for(int i=0; i genome(width, ::Objective );
}
};
[/code]
I set the project option > c\c++ >advanced > complie as > "Complie as C++ code (/TP)" and I get the error as below after i complie.
[error]
1>------ Build started: Project: DSS, Configuration: Debug Win32 ------
1>Compiling...
1>IntegerSolver.cpp
1>DSS.cpp
1>Generating Code...
1>Linking...
1>IntegerSolver.obj : error LNK2028: unresolved token (0A00000E) "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
1>DSS.obj : error LNK2028: unresolved token (0A00000F) "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
1>IntegerSolver.obj : error LNK2020: unresolved token (0A00001A) "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ)
1>DSS.obj : error LNK2028: unresolved token (0A00001A) "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ) referenced in function "public: virtual __clrcall GA1DArrayGenome::~GA1DArrayGenome(void)" (??1?$GA1DArrayGenome at H@@$$FUAM at XZ)
1>IntegerSolver.obj : error LNK2028: unresolved token (0A00001B) "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: static void __clrcall std::_String_base::_Xlen(void)" (?_Xlen at _String_base@std@@$$FSMXXZ)
1>DSS.obj : error LNK2028: unresolved token (0A00001B) "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: __clrcall GA1DArrayGenome::GA1DArrayGenome(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
1>IntegerSolver.obj : error LNK2028: unresolved token (0A00001C) "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome::GA1DArrayGenome(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
1>DSS.obj : error LNK2028: unresolved token (0A00001C) "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome::GA1DArrayGenome(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
1>IntegerSolver.obj : error LNK2028: unresolved token (0A000021) "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
1>DSS.obj : error LNK2028: unresolved token (0A0000D6) "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
1>IntegerSolver.obj : error LNK2028: unresolved token (0A000024) "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
1>DSS.obj : error LNK2028: unresolved token (0A0000D9) "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
1>IntegerSolver.obj : error LNK2028: unresolved token (0A000027) "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome::read(class std::basic_istream > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
1>DSS.obj : error LNK2028: unresolved token (0A0000DC) "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome::read(class std::basic_istream > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
1>IntegerSolver.obj : error LNK2020: unresolved token (0A000028) "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z)
1>DSS.obj : error LNK2028: unresolved token (0A0000DD) "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z) referenced in function "public: virtual void __clrcall GA1DArrayGenome::copy(class GAGenome const &)" (?copy@?$GA1DArrayGenome at H@@$$FUAMXABVGAGenome@@@Z)
1>DSS.obj : error LNK2019: unresolved external symbol "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ)
1>DSS.obj : error LNK2019: unresolved external symbol "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ) referenced in function "public: virtual __clrcall GA1DArrayGenome::~GA1DArrayGenome(void)" (??1?$GA1DArrayGenome at H@@$$FUAM at XZ)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ)
1>DSS.obj : error LNK2019: unresolved external symbol "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome::read(class std::basic_istream > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z)
1>DSS.obj : error LNK2019: unresolved external symbol "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z) referenced in function "public: virtual void __clrcall GA1DArrayGenome::copy(class GAGenome const &)" (?copy@?$GA1DArrayGenome at H@@$$FUAMXABVGAGenome@@@Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z)
1>DSS.obj : error LNK2019: unresolved external symbol "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ)
1>DSS.obj : error LNK2019: unresolved external symbol "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome::GA1DArrayGenome(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z)
1>DSS.obj : error LNK2019: unresolved external symbol "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: __clrcall GA1DArrayGenome::GA1DArrayGenome(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z)
1>DSS.obj : error LNK2019: unresolved external symbol "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
1>IntegerSolver.obj : error LNK2001: unresolved external symbol "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z)
1>D:\proc\DSS\Debug\DSS.exe : fatal error LNK1120: 24 unresolved externals
1>Build log was saved at "file://d:\proc\DSS\DSS\Debug\BuildLog.htm"
1>DSS - 33 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/error]
thank you for your help.
Anurak Wongwaichaicharoen
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20080419/bb37d65e/attachment.htm
From bagaini.fr at wanadoo.fr Mon Apr 21 11:35:26 2008
From: bagaini.fr at wanadoo.fr (bagaini.fr)
Date: Mon, 21 Apr 2008 17:35:26 +0200
Subject: [galib] Galib fails to solve a problem using GA1DArrayAlleleGenome
Message-ID: <000801c8a3c5$52cab400$bdeefea9@francois>
Hi,
I'm a beginner with Galib and i try to solve a simple problem before using Galib for more complex problems.
I have a genome which each gene takes different values (ArrayAlleleGenome) and I want Galib give one of the solutions that verify :
Sum(gene(i))=31 and product(gene(i))=26460.
When I launch this small program Galib give me 1 3 2 19 1 1 (with NoInitializer) or 1 1 1 1 1 1 (with UniformInitializer)!
What's wrong?
Thanks for your help. Best regards
Francois
float objective(GAGenome &);
int main(int argc, char *argv[])
{
int i;
GAAlleleSetArray allelesp;
allelesp.add(1,10,1);
allelesp.add(1,7,1);
allelesp.add(1,5,1);
allelesp.add(1,20,1);
allelesp.add(1,3,1);
allelesp.add(1,3,1);
GA1DArrayAlleleGenome genomep(allelesp,objective);
int param[6]={1,3,2,19,1,1}; //initialziation of genome with determined values
for(i=0;i::UniformInitializer
genomep.mutator(GA1DArrayAlleleGenome::FlipMutator);
genomep.crossover(GA1DArrayGenome::OnePointCrossover);
GASteadyStateGA ga(genomep);
GASigmaTruncationScaling trunc;
ga.scaling(trunc);
ga.set(gaNpopulationSize, 40);
ga.set(gaNpCrossover, 0.6);
ga.set(gaNpMutation, 0.8);
ga.set(gaNnGenerations, 10000);
ga.set(gaNpReplacement, 0.25);
ga.evolve(1);
genomep=ga.statistics().bestIndividual(); //Print result
for(i=0; i & genome = (GA1DArrayAlleleGenome &)c;
float value=0.0,prof;
int sum=0,prod=1,g;
for(int i=0;i1)
prof=1/prof;
value=1/fabs(sum-31)+prof; //value range from 0 to 2
return(value);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20080421/8e8e1ea4/attachment.htm
From fr.teodoro at gmail.com Wed Apr 30 17:56:07 2008
From: fr.teodoro at gmail.com (=?ISO-8859-1?Q?F=E1bio_Roberto_Teodoro?=)
Date: Wed, 30 Apr 2008 18:56:07 -0300
Subject: [galib] Patch to remove the warnings with g++
Message-ID: <4818EAF7.1030108@gmail.com>
I've made a patch to remove the warnings when compiling my programs with g++.
It should work with other pedantic compilers too, but I've only tested with g++
(g++ (GCC) 4.1.2).
To aply the patch download the attached file and do:
cd to rootdir of galib247:
$ cd galib247
Aply the patch (correct the path of the patchfile as needed):
$ patch -p1 < galib247-remove_warnings-g++-4.1.2.patch
Now you could compile and install the galib normaly, but without the warnings 8oP
Any sugestions are welcome.
And sorry for the bad english.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: galib247-remove_warnings-g++-4.1.2.patch
Type: text/x-patch
Size: 5625 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/galib/attachments/20080430/52011f75/galib247-remove_warnings-g-4.1.2.bin