decode Subroutine

private subroutine decode(me, gn, ph)

decode genotype into phenotype parameters ph(k) are x,y coordinates [ 0 < x,y < 1 ]

Type Bound

pikaia_class

Arguments

Type IntentOptional Attributes Name
class(pikaia_class), intent(in) :: me
integer, intent(in), dimension(me%n*me%nd) :: gn
real(kind=wp), intent(out), dimension(me%n) :: ph

Called by

proc~~decode~~CalledByGraph proc~decode pikaia_module::pikaia_class%decode proc~pikaia pikaia_module::pikaia_class%pikaia proc~pikaia->proc~decode proc~solve_with_pikaia pikaia_module::pikaia_class%solve_with_pikaia proc~solve_with_pikaia->proc~pikaia

Source Code

    subroutine decode(me,gn,ph)

    implicit none

    class(pikaia_class),intent(in)           :: me
    integer,dimension(me%n*me%nd),intent(in) :: gn
    real(wp),dimension(me%n),intent(out)     :: ph

    integer  :: ip,i,j,ii
    real(wp) :: z

    z=10.0_wp**(-me%nd)
    ii=0
    do i=1,me%n
        ip=0
        do j=1,me%nd
            ip=10*ip+gn(ii+j)
        end do
        ph(i)=ip*z
        ii=ii+me%nd
    end do

    end subroutine decode