# input file for the numerical example presented in # # Tapio Westerlund & Joakim Westerlund # GGPECP -- An algorithm for solving non-convex MINLP problems by # cutting plane and transformation techniques # Proceedings of ICHEAP-6, Pisa, June 2003. # use jacaranda.util.opt MINLP model # define the objective function based on continuous variable x # and discrete (integer) variable y. f "3*y-5*x" # define the inequality contraints. this is a set of equations # where the last expression should evaluate to a vector of # values. A feasible point is one for which all the values in this # vector are non-positive. g c1 = 2*y + 3*x - 24 c2 = 3*x - 2*y - 8 c3 = 2*y^2 - 2*sqrt(y) + 11*y + 8*x - 39 - 2*sqrt(x)*y^2 {c1, c2, c3} end # specify the lower bounds on both the continuous and integer # optimization variables. Two vectors are expected, the first for # the continuous (real) variables and the second for the integer # variables. a 1 1 # and also specify the upper bounds on these variables b 6 6 # you can evaluate a specific point by giving a vector of n # values. If you wish to do so, uncomment the next line: # evaluate "{1, 1.1}" print end # define an optimizer to see if we can find the solution of the NLP # defined above # # We could use a genetic algorithm. For this case, we define a # specific population object based on a particular chromosome # implementation. The chromosome implementation we use is one which # maps continuous and integer variables directly. A GA instance which # uses this population object is then instantiated. VariableEncodedChromosome var function model end RouletteSelection roulette end Population pop chromosome var # variable encoded chromosome crossover 0.7 # crossover rate (70%) elite 1 # elite set mutation 0.1 # mutation rate (10% -- quite high) n 20 # population size selection roulette # use Roulette wheel fitness based selection end GA ga outputlevel 3 # generate a lot of output ngen 50 # evolve over 50 generations printfrequency 5 # print every 5 population pop # the population object evolve # solve the problem by evolution print # and generate some output end