WRITE OPTIMIZATION LOG IN PYGMO FORMAT
2023/01/25 | W. MARTENS | NEW
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(optgra), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | Objval |
OBJECTIVE VALUE |
||
| integer(kind=ip), | intent(in) | :: | Numvio |
NUMBER OF VIOLATED CONSTRAINTS |
||
| real(kind=wp), | intent(in) | :: | Convio |
TOTAL CONSTRAINT VIOLATION |
subroutine ogpwri(me,Objval,Numvio,Convio) !! WRITE OPTIMIZATION LOG IN PYGMO FORMAT !! !! 2023/01/25 | W. MARTENS | NEW class(optgra),intent(inout) :: me real(wp),intent(in) :: Objval !! OBJECTIVE VALUE integer(ip),intent(in) :: Numvio !! NUMBER OF VIOLATED CONSTRAINTS real(wp),intent(in) :: Convio !! TOTAL CONSTRAINT VIOLATION character(len=2) :: feas if ( me%Verbos==0 ) return ! Print header if ( me%Fevals==0 ) call me%ogpwri_start() ! Increase counter for cost function evaluations me%Fevals = me%Fevals + 1 ! Every 50 lines print the column names. if ( mod(real(me%Fevals-1.0_wp)/real(me%Verbos),50.0_wp)==0.0_wp ) & write (me%Loglup,'(A10,A15,A15,A15,A2)') "objevals:" , "objval:" , "violated:" , "viol. norm:" if ( me%Verbos/=0 .and. mod(me%Fevals,me%Verbos)==0.0_wp ) then if ( Convio>0.0_wp ) then feas = " i" else feas = " " end if ! Write the log line (different format depending on violation size) if ( Convio==0.0_wp ) then write (me%Loglup,'(I10,F15.4,I15,I15,A2)') me%Fevals , Objval , Numvio , int(Convio) , feas elseif ( Convio>1.0e-3_wp ) then write (me%Loglup,'(I10,F15.4,I15,F15.6,A2)') me%Fevals , Objval , Numvio , Convio , feas else write (me%Loglup,'(I10,F15.4,I15,E15.6,A2)') me%Fevals , Objval , Numvio , Convio , feas end if end if ! Write final summary if ( me%Pygfla/=0 ) call me%ogpwri_end(Objval,Numvio,Convio) end subroutine ogpwri