jacobwilliams / pikaia

Modern Fortran Edition of the Pikaia Genetic Algorithm
Other
35 stars 13 forks source link

use the Binary/Gray encoding methods replace Decimal #3

Open weixing1531 opened 5 years ago

weixing1531 commented 5 years ago

https://github.com/weixing1531/pikaia/tree/Binary I wrote a subclass named pikaia_binary_class. In the class, I change the definition of array gn. integer(IB),dimension(me%n),intent(out) :: gn operate the array gn in subroutine cross,mutate,encode,decode with using fortran's BIT INTRINSIC PROCEDURES ,then save memory and increase speed.

ivan-pi commented 3 years ago

Do you have some measurements how much improvement it is?

My (limited) understanding is that for most problems the time is dominated by the function evaluations and not really the genetic algorithm part.

Maybe a proper bitset class could simplify the encode/decode steps.

weixing1531 commented 3 years ago

Four times faster!------------------ 原始邮件 ------------------ 发件人: "Ivan"<notifications@github.com> 发送时间: 2020年9月26日(星期六) 凌晨3:13 收件人: "jacobwilliams/pikaia"<pikaia@noreply.github.com>; 抄送: "weixing1531"<282844965@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [jacobwilliams/pikaia] use the Binary/Gray encoding methods replace Decimal (#3)