Using DEAP with C++

30 views
Skip to first unread message

Pietro Fusco

unread,
Nov 13, 2024, 12:00:38 PM11/13/24
to deap-users
Hi everyone,

I was wondering if it is possible to use DEAP with C++.

Thanks.

François-Michel De Rainville

unread,
Nov 13, 2024, 12:03:34 PM11/13/24
to deap-...@googlegroups.com

You'll find an example of including c++ code in deap in the tools/_hypervolume directory. However, this is a more general question about Python and C++ integration.


--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/deap-users/75ff533b-479e-40a8-8813-692ae81ed46bn%40googlegroups.com.

Pietro Fusco

unread,
Nov 13, 2024, 12:06:30 PM11/13/24
to deap-users
Dear François-Michel De Rainville,

many thanks for your feedback.

Perhaps, I would like to underline that I would like to know if it is possible to use DAAP into a C++ program and not vice-versa.


Best regards,

François-Michel De Rainville

unread,
Nov 13, 2024, 12:46:23 PM11/13/24
to deap-users

Pietro Fusco

unread,
Nov 13, 2024, 12:55:35 PM11/13/24
to deap-...@googlegroups.com
Yes, you are right. 

One step ahead is about using DEAP in a C++.

Is it possible?

Regards 

EBo

unread,
Nov 13, 2024, 7:30:23 PM11/13/24
to deap-...@googlegroups.com, Pietro Fusco
I have no projects I need to use DEAP at the moment, BUT...

Several years ago, I taught a section of NASA Goddard's Python Bootcamp
on interlanguage communication - with examples communicating between
python, Fortran, and C (I do not remember if I included C++ as well, but
I do know I had demo code for Python=>C and C=>python). So, it should
be possible. In fact, one of the big projects I did nearly a decade
ago, the evaluation function was in Fortran (and could take several
hours per run). In that hack, I set up the standard output to be
something similar to YAML or maybe it was Key/Data pairs. Anyway, I
grabbed that output from via Popen, and then fed it into my statistics.
So, there are ways to do it directly, and indirectly.

Anyway, it is not clear from your earlier email what you are trying to
accomplish. DEAP does not have a lot of overhead as things go, so there
is little advantage to make it run inside of C++. On the other hand,
there are cases where the evaluation function can take hours for each
individual, and you can have huge savings by exporting that to
C/C++/Fortran, etc. So, give us some more information, and I/we will
see if we can be of more assistance.

EBo --
>>>>> <https://groups.google.com/d/msgid/deap-users/75ff533b-479e-40a8-8813-692ae81ed46bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "deap-users" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an
>>> email to deap-users+...@googlegroups.com.
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/deap-users/334739df-5e7c-4bb5-88b9-72cdc7d624cdn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/deap-users/334739df-5e7c-4bb5-88b9-72cdc7d624cdn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "deap-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to deap-users+...@googlegroups.com.
>> To view this discussion visit
>> https://groups.google.com/d/msgid/deap-users/CAJjWHnZVspgsBz4fvfFjgDnUoq94M4eo4B07mJx9tfyXgymChA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/deap-users/CAJjWHnZVspgsBz4fvfFjgDnUoq94M4eo4B07mJx9tfyXgymChA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
Reply all
Reply to author
Forward
0 new messages