[galib] Saving results in a txt file and linking two C++ program together
Mehdi Asghari
mehdiasgh at gmail.com
Mon Aug 17 00:38:54 EDT 2015
Dear *Flávio*
Actually, I’m going to learn saving results in a data file as well as
linking C++ libs & programs and GAlib.
Assume, I’d like to obtain minimum of a two-variable function by GA. The
expression for this function is f(x,y)=x sin (4x) +1.1 y sin (2y); that
0≤x≤10 and 0≤y≤10. My program is consisted of two parts as follows:
1.
A GAlib core program.
2.
An executable C++-source code called calculation.c calculating f(x,y)
for different x,y values.
I present my questions as follows:
1-I want to obtain x,y value in which f(x,y) is minimized by GA and then
saving (x,y) into a txt file as output result.
2-How can I link two C++ program (GAlib and calculation.c) code together by
bash scripting in Ubuntu?
My first question is same in my previous thread.
Thanks again for any help & consideration.
On Sun, Aug 16, 2015 at 6:20 PM, Flávio Grassi <flaviograssi.fg at gmail.com>
wrote:
> Hello Mehdi.
>
> I'm a novice in GAlib too but, as far as I know, you just need to insert
> an "getchar();" instruction into the "main" function, at the very bottom of
> it:
>
> *int
> main(int argc, char **argv)
> {*
>
> *...*
>
> *...*
>
> *...*
>
>
> *getchar();*
>
> *}*
>
>
> *Regards.*
>
>
> 2015-08-16 2:49 GMT-03:00 Mehdi Asghari <mehdiasgh at gmail.com>:
>
>> Hi .
>> I'm new in GAlib. Excuse me in advance if my first question is simple.
>> How Can I observe output of an example after compiling it.
>> Thanks for any help.
>>
>> _______________________________________________
>> galib mailing list
>> galib at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/galib
>>
>>
>
>
> --
> *Flávio Grassi*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20150817/aae82808/attachment.html
More information about the galib
mailing list