######################################################################## # using Distributed # for @everywhere (option["paradigm"] = 1) only ######################################################################## ###################### OPTIMIZATION PROBLEM ######################## ######################################################################## @everywhere function problem_function(x) f=Array{Float64,1}(undef, 2) # Initialize array for objectives F(X) g=Array{Float64,1}(undef, 0) # Initialize array for constraints G(X) # Auxiliary values a1 = 0.5*sin(1.0) - 2.0*cos(1.0) + sin(2.0) - 1.5*cos(2.0) a2 = 1.5*sin(1.0) - cos(1.0) + 2.0*sin(2.0) - 0.5*cos(2.0) b1 = 0.5*sin(x[1]) - 2.0*cos(x[1]) + sin(x[2]) - 1.5*cos(x[2]) b2 = 1.5*sin(x[1]) - cos(x[1]) + 2.0*sin(x[2]) - 0.5*cos(x[2]) # Objective functions F(X) f[1] = 1.0 + (a1-b1)^2 + (a2-b2)^2 f[2] = (x[1]+3.0)^2 + (x[2]+1.0)^2 return f,g end ######################################################################## ######################### MAIN PROGRAM ############################# ######################################################################## key="MIDACO_LIMITED_VERSION___________________ALL_RIGHTS_RESERVED" problem = Dict() option = Dict() ######################################################################## ### Step 1: Problem definition ##################################### ######################################################################## # STEP 1.A: Problem dimensions ############################## problem["o"] = 2 # Number of objectives problem["n"] = 2 # Number of variables (in total) problem["ni"] = 0 # Number of integer variables (0 <= ni <= n) problem["m"] = 0 # Number of constraints (in total) problem["me"] = 0 # Number of equality constraints (0 <= me <= m) # STEP 1.B: Lower and upper bounds "xl" & "xu" ############################################## problem["xl"] = [ -3.141592653589793, -3.141592653589793 ] problem["xu"] = [ 3.141592653589793, 3.141592653589793 ] # STEP 1.C: Starting point "x" ############################## problem["x"] = problem["xl"] ######################################################################## ### Step 2: Choose stopping criteria and printing options ########### ######################################################################## # STEP 2.A: Stopping criteria ############################# option["maxeval"] = 1000000 # Maximum evaluation budget (e.g. 1000000) option["maxtime"] = 60*60*24 # Maximum time limit (e.g. 60*60*24 = 1 Day) # STEP 2.B: Printing options ############################ option["printeval"] = 100000 # Print-Frequency for current best solution (e.g. 1000) option["save2file"] = 100000 # Save TXT-files, history of up to 100000 points option["resumable"] = 0 # Resumable mode [0=NO/1=YES] ######################################################################## ### Step 3: Choose MIDACO parameters (FOR ADVANCED USERS) ########### ######################################################################## option["param1"] = 0.0 # ACCURACY option["param2"] = 0.0 # SEED option["param3"] = 0.0 # FSTOP option["param4"] = 0.0 # ALGOSTOP option["param5"] = 0.0 # EVALSTOP option["param6"] = 0.0 # FOCUS option["param7"] = 0.0 # ANTS option["param8"] = 0.0 # KERNEL option["param9"] = 0.0 # ORACLE option["param10"] = 0.0 # PARETOMAX option["param11"] = 0.0 # EPSILON option["param12"] = 0.0 # BALANCE option["param13"] = 0.0 # CHARACTER option["param14"] = 0.0 # SURROGATE option["param15"] = 0.0 # PMISQP ######################################################################## ### Step 4: Parallelization Factor ################################### ######################################################################## option["parallel"] = 0 # Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8... option["paradigm"] = 0 # Parallel mode: 0 = multithreading (julia -t 8 example_MINLPc.jl) # 1 = multiprocessing (julia -p 8 example_MINLPc.jl) # 2 = MPI (mpiexec -n 8 julia example_MINLPc.jl) ######################################################################## ############################ Run MIDACO ################################ ######################################################################## include("midaco.jl") solution = midaco(problem,option,key) # println(solution["f"][1]) # println(solution["g"][1]) # println(solution["x"][1])