This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:7.2-fpm | |
| COPY app /var/www/ | |
| EXPOSE 9000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import random | |
| # function to optimize: takes in a list of decision variables, returns an objective value | |
| # this is the Rosenbrock function: http://en.wikipedia.org/wiki/Rosenbrock_function | |
| # the global minimum is located at x = (1,1) where f(x) = 0 | |
| def my_function(x): | |
| return (1-x[0])**2 + 100*(x[1] - x[0]**2)**2 | |
| # function to perform (a very crude, stupid) optimization | |
| # bounds = lower and upper bounds for each decision variable (2D list) |