Exemple #1
0
        elif selector2 == '4':
            """
            Harmonic Search Algorithm tentative ver Oct15
            """
            print('-' * 100)
            print('Global Optimization by ALHSO')
            alpso_ret_list = []
            alhso = ALHSO()
            alhso.setOption('hms', 30)
            stime = time.time()
            for i in range(alhso_n):
                temp = alhso(opt_prob)
                alpso_ret_list.append(temp[0])
                print opt_prob.solution(0)
                opt_prob.delSol(0)
                print('%d th iteration' % i)
            etime = time.time()
            print ('elapsed time : %f' % (etime - stime))
            fig, ax = plt.subplots(1, 1)
            ax.hist(alpso_ret_list, alhso_n, color='azure')
            ax.set_xlabel('function value')
            plt.tight_layout()


        else:
            pass

        print('Global Optimization has finised. \n')
    elif selector1 == '2':