MitchellHansen 8 years ago
commit 001a46260a

@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.6)
project(Lab1)
set(SFML_COMPONENTS graphics window system network audio)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(SFML 2.1 COMPONENTS ${SFML_COMPONENTS} REQUIRED)
message(STATUS "SFML found: ${SFML_FOUND}")
include_directories(${SFML_INCLUDE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp mtrand.cpp mtrand.h)
add_executable(Lab1 ${SOURCE_FILES})
target_link_libraries (Lab1 ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})

Binary file not shown.

@ -0,0 +1,369 @@
# This script locates the SFML library
# ------------------------------------
#
# Usage
# -----
#
# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
# example:
# find_package(SFML COMPONENTS graphics window system) # find the graphics, window and system modules
#
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
# If nothing is specified, the version won't be checked (i.e. any version will be accepted).
# example:
# find_package(SFML COMPONENTS ...) # no specific version required
# find_package(SFML 2 COMPONENTS ...) # any 2.x version
# find_package(SFML 2.4 COMPONENTS ...) # version 2.4 or greater
#
# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
# Since you have to link yourself all the SFML dependencies when you link it statically, the following
# additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed
# description below).
# In case of static linking, the SFML_STATIC macro will also be defined by this script.
# example:
# set(SFML_STATIC_LIBRARIES TRUE)
# find_package(SFML 2 COMPONENTS network system)
#
# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
# are available for both release and debug modes.
#
# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
# to tell CMake where SFML is.
#
# Output
# ------
#
# This script defines the following variables:
# - For each specified module XXX (system, window, graphics, network, audio, main):
# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found
# - SFML_XXX_DEPENDENCIES: the list of libraries the module depends on, in case of static linking
# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules
# - SFML_FOUND: true if all the required modules are found
# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
# - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking
#
# example:
# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
# include_directories(${SFML_INCLUDE_DIR})
# add_executable(myapp ...)
# target_link_libraries(myapp ${SFML_LIBRARIES})
# define the SFML_STATIC macro if static build was chosen
if(SFML_STATIC_LIBRARIES)
add_definitions(-DSFML_STATIC)
endif()
# define the list of search paths for headers and libraries
set(FIND_SFML_PATHS
${SFML_ROOT}
$ENV{SFML_ROOT}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt)
# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS ${FIND_SFML_PATHS})
# check the version number
set(SFML_VERSION_OK TRUE)
if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
# extract the major and minor version numbers from SFML/Config.hpp
# we have to handle framework a little bit differently:
if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
else()
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
endif()
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
set(SFML_VERSION_PATCH 0)
endif()
math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")
# if we could extract them, compare with the requested version number
if (SFML_VERSION_MAJOR)
# transform version numbers to an integer
math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")
# compare them
if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
set(SFML_VERSION_OK FALSE)
endif()
else()
# SFML version is < 2.0
if (SFML_REQUESTED_VERSION GREATER 10900)
set(SFML_VERSION_OK FALSE)
set(SFML_VERSION_MAJOR 1)
set(SFML_VERSION_MINOR x)
set(SFML_VERSION_PATCH x)
endif()
endif()
endif()
# find the requested modules
set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
# no suffix for sfml-main, it is always a static library
if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
# release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
else()
# static release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}-s
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# static debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-s-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# choose the entries that fit the requested link type
if(SFML_STATIC_LIBRARIES)
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG})
endif()
else()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG})
endif()
endif()
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# library found
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
# if both are found, set SFML_XXX_LIBRARY to contain both
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
# if only one debug/release variant is found, set the other to be equal to the found one
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# debug and not release
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
# release and not debug
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
else()
# library not found
set(SFML_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
endif()
# mark as advanced
MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
# add to the global list of libraries
set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
endforeach()
# in case of static linking, we must also define the list of all the dependencies of SFML libraries
if(SFML_STATIC_LIBRARIES)
# detect the OS
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(FIND_SFML_OS_WINDOWS 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_SFML_OS_LINUX 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FIND_SFML_OS_FREEBSD 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(FIND_SFML_OS_MACOSX 1)
endif()
# start with an empty list
set(SFML_DEPENDENCIES)
set(FIND_SFML_DEPENDENCIES_NOTFOUND)
# macro that searches for a 3rd-party library
macro(find_sfml_dependency output friendlyname)
# No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
if(${${output}} STREQUAL "${output}-NOTFOUND")
unset(output)
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
endif()
endmacro()
# sfml-system
list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT)
if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX)
set(SFML_SYSTEM_DEPENDENCIES "pthread")
endif()
if(FIND_SFML_OS_LINUX)
set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt")
endif()
if(FIND_SFML_OS_WINDOWS)
set(SFML_SYSTEM_DEPENDENCIES "winmm")
endif()
set(SFML_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-network
list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT)
if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_WINDOWS)
set(SFML_NETWORK_DEPENDENCIES "ws2_32")
endif()
set(SFML_DEPENDENCIES ${SFML_NETWORK_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-window
list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT)
if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
# find libraries
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
find_sfml_dependency(X11_LIBRARY "X11" X11)
find_sfml_dependency(LIBXCB_LIBRARIES "XCB" xcb libxcb)
find_sfml_dependency(X11_XCB_LIBRARY "X11-xcb" X11-xcb libX11-xcb)
find_sfml_dependency(XCB_RANDR_LIBRARY "xcb-randr" xcb-randr libxcb-randr)
find_sfml_dependency(XCB_IMAGE_LIBRARY "xcb-image" xcb-image libxcb-image)
endif()
if(FIND_SFML_OS_LINUX)
find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev)
endif()
# update the list
if(FIND_SFML_OS_WINDOWS)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
elseif(FIND_SFML_OS_LINUX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} ${UDEV_LIBRARIES})
elseif(FIND_SFML_OS_FREEBSD)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} "usbhid")
elseif(FIND_SFML_OS_MACOSX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
endif()
set(SFML_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-graphics
list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
# update the list
set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-audio
list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT)
if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
find_sfml_dependency(OGG_LIBRARY "Ogg" ogg)
find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis)
find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile)
find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc)
find_sfml_dependency(FLAC_LIBRARY "FLAC" FLAC)
# update the list
set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
endif()
endif()
# handle errors
if(NOT SFML_VERSION_OK)
# SFML version not ok
set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH})")
set(SFML_FOUND FALSE)
elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND)
set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})")
set(SFML_FOUND FALSE)
elseif(NOT SFML_FOUND)
# include directory or library not found
set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
endif()
if (NOT SFML_FOUND)
if(SFML_FIND_REQUIRED)
# fatal error
message(FATAL_ERROR ${FIND_SFML_ERROR})
elseif(NOT SFML_FIND_QUIETLY)
# error but continue
message("${FIND_SFML_ERROR}")
endif()
endif()
# handle success
if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
endif()

@ -0,0 +1,34 @@
C={0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462,
0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369,
0.992,0.332,0.817,0.632,0.883,0.608,0.326};
Ai,j={{9.681,0.667,4.783,9.095,3.517,9.325,6.544,0.211,5.122,2.02},
       {9.4,2.041,3.788,7.931,2.882,2.672,3.568,1.284,7.033,7.374},
       {8.025,9.152,5.114,7.621,4.564,4.711,2.996,6.126,0.734,4.982},
       {2.196,0.415,5.649,6.979,9.510,9.166,6.304,6.054,9.377,1.426},
       {8.074,8.777,3.467,1.863,6.708,6.349,4.534,0.276,7.633,1.567},
       {7.650,5.658,0.720,2.764,3.278,5.283,7.474,6.274,1.409,8.208},
       {1.256,3.605,8.623,6.905,4.584,8.133,6.071,6.888,4.187,5.448},
       {8.314,2.261,4.24,1.781,4.124,0.932,8.129,8.658,1.208,5.762},
       {0.226,8.858,1.42,0.954,1.622,4.698,6.228,9.096,0.972,7.637},
       {7.305,2.228,1.242,5.928,9.133,1.826,4.06,5.204,8.713,8.247},
       {0.652,7.027,0.508,4.876,8.807,4.632,5.808,6.937,3.291,7.016},
       {2.699,3.516,5.847,4.119,4.461,7.496,8.817,0.69,6.593,9.789},
       {8.327,3.897,2.017,9.57,9.825,1.15,1.395,3.885,6.354,0.109},
       {2.132,7.006,7.136,2.641,1.882,5.943,7.273,7.691,2.88,0.564},
       {4.707,5.579,4.08,0.581,9.698,8.542,8.077,8.515,9.231,4.67},
       {8.304,7.559,8.567,0.322,7.128,8.392,1.472,8.524,2.277,7.826},
       {8.632,4.409,4.832,5.768,7.05,6.715,1.711,4.323,4.405,4.591},
       {4.887,9.112,0.17,8.967,9.693,9.867,7.508,7.77,8.382,6.74},
      {2.44,6.686,4.299,1.007,7.008,1.427,9.398,8.48,9.95,1.675},
       {6.306,8.583,6.084,1.138,4.350,3.134,7.853,6.061,7.457,2.258},
       {0.652,2.343,1.37,0.821,1.31,1.063,0.689,8.819,8.833,9.07},
       {5.558,1.272,5.756,9.857,2.279,2.764,1.284,1.677,1.244,1.234},
       {3.352,7.549,9.817,9.437,8.687,4.167,2.57,6.54,0.228,0.027},
       {8.798,0.88,2.37,0.168,1.701,3.68,1.231,2.39,2.499,0.064},
       {1.46,8.057,1.337,7.217,7.914,3.615,9.981,9.198,5.292,1.224},
       {0.432,8.645,8.774,0.249,8.081,7.461,4.416,0.652,4.002,4.644},
       {0.679,2.8,5.523,3.049,2.968,7.225,6.73,4.199,9.614,9.229},
       {4.263,1.074,7.286,5.599,8.291,5.2,9.214,8.272,4.398,4.506},
       {9.496,4.83,3.15,8.27,5.079,1.231,5.731,9.494,1.883,9.732},
       {4.138,2.562,2.532,9.661,5.611,5.5,6.886,2.341,9.699,6.5}};

@ -0,0 +1,133 @@
%%% Preamble
\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel} % English language/hyphenation
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[pdftex]{graphicx}
\usepackage{url}
%%% Custom sectioning
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
%%% Custom headers/footers (fancyhdr package)
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{} % No page header
\fancyfoot[L]{} % Empty
\fancyfoot[C]{} % Empty
\fancyfoot[R]{\thepage} % Pagenumbering
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt}
%%% Equation and float numbering
\numberwithin{equation}{section} % Equationnumbering: section.eq#
\numberwithin{figure}{section} % Figurenumbering: section.fig#
\numberwithin{table}{section} % Tablenumbering: section.tab#
%%% Maketitle metadata
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Horizontal rule
\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{Central Washington University} \\ [1pt]
\normalfont \normalsize \textsc{CS 427} \\ [15pt]
\horrule{0.5pt} \\[0.4cm]
\huge Lab 1 \\
\horrule{2pt} \\[0.5cm]
}
\author{
\normalfont \normalsize
Mitchell Hansen\\[-3pt] \normalsize
\today
}
\date{}
%%% Begin document
\begin{document}
\maketitle
\section{Introduction}
For our first lab, we took 15 functions from various optimization test suites and ran them for varying dimensionality and input. The goal being to determine the range of the functions output, it's standard deviation from input to input, average time to run the function, and other such tests.
\section {Methods}
For each test, I generated an array of random integers using the C rand() function, seeded at the begginning of the application with srand() and the time. In future tests I will be utilizing the Mersenne Twister method of generating random numbers, which is far more random. After generating the random numbers, I passed each set into the functions at 10, 20, and 30 dimensionality intervals, logging what they return.
\section{Experimentation Results}
\begin{center}
\begin{tabular}{ | l | l | l | l | l | l |}
\hline
Function & Dimensionality & Mean & Median & Deviation & Avg. Time \\ \hline
schwefel & 10 & -1.36058 & -103.102 & 618.227 & 1.7575 \\ \hline
& 20 & -5.22963 & 1366.82 & 863.447 & 2.7682 \\ \hline
& 30 & -3.35496 & 441.352 & 1071.53 & 3.8081 \\ \hline
de jong & 10 & 33264 & 40362 & 9402.19 & 0.7467 \\ \hline
& 20 & 66737.3 & 51890 & 13442.9 & 0.7351 \\ \hline
& 30 & 100044 & 95177 & 16432.6 & 0.3675 \\ \hline
rosenbrok & 10 & 1.79827e+10 & 1.67874e+10 & 7.98429e+09 & 0.0835 \\ \hline
& 20 & 3.78563e+10 & 2.30065e+10 & 1.16052e+10 & 1.76 \\ \hline
& 30 & 5.81661e+10 & 5.26908e+10 & 1.43576e+10 & 1.0109 \\ \hline
rastrigin & 10 & 58068.8 & 37720 & 17104 & 1.0163 \\ \hline
& 20 & 231345 & 264520 & 47672.9 & 2.5908 \\ \hline
& 30 & 521790 & 523500 & 89713.1 & 3.1789 \\ \hline
griegwangk & 10 & 208.696 & 201.88 & 58.559 & 1.0334 \\ \hline
& 20 & 417.247 & 502.07 & 82.0775 & 3.7124 \\ \hline
& 30 & 626.906 & 633.49 & 101.588 & 4.0333 \\ \hline
sine envelope sine wave & 10 & 7.484 & 8.42901 & 0.776108 & 1.3989 \\ \hline
& 20 & 15.7985 & 14.7606 & 1.13035 & 3.3113 \\ \hline
& 30 & 24.1052 & 26.4525 & 1.40737 & 5.025 \\ \hline
stretched v sine wave & 10 & 30.0648 & 37.1503 & 5.56455 & 3.8074 \\ \hline
& 20 & 63.5978 & 61.1979 & 8.1662 & 6.1452 \\ \hline
& 30 & 96.8599 & 98.3275 & 9.95237 & 8.8907 \\ \hline
ackleys one & 10 & 180.243 & 149.991 & 31.6898 & 2.0144 \\ \hline
& 20 & 380.786 & 442.58 & 45.7357 & 5.0182 \\ \hline
& 30 & 583.005 & 681.962 & 57.6042 & 7.0651 \\ \hline
ackleys two & 10 & 152.968 & 152.204 & 4.22097 & 3.3884 \\ \hline
& 20 & 322.851 & 326.451 & 6.31728 & 6.0586 \\ \hline
& 30 & 492.805 & 498.597 & 7.74626 & 8.9194 \\ \hline
egg holder & 10 & -28.1673 & -1334.07 & 872.855 & 2.2148 \\ \hline
& 20 & -46.6518 & 718.965 & 1265.43 & 5.0378 \\ \hline
& 30 & -120.776 & -2238.62 & 1563.34 & 7.0771 \\ \hline
rana & 10 & 5.96939 & 33.1935 & 602.187 & 4.1041 \\ \hline
& 20 & 17.3048 & -816.859 & 874.721 & 9.1242 \\ \hline
& 30 & 3.58453 & -1667.75 & 1077.64 & 13.6967 \\ \hline
pathological & 10 & 4.50048 & 4.50316 & 0.226241 & 2.0145 \\ \hline
& 20 & 9.50768 & 9.77562 & 0.326493 & 3.9414 \\ \hline
& 30 & 14.5061 & 14.8958 & 0.409931 & 5.4952 \\ \hline
michalewicz & 10 & -0.0472368 & 0 & 0.535466 & 1.5615 \\ \hline
& 20 & -0.0359855 & 0 & 0.773229 & 3.0854 \\ \hline
& 30 & -0.038839 & 0 & 0.969944 & 4.5795 \\ \hline
masters cosine wave & 10 & 0.0242817 & -2.82524 & 2.07645 & 2.4656 \\ \hline
& 20 & 0.000543481 & 1.27202 & 3.02895 & 3.886 \\ \hline
& 30 & -0.073613 & 2.43497 & 3.70944 & 5.1847 \\ \hline
shekels foxholes & 10 & -3.18527 & 0 & 4.95254 & 4.8601 \\ \hline
& 20 & -3.06529 & 0 & 4.60784 & 7.5344 \\ \hline
& 30 & -3.39603 & -5.22145 & 5.05984 & 11.7375 \\ \hline
\end{tabular}
\end{center}
\section{Analysis}
Viewing the results of the experiments yields expected and unexpected results. First off, and probably the most easily predicted is the steady increase in computation time required for each function as measured in microseconds. Where steady increases in dimensionality yielded steady increases in computation time. Everything further from here was unexpected for me as I had no idea what to expect from these computations.
For most of the functions, each steady increase in dimensionality was met with an equally steady increasing Mean, Median, and Standard Deviation. Notable exceptions to this are the Schwefel, Michalewicz, and Shekels Foxholes functions. Each either showed little to no change in values, or the values increased and decreased in a random manner.
I also graphed each of the 15 functions in 2D to view their behavior and found that the Michalewicz and Shekels Foxholes functions had a behavior very different than the other 13. The Michalewicz was similar to how it looks when viewing 3rd party sources, but the Shekels Foxholes function does not match 3rd party sources, which leads me to believe that the input data I had is weird, or I have the function wrong.
%%% End document
\end{document}

@ -0,0 +1,611 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <chrono>
#include "SFML/Graphics.hpp"
#include "mtrand.h"
// In order to compile and run this project you're going to either comment out the SFML
// code or install SFML which is trivial on *NIX.
// Just apt-get install libsfml-dev
// or brew install sfml
std::vector<double> c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462,
0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369,
0.992,0.332,0.817,0.632,0.883,0.608,0.326};
double a[][10] =
{
{9.681,0.667,4.783,9.095,3.517,9.325,6.544,0.211,5.122,2.02},
{9.4,2.041,3.788,7.931,2.882,2.672,3.568,1.284,7.033,7.374},
{8.025,9.152,5.114,7.621,4.564,4.711,2.996,6.126,0.734,4.982},
{2.196,0.415,5.649,6.979,9.510,9.166,6.304,6.054,9.377,1.426},
{8.074,8.777,3.467,1.863,6.708,6.349,4.534,0.276,7.633,1.567},
{7.650,5.658,0.720,2.764,3.278,5.283,7.474,6.274,1.409,8.208},
{1.256,3.605,8.623,6.905,4.584,8.133,6.071,6.888,4.187,5.448},
{8.314,2.261,4.24,1.781,4.124,0.932,8.129,8.658,1.208,5.762},
{0.226,8.858,1.42,0.954,1.622,4.698,6.228,9.096,0.972,7.637},
{7.305,2.228,1.242,5.928,9.133,1.826,4.06,5.204,8.713,8.247},
{0.652,7.027,0.508,4.876,8.807,4.632,5.808,6.937,3.291,7.016},
{2.699,3.516,5.847,4.119,4.461,7.496,8.817,0.69,6.593,9.789},
{8.327,3.897,2.017,9.57,9.825,1.15,1.395,3.885,6.354,0.109},
{2.132,7.006,7.136,2.641,1.882,5.943,7.273,7.691,2.88,0.564},
{4.707,5.579,4.08,0.581,9.698,8.542,8.077,8.515,9.231,4.67},
{8.304,7.559,8.567,0.322,7.128,8.392,1.472,8.524,2.277,7.826},
{8.632,4.409,4.832,5.768,7.05,6.715,1.711,4.323,4.405,4.591},
{4.887,9.112,0.17,8.967,9.693,9.867,7.508,7.77,8.382,6.74},
{2.44,6.686,4.299,1.007,7.008,1.427,9.398,8.48,9.95,1.675},
{6.306,8.583,6.084,1.138,4.350,3.134,7.853,6.061,7.457,2.258},
{0.652,2.343,1.37,0.821,1.31,1.063,0.689,8.819,8.833,9.07},
{5.558,1.272,5.756,9.857,2.279,2.764,1.284,1.677,1.244,1.234},
{3.352,7.549,9.817,9.437,8.687,4.167,2.57,6.54,0.228,0.027},
{8.798,0.88,2.37,0.168,1.701,3.68,1.231,2.39,2.499,0.064},
{1.46,8.057,1.337,7.217,7.914,3.615,9.981,9.198,5.292,1.224},
{0.432,8.645,8.774,0.249,8.081,7.461,4.416,0.652,4.002,4.644},
{0.679,2.8,5.523,3.049,2.968,7.225,6.73,4.199,9.614,9.229},
{4.263,1.074,7.286,5.599,8.291,5.2,9.214,8.272,4.398,4.506},
{9.496,4.83,3.15,8.27,5.079,1.231,5.731,9.494,1.883,9.732},
{4.138,2.562,2.532,9.661,5.611,5.5,6.886,2.341,9.699,6.5}
};
double schwefel(std::vector<double> input){
int upper_bound = 512;
int lower_bound = -512;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += (-input[i]) * std::sin(std::sqrt(std::abs(input[i])));
}
return sum;
}
double first_de_jong(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2);
}
return sum;
}
double rosenbrock(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 100 * std::pow((std::pow(input[i], 2) - input[i + 1]), 2) + std::pow((1 - input[i]), 2);
}
return sum;
}
double rastrigin(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) - 10 * std::cos(2 * M_PI * input[i]);
}
sum *= 2 * input.size();
return sum;
}
double griewangk(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) / 4000;
}
double product = 0;
for (int i = 0; i < input.size(); i++){
product *= std::cos(input[i] / sqrt(i + 1));
}
return 1 + sum - product;
}
double sine_envelope_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 0.5 + (std::pow(std::sin(std::pow(input[i], 2) + std::pow(input[i + 1], 2) - 0.5), 2)) /
(1 + 0.001 * (std::pow(input[i], 2) + std::pow(input[i + 1], 2)));
}
return sum;
}
double stretched_v_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 4) *
std::pow(std::sin(50 * std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 10)), 2) + 1;
}
return sum;
}
double ackleys_one(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += (1.0 / pow(M_E, 0.2)) *
std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2)) +
3 * std::cos(2 * input[i]) +
std::sin(2 * input[i + 1]);
}
return sum;
}
double ackleys_two(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 20 + M_E -
(20 / (std::pow(M_E, 0.2) * std::sqrt(((std::pow(input[i], 2) + std::pow(input[i+1], 2) + 1) / 2)))) -
std::pow(M_E, 0.5 * std::cos(2 * M_PI * input[i]) + cos(2 * M_PI * input[i + 1]));
}
return sum;
}
double egg_holder(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += -input[i] * std::sin(std::sqrt(abs(input[i] - input[i + 1] - 47))) -
(input[i + 1] + 47) * std::sin(std::sqrt(std::abs(input[i + 1] + 47 + input[i] / 2)));
}
return sum;
}
double rana(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += input[i] * std::sin(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::cos(std::sqrt(std::abs(input[i + 1] + input[i] + 1))) +
(input[i + 1] + 1) *
std::cos(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::sin(std::sqrt(std::abs(input[i + 1] + input[i] + 1)));
}
return sum;
}
double pathological(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += 0.5 +
(std::pow(std::sin(std::sqrt(100 * std::pow(input[i], 2) + std::pow(input[i + 1], 2))), 2) - 0.5) /
(1 + 0.001 * std::pow(std::pow(input[i], 2) - 2 * input[i] * input[i + 1] + std::pow(input[i + 1], 2), 2));
}
return sum;
}
double michalewicz(std::vector<double> input){
int upper_bound = M_PI;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::sin(input[i]) * std::pow(std::sin(i * std::pow(input[i], 2) / M_PI), 20);
}
return -sum;
}
double masters_cosine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::pow(M_E, -(1/8) * (std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i + 1] * input[i])) *
std::cos(4 * std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i] * input[i + 1]));
}
return -sum;
}
double shekels_foxholes(std::vector<double> input){
int upper_bound = 10;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < c.size() - 1; i++) {
double bottom_sum = 0;
for (int q = 0; q < input.size(); q++){
bottom_sum = std::pow(input.at(q) - a[i][q], 2);
}
sum += 1 / (bottom_sum + c[i]);
}
return -sum;
}
struct timer{
std::chrono::high_resolution_clock::time_point t1;
std::chrono::high_resolution_clock::time_point t2;
void start(){t1 = std::chrono::high_resolution_clock::now();}
void end(){t2 = std::chrono::high_resolution_clock::now();}
double duration(){ return std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();}
};
double set_within(double val, double prior_upper, double prior_lower, double after_upper, double after_lower){
return ((after_upper - after_lower) * (val - prior_lower) / (prior_upper - prior_lower)) + after_lower;
}
struct function{
double (*function_pointer)(std::vector<double>);
double range = 0;
double upper_bound = 0;
double lower_bound = 0;
timer t;
function(double (*func)(std::vector<double>), double upper_bound, double lower_bound){
function_pointer = func;
this->upper_bound = upper_bound;
this->lower_bound = lower_bound;
}
double compute_defined(std::vector<double> input){
for (auto v: input) {
if (v >= lower_bound && v <= upper_bound) {
return function_pointer(input);
} else {
return 0;
}
}
};
enum Test_Data { MEAN, MEDIAN, DEVIATION, AVG_TIME, DIMENSIONALIY, UPPER_RANGE, LOWER_RANGE};
std::map<Test_Data, double> run_tests_random(int dimensionality, int permutations){
std::vector<double> times;
std::vector<double> vals;
for (int i = 0; i < permutations; i++) {
std::vector<double> dimension_vals;
for (int i = 0; i < dimensionality; i++){
dimension_vals.push_back(fmod(std::rand() , (upper_bound * 2)) + lower_bound);
}
t.start();
vals.push_back(compute_defined(dimension_vals));
t.end();
times.push_back(t.duration());
}
// Mean
double mean = 0;
for (double v: vals){
mean += v;
}
mean /= vals.size();
// Median
double median = vals[std::floor(vals.size() / 2)];
// Standard Deviation
double sum = 0;
for (double v: vals){
sum += std::pow(v - mean, 2);
}
double deviation = std::sqrt(sum / vals.size());
// Time Mean
double time_mean = 0;
for (double v: times){
time_mean += v;
}
time_mean /= times.size();
// Range
std::sort(vals.begin(), vals.end());
double lower_range = vals.front();
double upper_range = vals.back();
std::map<Test_Data, double> ret;
ret[Test_Data::DIMENSIONALIY] = dimensionality;
ret[Test_Data::AVG_TIME] = time_mean;
ret[Test_Data::DEVIATION] = deviation;
ret[Test_Data::MEAN] = mean;
ret[Test_Data::MEDIAN] = median;
ret[Test_Data::UPPER_RANGE] = upper_range;
ret[Test_Data::LOWER_RANGE] = lower_range;
std::cout << " & " << dimensionality << " & " << mean << " & " << median << " & " << deviation << " & " << time_mean << " \\\\ \\hline" << std::endl;
return ret;
};
std::map<Test_Data, double> run_tests_defined(std::vector<double> input, int permutations){
std::vector<double> times;
std::vector<double> vals;
for (int i = 0; i < permutations; i++) {
t.start();
vals.push_back(function_pointer(input));
t.end();
times.push_back(t.duration());
}
// Mean
double mean = 0;
for (double v: vals){
mean += v;
}
mean /= vals.size();
// Median
double median = vals[std::floor(vals.size() / 2)];
// Standard Deviation
double sum = 0;
for (double v: vals){
sum += std::pow(v - mean, 2);
}
double deviation = std::sqrt(sum / vals.size());
// Time Mean
double time_mean = 0;
for (double v: times){
time_mean += v;
}
time_mean /= times.size();
// Range
std::sort(vals.begin(), vals.end());
double lower_range = vals.front();
double upper_range = vals.back();
std::map<Test_Data, double> ret;
ret[Test_Data::DIMENSIONALIY] = input.size();
ret[Test_Data::AVG_TIME] = time_mean;
ret[Test_Data::DEVIATION] = deviation;
ret[Test_Data::MEAN] = mean;
ret[Test_Data::MEDIAN] = median;
ret[Test_Data::UPPER_RANGE] = upper_range;
ret[Test_Data::LOWER_RANGE] = lower_range;
return ret;
};
void draw(){
int bounds = fabs(upper_bound) + fabs(lower_bound);
int window_xy = 1024;
sf::RenderWindow window(sf::VideoMode(window_xy, window_xy), "Functions");
sf::Uint8* pixel_array = new sf::Uint8[window_xy * window_xy * 4];
sf::Texture texture;
texture.create(window_xy, window_xy);
sf::Sprite sprite(texture);
double min = 9999999;
double max = 0;
for (int i = 0; i < window_xy * window_xy * 4; i += 4) {
std::vector<double> position =
{static_cast<double>(set_within(((i / 4) % window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound)),
static_cast<double>(set_within(((i / 4) / window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound))};
auto res = static_cast<double>(compute_defined(position));
if (res > max)
max = res;
if (res < min)
min = res;
}
for (int i = 0; i < window_xy * window_xy * 4; i += 4){
std::vector<double> position =
{static_cast<double>(set_within(((i / 4) % window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound)),
static_cast<double>(set_within(((i / 4) / window_xy) - window_xy/2, 512, -512, upper_bound, lower_bound))};
auto res = static_cast<int>((((compute_defined(position) - min) * (16581375 - 0)) / (max - min)) + 0);
pixel_array[i + 0] = res & 0xff;
pixel_array[i + 1] = (res>>8) & 0xff;
pixel_array[i + 2] = (res>>16) & 0xff;
pixel_array[i + 3] = 255;
//pixel_array[i + 0] = res;
//pixel_array[i + 1] = 255;
//pixel_array[i + 2] = 255;
//pixel_array[i + 3] = 255;
}
texture.update(pixel_array);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(sprite);
window.display();
}
delete pixel_array;
};
};
int main() {
MTRand r(time(NULL));
std::cout << r();
srand(time(NULL));
function schwefel_f(&schwefel, 512, -512);
function de_jong_f(&first_de_jong, 100, -100);
function rosenbrock_f(&rosenbrock, 100, -100);
function rastrigin_f(&rastrigin, 30, -30);
function griegwangk_f(&griewangk, 500, -500);
function sine_envelope_sine_wave_f(&sine_envelope_sine_wave, 30, -30);
function stretched_v_sine_wave_f(&stretched_v_sine_wave, 30, -30);
function ackleys_one_f(&ackleys_one, 32, -32);
function ackleys_two_f(&ackleys_two, 32, -32);
function egg_holder_f(&egg_holder, 500, -500);
function rana_f(&rana, 500, -500);
function pathological_f(&pathological, 100, -100);
function michalewicz_f(&michalewicz, M_PI, 0);
function masters_cosine_wave_f(&masters_cosine_wave, 30, -30);
function shekels_foxholes_f(&shekels_foxholes, 10, 0);
// shekels_foxholes_f.draw();
// schwefel_f.draw();
// de_jong_f.draw();
// rosenbrock_f.draw();
// rastrigin_f.draw();
// griegwangk_f.draw();
// sine_envelope_sine_wave_f.draw();
// stretched_v_sine_wave_f.draw();
// ackleys_one_f.draw();
// ackleys_two_f.draw();
// egg_holder_f.draw();
// rana_f.draw();
// pathological_f.draw();
// michalewicz_f.draw();
// masters_cosine_wave_f.draw();
std::string vals[] {
"MEAN", "MEDIAN", "DEVIATION", "AVG_TIME", "DIMENSIONALIY", "UPPER_RANGE", "LOWER_RANGE"
};
int permutations = 10000;
for (int i = 10; i < 40; i += 10) {
auto ret = schwefel_f.run_tests_random(i, permutations);
ret = de_jong_f.run_tests_random(i, permutations);
ret = rosenbrock_f.run_tests_random(i, permutations);
ret = rastrigin_f.run_tests_random(i, permutations);
ret = griegwangk_f.run_tests_random(i, permutations);
ret = sine_envelope_sine_wave_f.run_tests_random(i, permutations);
ret = stretched_v_sine_wave_f.run_tests_random(i, permutations);
ret = ackleys_one_f.run_tests_random(i, permutations);
ret = ackleys_two_f.run_tests_random(i, permutations);
ret = egg_holder_f.run_tests_random(i, permutations);
ret = rana_f.run_tests_random(i, permutations);
ret = pathological_f.run_tests_random(i, permutations);
ret = michalewicz_f.run_tests_random(i, permutations);
ret = masters_cosine_wave_f.run_tests_random(i, permutations);
ret = shekels_foxholes_f.run_tests_random(i, permutations);
}
return 0;
}

@ -0,0 +1,51 @@
// mtrand.cpp, see include file mtrand.h for information
#include "mtrand.h"
// non-inline function definitions and static member definitions cannot
// reside in header file because of the risk of multiple declarations
// initialization of static private members
unsigned long MTRand_int32::state[n] = {0x0UL};
int MTRand_int32::p = 0;
bool MTRand_int32::init = false;
void MTRand_int32::gen_state() { // generate new state vector
for (int i = 0; i < (n - m); ++i)
state[i] = state[i + m] ^ twiddle(state[i], state[i + 1]);
for (int i = n - m; i < (n - 1); ++i)
state[i] = state[i + m - n] ^ twiddle(state[i], state[i + 1]);
state[n - 1] = state[m - 1] ^ twiddle(state[n - 1], state[0]);
p = 0; // reset position
}
void MTRand_int32::seed(unsigned long s) { // init by 32 bit seed
state[0] = s & 0xFFFFFFFFUL; // for > 32 bit machines
for (int i = 1; i < n; ++i) {
state[i] = 1812433253UL * (state[i - 1] ^ (state[i - 1] >> 30)) + i;
// see Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier
// in the previous versions, MSBs of the seed affect only MSBs of the array state
// 2002/01/09 modified by Makoto Matsumoto
state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
}
p = n; // force gen_state() to be called for next random number
}
void MTRand_int32::seed(const unsigned long* array, int size) { // init by array
seed(19650218UL);
int i = 1, j = 0;
for (int k = ((n > size) ? n : size); k; --k) {
state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1664525UL))
+ array[j] + j; // non linear
state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
++j; j %= size;
if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
}
for (int k = n - 1; k; --k) {
state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1566083941UL)) - i;
state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
}
state[0] = 0x80000000UL; // MSB is 1; assuring non-zero initial array
p = n; // force gen_state() to be called for next random number
}

@ -0,0 +1,156 @@
// mtrand.h
// C++ include file for MT19937, with initialization improved 2002/1/26.
// Coded by Takuji Nishimura and Makoto Matsumoto.
// Ported to C++ by Jasper Bedaux 2003/1/1 (see http://www.bedaux.net/mtrand/).
// The generators returning floating point numbers are based on
// a version by Isaku Wada, 2002/01/09
//
// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The names of its contributors may not be used to endorse or promote
// products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Any feedback is very welcome.
// http://www.math.keio.ac.jp/matumoto/emt.html
// email: matumoto@math.keio.ac.jp
//
// Feedback about the C++ port should be sent to Jasper Bedaux,
// see http://www.bedaux.net/mtrand/ for e-mail address and info.
#ifndef MTRAND_H
#define MTRAND_H
class MTRand_int32 { // Mersenne Twister random number generator
public:
// default constructor: uses default seed only if this is the first instance
MTRand_int32() { if (!init) seed(5489UL); init = true; }
// constructor with 32 bit int as seed
MTRand_int32(unsigned long s) { seed(s); init = true; }
// constructor with array of size 32 bit ints as seed
MTRand_int32(const unsigned long* array, int size) { seed(array, size); init = true; }
// the two seed functions
void seed(unsigned long); // seed with 32 bit integer
void seed(const unsigned long*, int size); // seed with array
// overload operator() to make this a generator (functor)
unsigned long operator()() { return rand_int32(); }
// 2007-02-11: made the destructor virtual; thanks "double more" for pointing this out
virtual ~MTRand_int32() {} // destructor
protected: // used by derived classes, otherwise not accessible; use the ()-operator
unsigned long rand_int32(); // generate 32 bit random integer
private:
static const int n = 624, m = 397; // compile time constants
// the variables below are static (no duplicates can exist)
static unsigned long state[n]; // state vector array
static int p; // position in state array
static bool init; // true if init function is called
// private functions used to generate the pseudo random numbers
unsigned long twiddle(unsigned long, unsigned long); // used by gen_state()
void gen_state(); // generate new state
// make copy constructor and assignment operator unavailable, they don't make sense
MTRand_int32(const MTRand_int32&); // copy constructor not defined
void operator=(const MTRand_int32&); // assignment operator not defined
};
// inline for speed, must therefore reside in header file
inline unsigned long MTRand_int32::twiddle(unsigned long u, unsigned long v) {
return (((u & 0x80000000UL) | (v & 0x7FFFFFFFUL)) >> 1)
^ ((v & 1UL) * 0x9908B0DFUL);
// 2013-07-22: line above modified for performance according to http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/Ierymenko.html
// thanks Vitaliy FEOKTISTOV for pointing this out
}
inline unsigned long MTRand_int32::rand_int32() { // generate 32 bit random int
if (p == n) gen_state(); // new state vector needed
// gen_state() is split off to be non-inline, because it is only called once
// in every 624 calls and otherwise irand() would become too big to get inlined
unsigned long x = state[p++];
x ^= (x >> 11);
x ^= (x << 7) & 0x9D2C5680UL;
x ^= (x << 15) & 0xEFC60000UL;
return x ^ (x >> 18);
}
// generates double floating point numbers in the half-open interval [0, 1)
class MTRand : public MTRand_int32 {
public:
MTRand() : MTRand_int32() {}
MTRand(unsigned long seed) : MTRand_int32(seed) {}
MTRand(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
~MTRand() {}
double operator()() {
return static_cast<double>(rand_int32()) * (1. / 4294967296.); } // divided by 2^32
private:
MTRand(const MTRand&); // copy constructor not defined
void operator=(const MTRand&); // assignment operator not defined
};
// generates double floating point numbers in the closed interval [0, 1]
class MTRand_closed : public MTRand_int32 {
public:
MTRand_closed() : MTRand_int32() {}
MTRand_closed(unsigned long seed) : MTRand_int32(seed) {}
MTRand_closed(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
~MTRand_closed() {}
double operator()() {
return static_cast<double>(rand_int32()) * (1. / 4294967295.); } // divided by 2^32 - 1
private:
MTRand_closed(const MTRand_closed&); // copy constructor not defined
void operator=(const MTRand_closed&); // assignment operator not defined
};
// generates double floating point numbers in the open interval (0, 1)
class MTRand_open : public MTRand_int32 {
public:
MTRand_open() : MTRand_int32() {}
MTRand_open(unsigned long seed) : MTRand_int32(seed) {}
MTRand_open(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
~MTRand_open() {}
double operator()() {
return (static_cast<double>(rand_int32()) + .5) * (1. / 4294967296.); } // divided by 2^32
private:
MTRand_open(const MTRand_open&); // copy constructor not defined
void operator=(const MTRand_open&); // assignment operator not defined
};
// generates 53 bit resolution doubles in the half-open interval [0, 1)
class MTRand53 : public MTRand_int32 {
public:
MTRand53() : MTRand_int32() {}
MTRand53(unsigned long seed) : MTRand_int32(seed) {}
MTRand53(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
~MTRand53() {}
double operator()() {
return (static_cast<double>(rand_int32() >> 5) * 67108864. +
static_cast<double>(rand_int32() >> 6)) * (1. / 9007199254740992.); }
private:
MTRand53(const MTRand53&); // copy constructor not defined
void operator=(const MTRand53&); // assignment operator not defined
};
#endif // MTRAND_H

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.5.1)
project(Lab2)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(SOURCE_FILES main.cpp)
add_executable(Lab2 ${SOURCE_FILES})

Binary file not shown.

@ -0,0 +1,402 @@
std::vector<double> c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462,
0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369,
0.992,0.332,0.817,0.632,0.883,0.608,0.326};
double a[][10] =
{
{9.681,0.667,4.783,9.095,3.517,9.325,6.544,0.211,5.122,2.02},
{9.4,2.041,3.788,7.931,2.882,2.672,3.568,1.284,7.033,7.374},
{8.025,9.152,5.114,7.621,4.564,4.711,2.996,6.126,0.734,4.982},
{2.196,0.415,5.649,6.979,9.510,9.166,6.304,6.054,9.377,1.426},
{8.074,8.777,3.467,1.863,6.708,6.349,4.534,0.276,7.633,1.567},
{7.650,5.658,0.720,2.764,3.278,5.283,7.474,6.274,1.409,8.208},
{1.256,3.605,8.623,6.905,4.584,8.133,6.071,6.888,4.187,5.448},
{8.314,2.261,4.24,1.781,4.124,0.932,8.129,8.658,1.208,5.762},
{0.226,8.858,1.42,0.954,1.622,4.698,6.228,9.096,0.972,7.637},
{7.305,2.228,1.242,5.928,9.133,1.826,4.06,5.204,8.713,8.247},
{0.652,7.027,0.508,4.876,8.807,4.632,5.808,6.937,3.291,7.016},
{2.699,3.516,5.847,4.119,4.461,7.496,8.817,0.69,6.593,9.789},
{8.327,3.897,2.017,9.57,9.825,1.15,1.395,3.885,6.354,0.109},
{2.132,7.006,7.136,2.641,1.882,5.943,7.273,7.691,2.88,0.564},
{4.707,5.579,4.08,0.581,9.698,8.542,8.077,8.515,9.231,4.67},
{8.304,7.559,8.567,0.322,7.128,8.392,1.472,8.524,2.277,7.826},
{8.632,4.409,4.832,5.768,7.05,6.715,1.711,4.323,4.405,4.591},
{4.887,9.112,0.17,8.967,9.693,9.867,7.508,7.77,8.382,6.74},
{2.44,6.686,4.299,1.007,7.008,1.427,9.398,8.48,9.95,1.675},
{6.306,8.583,6.084,1.138,4.350,3.134,7.853,6.061,7.457,2.258},
{0.652,2.343,1.37,0.821,1.31,1.063,0.689,8.819,8.833,9.07},
{5.558,1.272,5.756,9.857,2.279,2.764,1.284,1.677,1.244,1.234},
{3.352,7.549,9.817,9.437,8.687,4.167,2.57,6.54,0.228,0.027},
{8.798,0.88,2.37,0.168,1.701,3.68,1.231,2.39,2.499,0.064},
{1.46,8.057,1.337,7.217,7.914,3.615,9.981,9.198,5.292,1.224},
{0.432,8.645,8.774,0.249,8.081,7.461,4.416,0.652,4.002,4.644},
{0.679,2.8,5.523,3.049,2.968,7.225,6.73,4.199,9.614,9.229},
{4.263,1.074,7.286,5.599,8.291,5.2,9.214,8.272,4.398,4.506},
{9.496,4.83,3.15,8.27,5.079,1.231,5.731,9.494,1.883,9.732},
{4.138,2.562,2.532,9.661,5.611,5.5,6.886,2.341,9.699,6.5}
};
double schwefel(std::vector<double> input){
int upper_bound = 512;
int lower_bound = -512;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += (-input[i]) * std::sin(std::sqrt(std::abs(input[i])));
}
return sum;
}
double first_de_jong(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2);
}
return sum;
}
double rosenbrock(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 100 * std::pow((std::pow(input[i], 2) - input[i + 1]), 2) + std::pow((1 - input[i]), 2);
}
return sum;
}
double rastrigin(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) - 10 * std::cos(2 * M_PI * input[i]);
}
sum *= 2 * input.size();
return sum;
}
double griewangk(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) / 4000;
}
double product = 1;
for (int i = 0; i < input.size(); i++){
product *= std::cos(input[i] / sqrt(i + 1));
}
return 1 + sum - product;
}
double sine_envelope_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 0.5 + (std::pow(std::sin(std::pow(input[i], 2) + std::pow(input[i + 1], 2) - 0.5), 2)) /
(1 + 0.001 * (std::pow(input[i], 2) + std::pow(input[i + 1], 2)));
}
return sum;
}
double stretched_v_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 4) *
std::pow(std::sin(50 * std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 10)), 2) + 1;
}
return sum;
}
double ackleys_one(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += (1.0 / pow(M_E, 0.2)) *
std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2)) +
3 * std::cos(2 * input[i]) +
std::sin(2 * input[i + 1]);
}
return sum;
}
double ackleys_two(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 20 + M_E -
(20 / (std::pow(M_E, 0.2) * std::sqrt(((std::pow(input[i], 2) + std::pow(input[i+1], 2) + 1) / 2)))) -
std::pow(M_E, 0.5 * std::cos(2 * M_PI * input[i]) + cos(2 * M_PI * input[i + 1]));
}
return sum;
}
double egg_holder(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += -input[i] * std::sin(std::sqrt(abs(input[i] - input[i + 1] - 47))) -
(input[i + 1] + 47) * std::sin(std::sqrt(std::abs(input[i + 1] + 47 + input[i] / 2)));
}
return sum;
}
double rana(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += input[i] * std::sin(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::cos(std::sqrt(std::abs(input[i + 1] + input[i] + 1))) +
(input[i + 1] + 1) *
std::cos(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::sin(std::sqrt(std::abs(input[i + 1] + input[i] + 1)));
}
return sum;
}
double pathological(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += 0.5 +
(std::pow(std::sin(std::sqrt(100 * std::pow(input[i], 2) + std::pow(input[i + 1], 2))), 2) - 0.5) /
(1 + 0.001 * std::pow(std::pow(input[i], 2) - 2 * input[i] * input[i + 1] + std::pow(input[i + 1], 2), 2));
}
return sum;
}
double michalewicz(std::vector<double> input){
int upper_bound = M_PI;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::sin(input[i]) * std::pow(std::sin(i * std::pow(input[i], 2) / M_PI), 20);
}
return -sum;
}
double masters_cosine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::pow(M_E, -(1/8) * (std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i + 1] * input[i])) *
std::cos(4 * std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i] * input[i + 1]));
}
return -sum;
}
double shekels_foxholes(std::vector<double> input){
int upper_bound = 10;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < c.size() - 1; i++) {
double bottom_sum = 0;
for (int q = 0; q < input.size(); q++){
bottom_sum = std::pow(input.at(q) - a[i][q], 2);
}
sum += 1 / (bottom_sum + c[i]);
}
return -sum;
}
double set_within(double val, double prior_upper, double prior_lower, double after_upper, double after_lower){
return ((after_upper - after_lower) * (val - prior_lower) / (prior_upper - prior_lower)) + after_lower;
}
struct function {
double (*function_pointer)(std::vector<double>);
double range = 0;
double upper_bound = 0;
double lower_bound = 0;
timer t;
function(){};
function(double (*func)(std::vector<double>), double upper_bound, double lower_bound) {
function_pointer = func;
this->upper_bound = upper_bound;
this->lower_bound = lower_bound;
}
double compute(std::vector<double> input) {
for (auto v: input) {
if (v <= lower_bound && v >= upper_bound) {
std::cout << "Function exceeded bounds";
return 0;
}
}
double res = function_pointer(input);
return res;
};
// enum Test_Data {
// MEAN, MEDIAN, DEVIATION, AVG_TIME, DIMENSIONALIY, UPPER_RANGE, LOWER_RANGE
// };
//
// std::vector<double> random_walk(int dimensionality, int permutations){
//
// MTRand rng();
//
// std::vector<double> times;
// std::vector<double> vals;
//
// double best_value = 99999999999;
//
// t.start();
//
// for (int i = 0; i < permutations; i++) {
//
// std::vector<double> dimension_vals;
//
// for (int i = 0; i < dimensionality; i++) {
// dimension_vals.push_back(fmod(rand(), (upper_bound * 2)) + lower_bound);
// }
//
//
// double res = compute(dimension_vals);
// if (res < best_value){
// best_value = res;
// }
// }
//
// vals.push_back(best_value);
//
// t.end();
//
// times.push_back(t.duration());
//
// // Mean
// double mean = 0;
// for (double v: vals) {
// mean += v;
// }
// mean /= vals.size();
//
// // Median
// double median = vals[std::floor(vals.size() / 2)];
//
// // Standard Deviation
// double sum = 0;
// for (double v: vals) {
// sum += std::pow(v - mean, 2);
// }
// double deviation = std::sqrt(sum / vals.size());
//
// // Time Mean
// double time_mean = 0;
// for (double v: times) {
// time_mean += v;
// }
// time_mean /= times.size();
//
// // Range
// std::sort(vals.begin(), vals.end());
//
// double lower_range = vals.front();
// double upper_range = vals.back();
//
// std::map<Test_Data, double> ret;
//
// ret[Test_Data::DIMENSIONALIY] = dimensionality;
// ret[Test_Data::AVG_TIME] = time_mean;
// ret[Test_Data::DEVIATION] = deviation;
// ret[Test_Data::MEAN] = mean;
// ret[Test_Data::MEDIAN] = median;
// ret[Test_Data::UPPER_RANGE] = upper_range;
// ret[Test_Data::LOWER_RANGE] = lower_range;
//
// // std::cout << " & " << dimensionality << " & " << mean << " & " << median << " & " << deviation << " & "
// // << time_mean << " \\\\ \\hline" << std::endl;
//
// return ret;
// };
};

@ -0,0 +1,65 @@
#pragma once
#include "search_function.h"
class iterative_local_search : public search_function {
public:
iterative_local_search(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start
std::vector<double> global_best_solution;
for (int i = 0; i < dimensionality; i++) {
global_best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
// 30 iteration max
int iteration_max = 30;
for (int i = 0; i < iteration_max; i++){
// Random new solution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is still being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
// Set up the new solution
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// test it
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
// Check to see if we found a better global solution
if (func.compute(best_solution) < func.compute(global_best_solution)){
global_best_solution = best_solution;
}
}
};
};

@ -0,0 +1,53 @@
#pragma once
#include "search_function.h"
class local_search : public search_function {
public:
local_search(function f) : search_function(f) {
};
double search(int permutations, int dimensionality) {
// Set up the initial soution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// Check to see if we found a better solution
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
return func.compute(best_solution);
};
};

@ -0,0 +1,79 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <chrono>
#include <cstring>
#include "twister.c"
#include "util.hpp"
#include "functions.hpp"
#include "random_walk.hpp"
#include "local_search.hpp"
#include "iterative_local_search.hpp"
// for each i in demension vals:
// new solution[i] = best[i] - delta *(f(new) - f(old))
//
// if new solution better, set it as solution
int main(int argc, char* args[]) {
std::map<int, function> function_lookup;
function_lookup.emplace(std::make_pair(0, function(&schwefel, 512, -512)));
function_lookup.emplace(std::make_pair(1, function(&first_de_jong, 100, -100)));
function_lookup.emplace(std::make_pair(2, function(&rosenbrock, 100, -100)));
function_lookup.emplace(std::make_pair(3, function(&rastrigin, 30, -30)));
function_lookup.emplace(std::make_pair(4, function(&griewangk, 500, -500)));
function_lookup.emplace(std::make_pair(5, function(&sine_envelope_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(6, function(&stretched_v_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(7, function(&ackleys_one, 32, -32)));
function_lookup.emplace(std::make_pair(8, function(&ackleys_two, 32, -32)));
function_lookup.emplace(std::make_pair(9, function(&egg_holder, 500, -500)));
function_lookup.emplace(std::make_pair(10, function(&rana, 500, -500)));
function_lookup.emplace(std::make_pair(11, function(&pathological, 100, -100)));
function_lookup.emplace(std::make_pair(12, function(&michalewicz, M_PI, 0)));
function_lookup.emplace(std::make_pair(13, function(&masters_cosine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(14, function(&shekels_foxholes, 10, 0)));
function f;
int dimensionality = 0;
double seed = 0;
int search_function = 0;
// Get the command line args
if (argc == 1){
char arg_str[200];
std::cin.get(arg_str, 200);
char t = ' ';
f = function_lookup[atoi(strtok(arg_str, &t))];
dimensionality = atoi(strtok(NULL, &t));
seed = atoi(strtok(NULL, &t));
search_function = atoi(strtok(NULL, &t));
} else {
f = function_lookup[atoi(args[1])];
dimensionality = atoi(args[2]);
seed = atoi(args[3]);
search_function = atoi(args[4]);
}
// Set up the search functions
seedMT(seed);
random_walk r_w(f);
local_search l_s(f);
iterative_local_search it_s(f);
// return the results of the search
if (search_function == 0)
std::cout << r_w.search(1, dimensionality) << std::endl;
else if (search_function == 1)
std::cout << l_s.search(1, dimensionality) << std::endl;
else if (search_function == 2)
std::cout << it_s.search(1, dimensionality) << std::endl;
return 0;
}

@ -0,0 +1,41 @@
#pragma once
#include "search_function.h"
#include <algorithm>
class random_walk : public search_function {
public:
random_walk(function f) : search_function(f) {
}
double search(int permutations, int dimensionality) {
timer t;
t.start();
std::vector<double> r;
for (int i = 0; i < permutations; i++){
std::vector<double> dimension_vals;
for (int i = 0; i < dimensionality; i++) {
auto val = fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound;
dimension_vals.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
r.push_back(func.compute(dimension_vals));
}
t.end();
std::sort(r.begin(), r.end(), std::less<double>());
return r[0];
}
};

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@ -0,0 +1,71 @@
import matplotlib.pyplot as plt
plt.plot([
7.08019,
7.76125,
7.78901,
6.86725,
6.89327,
6.66617,
6.62795,
6.89146,
7.93945,
6.32002,
6.37838,
6.39102,
6.52912,
6.13898,
6.46143,
6.20752,
6.24721,
7.4823,
7.44849,
7.1168,
6.44656,
7.13644,
7.83785,
6.90917,
6.41901,
6.83155,
6.60604,
7.09917,
6.27536,
6.07117
])
plt.plot([
7.08019,
7.08019,
7.08019,
6.86725,
6.86725,
6.66617,
6.62795,
6.62795,
6.62795,
6.32002,
6.32002,
6.32002,
6.32002,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.13898,
6.07117
])
plt.title("Sine Envelope Sine Wave")
plt.show()

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@ -0,0 +1,71 @@
import matplotlib.pyplot as plt
plt.plot([
-8.69983,
-8.69546,
-7.02473,
-8.70105,
-8.74989,
-8.83741,
-8.26651,
-8.83748,
-8.65732,
-8.85348,
-8.6054,
-8.8361,
-8.53024,
-8.33546,
-8.64118,
-8.82631,
-8.7925,
-8.7356,
-8.81997,
-8.72815,
-8.80891,
-8.55486,
-8.83265,
-8.75692,
-8.82736,
-8.76921,
-8.76973,
-8.60752,
-8.8201,
-8.84716
])
plt.plot([
-8.69983,
-8.69546,
-8.69546,
-8.70105,
-8.74989,
-8.83741,
-8.83741,
-8.83748,
-8.83748,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348,
-8.85348
])
plt.title("Pathological Function")
plt.show()

@ -0,0 +1,113 @@
from subprocess import check_output
import subprocess
import random
import matplotlib.pyplot as plt
import time
random.seed()
loc = "../build/Lab2"
f = open('out','w')
function = "1"
print("dim=10")
f.write("dim=10\n")
for q in range(0, 30):
subprocess.call([
loc,
str(13),
str(10),
str(random.randint(0, 2147483646)),
function
])
#print("dim=10")
#f.write("dim=10\n")
#for q in range(0, 15):
# if q == 4 or q == 12:
# continue
# print(q)
# start = time.time()
#
# subprocess.call([
# loc,
# str(q),
# str(10),
# str(random.randint(0, 2147483646)),
# function
# ])
#
# end = time.time()
# f.write(str(end-start) + "\n")
# print(end - start)
#
#print("dim=20")
#f.write("dim=20\n")
#for q in range(0, 15):
# if q == 4 or q == 12:
# continue
# print(q)
# start = time.time()
#
# subprocess.call([
# loc,
# str(q),
# str(20),
# str(random.randint(0, 2147483646)),
# function
# ])
#
# end = time.time()
# f.write(str(end-start) + "\n")
# print(end - start)
#print("dim=30")
#f.write("dim=30\n")
#for q in range(0, 15):
# if q == 4:
# continue
# print(q)
# start = time.time()
#
# subprocess.call([
# loc,
# str(q),
# str(30),
# str(random.randint(0, 2147483646)),
# function
# ])
#
# end = time.time()
# f.write(str(end-start) + "\n")
# print(end - start)
f.close()

Binary file not shown.

@ -0,0 +1,12 @@
\relax
\providecommand*\new@tpo@label[2]{}
\select@language{english}
\@writefile{toc}{\select@language{english}}
\@writefile{lof}{\select@language{english}}
\@writefile{lot}{\select@language{english}}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Methods}{1}}
\@writefile{toc}{\contentsline {section}{\numberline {3}Analysis}{1}}
\@writefile{toc}{\contentsline {section}{\numberline {4}Conclusion}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {5}Results}{4}}
\@writefile{toc}{\contentsline {section}{\numberline {6}Previous Results}{14}}

@ -0,0 +1,759 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex 2016.10.20) 24 OCT 2016 16:15
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**writeup.tex
(./writeup.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2016/06/14 v3.21 KOMA-Script document class (article)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrkbase.sty
Package: scrkbase 2016/06/14 v3.21 KOMA-Script package (KOMA-Script-dependent b
asics and keyval usage)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrbase.sty
Package: scrbase 2016/06/14 v3.21 KOMA-Script package (KOMA-Script-independent
basics and keyval usage)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package: scrlfile 2016/06/14 v3.21 KOMA-Script package (loading files)
Package scrlfile, 2016/06/14 v3.21 KOMA-Script package (loading files)
Copyright (C) Markus Kohm
))) (/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/tocbasic.sty
Package: tocbasic 2016/06/14 v3.21 KOMA-Script package (handling toc-files)
\scr@dte@tocline@numberwidth=\skip41
\scr@dte@tocline@numbox=\box26
)
Package tocbasic Info: omitting babel extension for `toc'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `toc' on input line 130.
Package tocbasic Info: omitting babel extension for `lof'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lof' on input line 131.
Package tocbasic Info: omitting babel extension for `lot'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lot' on input line 132.
Class scrartcl Info: File `scrsize11pt.clo' used to setup font sizes on input l
ine 2052.
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrsize11pt.clo
File: scrsize11pt.clo 2016/06/14 v3.21 KOMA-Script font size class option (11pt
)
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/typearea.sty
Package: typearea 2016/06/14 v3.21 KOMA-Script package (type area)
Package typearea, 2016/06/14 v3.21 KOMA-Script package (type area)
Copyright (C) Frank Neukam, 1992-1994
Copyright (C) Markus Kohm, 1994-
\ta@bcor=\skip42
\ta@div=\count79
\ta@hblk=\skip43
\ta@vblk=\skip44
\ta@temp=\skip45
\footheight=\skip46
Package typearea Info: These are the values describing the layout:
(typearea) DIV = 10
(typearea) BCOR = 0.0pt
(typearea) \paperwidth = 597.50793pt
(typearea) \textwidth = 418.25555pt
(typearea) DIV departure = -6%
(typearea) \evensidemargin = 17.3562pt
(typearea) \oddsidemargin = 17.3562pt
(typearea) \paperheight = 845.04694pt
(typearea) \textheight = 595.80026pt
(typearea) \topmargin = -25.16531pt
(typearea) \headheight = 17.0pt
(typearea) \headsep = 20.40001pt
(typearea) \topskip = 11.0pt
(typearea) \footskip = 47.6pt
(typearea) \baselineskip = 13.6pt
(typearea) on input line 1529.
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\scr@dte@part@maxnumwidth=\skip47
\scr@dte@section@maxnumwidth=\skip48
\scr@dte@subsection@maxnumwidth=\skip49
\scr@dte@subsubsection@maxnumwidth=\skip50
\scr@dte@paragraph@maxnumwidth=\skip51
\scr@dte@subparagraph@maxnumwidth=\skip52
LaTeX Info: Redefining \textsubscript on input line 4036.
\abovecaptionskip=\skip53
\belowcaptionskip=\skip54
\c@pti@nb@sid@b@x=\box27
\c@figure=\count86
\c@table=\count87
Class scrartcl Info: Redefining `\numberline' on input line 5049.
\bibindent=\dimen102
) (/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2016/06/19 v1.99m Standard LaTeX package
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2016/06/19 v1.99m Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 48.
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fourier.sty
Package: fourier 2005/01/01 1.4 fourier-GUTenberg package
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2016/06/19 v1.99m Standard LaTeX package
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2016/06/19 v1.99m Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 48.
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/textcomp.sty
Package: textcomp 2016/06/19 v1.99m Standard LaTeX package
Package textcomp Info: Sub-encoding information:
(textcomp) 5 = only ISO-Adobe without \textcurrency
(textcomp) 4 = 5 + \texteuro
(textcomp) 3 = 4 + \textohm
(textcomp) 2 = 3 + \textestimated + \textcurrency
(textcomp) 1 = TS1 - \textcircled - \t
(textcomp) 0 = TS1 (full)
(textcomp) Font families with sub-encoding setting implement
(textcomp) only a restricted character set as indicated.
(textcomp) Family '?' is the default used for unknown fonts.
(textcomp) See the documentation for details.
Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 79.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ts1enc.def
File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
)
LaTeX Info: Redefining \oldstylenums on input line 334.
Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 349.
Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 350.
Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 351.
Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 352.
Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 353.
Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 354.
Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 355.
Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 356.
Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 357.
Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 358.
Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 359.
Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 360.
Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 361.
Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 362.
Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 363.
Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 364.
Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 365.
Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 366.
Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 367.
Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 368.
Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 369.
Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 370.
Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 371.
Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 372.
Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 373.
Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 374.
Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 375.
Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 376.
Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 377.
Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 378.
Package textcomp Info: Setting lmr sub-encoding to TS1/0 on input line 379.
Package textcomp Info: Setting lmdh sub-encoding to TS1/0 on input line 380.
Package textcomp Info: Setting lmss sub-encoding to TS1/0 on input line 381.
Package textcomp Info: Setting lmssq sub-encoding to TS1/0 on input line 382.
Package textcomp Info: Setting lmvtt sub-encoding to TS1/0 on input line 383.
Package textcomp Info: Setting lmtt sub-encoding to TS1/0 on input line 384.
Package textcomp Info: Setting qhv sub-encoding to TS1/0 on input line 385.
Package textcomp Info: Setting qag sub-encoding to TS1/0 on input line 386.
Package textcomp Info: Setting qbk sub-encoding to TS1/0 on input line 387.
Package textcomp Info: Setting qcr sub-encoding to TS1/0 on input line 388.
Package textcomp Info: Setting qcs sub-encoding to TS1/0 on input line 389.
Package textcomp Info: Setting qpl sub-encoding to TS1/0 on input line 390.
Package textcomp Info: Setting qtm sub-encoding to TS1/0 on input line 391.
Package textcomp Info: Setting qzc sub-encoding to TS1/0 on input line 392.
Package textcomp Info: Setting qhvc sub-encoding to TS1/0 on input line 393.
Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 394.
Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 395.
Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 396.
Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 397.
Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 398.
Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 399.
Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 400.
Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 401.
Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 402.
Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 403.
Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 404.
Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 405.
Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 406.
Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 407.
Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 408.
Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 409.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fourier-orns.sty
Package: fourier-orns 2004/01/30 1.1 fourier-ornaments package
)
LaTeX Font Info: Redeclaring symbol font `operators' on input line 50.
LaTeX Font Info: Encoding `OT1' has changed to `T1' for symbol font
(Font) `operators' in the math version `normal' on input line 50.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> T1/futs/m/n on input line 50.
LaTeX Font Info: Encoding `OT1' has changed to `T1' for symbol font
(Font) `operators' in the math version `bold' on input line 50.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> T1/futs/m/n on input line 50.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) T1/futs/m/n --> T1/futs/b/n on input line 51.
LaTeX Font Info: Redeclaring symbol font `letters' on input line 59.
LaTeX Font Info: Encoding `OML' has changed to `FML' for symbol font
(Font) `letters' in the math version `normal' on input line 59.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> FML/futmi/m/it on input line 59.
LaTeX Font Info: Encoding `OML' has changed to `FML' for symbol font
(Font) `letters' in the math version `bold' on input line 59.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> FML/futmi/m/it on input line 59.
\symotherletters=\mathgroup4
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) FML/futmi/m/it --> FML/futmi/b/it on input line 61.
LaTeX Font Info: Overwriting symbol font `otherletters' in version `bold'
(Font) FML/futm/m/it --> FML/futm/b/it on input line 62.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 63.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 64.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 65.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 66.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 67.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 68.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 69.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 70.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 71.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 72.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 73.
LaTeX Font Info: Redeclaring symbol font `symbols' on input line 113.
LaTeX Font Info: Encoding `OMS' has changed to `FMS' for symbol font
(Font) `symbols' in the math version `normal' on input line 113.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> FMS/futm/m/n on input line 113.
LaTeX Font Info: Encoding `OMS' has changed to `FMS' for symbol font
(Font) `symbols' in the math version `bold' on input line 113.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> FMS/futm/m/n on input line 113.
LaTeX Font Info: Redeclaring symbol font `largesymbols' on input line 114.
LaTeX Font Info: Encoding `OMX' has changed to `FMX' for symbol font
(Font) `largesymbols' in the math version `normal' on input line 1
14.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> FMX/futm/m/n on input line 114.
LaTeX Font Info: Encoding `OMX' has changed to `FMX' for symbol font
(Font) `largesymbols' in the math version `bold' on input line 114
.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> FMX/futm/m/n on input line 114.
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 115.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> T1/futs/bx/n on input line 115.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> T1/futs/bx/n on input line 115.
LaTeX Font Info: Redeclaring math alphabet \mathrm on input line 116.
LaTeX Font Info: Redeclaring math alphabet \mathit on input line 117.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> T1/futs/m/it on input line 117.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> T1/futs/m/it on input line 117.
LaTeX Font Info: Redeclaring math alphabet \mathcal on input line 118.
LaTeX Font Info: Redeclaring math symbol \parallel on input line 134.
LaTeX Font Info: Redeclaring math symbol \hbar on input line 148.
LaTeX Font Info: Redeclaring math symbol \varkappa on input line 186.
LaTeX Font Info: Redeclaring math symbol \varvarrho on input line 187.
LaTeX Font Info: Redeclaring math delimiter \Vert on input line 210.
LaTeX Font Info: Redeclaring math delimiter \vert on input line 215.
LaTeX Font Info: Redeclaring math delimiter \Downarrow on input line 225.
LaTeX Font Info: Redeclaring math delimiter \backslash on input line 227.
LaTeX Font Info: Redeclaring math delimiter \rangle on input line 229.
LaTeX Font Info: Redeclaring math delimiter \langle on input line 231.
LaTeX Font Info: Redeclaring math delimiter \rbrace on input line 233.
LaTeX Font Info: Redeclaring math delimiter \lbrace on input line 235.
LaTeX Font Info: Redeclaring math delimiter \rceil on input line 237.
LaTeX Font Info: Redeclaring math delimiter \lceil on input line 239.
LaTeX Font Info: Redeclaring math delimiter \rfloor on input line 241.
LaTeX Font Info: Redeclaring math delimiter \lfloor on input line 243.
LaTeX Font Info: Redeclaring math accent \acute on input line 247.
LaTeX Font Info: Redeclaring math accent \grave on input line 248.
LaTeX Font Info: Redeclaring math accent \ddot on input line 249.
LaTeX Font Info: Redeclaring math accent \tilde on input line 250.
LaTeX Font Info: Redeclaring math accent \bar on input line 251.
LaTeX Font Info: Redeclaring math accent \breve on input line 252.
LaTeX Font Info: Redeclaring math accent \check on input line 253.
LaTeX Font Info: Redeclaring math accent \hat on input line 254.
LaTeX Font Info: Redeclaring math accent \dot on input line 255.
LaTeX Font Info: Redeclaring math accent \mathring on input line 256.
\symUfutm=\mathgroup5
)
(/usr/local/texlive/2016/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2016/04/23 3.9r The Babel package
(/usr/local/texlive/2016/texmf-dist/tex/generic/babel-english/english.ldf
Language: english 2012/08/20 v3.3p English support from the babel system
(/usr/local/texlive/2016/texmf-dist/tex/generic/babel/babel.def
File: babel.def 2016/04/23 3.9r Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
)
\l@canadian = a dialect from \language\l@american
\l@australian = a dialect from \language\l@british
\l@newzealand = a dialect from \language\l@british
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/microtype.sty
Package: microtype 2016/05/14 v2.6a Micro-typographical refinements (RS)
\MT@toks=\toks15
\MT@count=\count89
LaTeX Info: Redefining \textls on input line 774.
\MT@outer@kern=\dimen104
LaTeX Info: Redefining \textmicrotypecontext on input line 1310.
\MT@listname@count=\count90
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/microtype-pdftex.def
File: microtype-pdftex.def 2016/05/14 v2.6a Definitions specific to pdftex (RS)
LaTeX Info: Redefining \lsstyle on input line 916.
LaTeX Info: Redefining \lslig on input line 916.
\MT@outer@space=\skip55
)
Package microtype Info: Loading configuration file microtype.cfg.
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/microtype.cfg
File: microtype.cfg 2016/05/14 v2.6a microtype main configuration file (RS)
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2016/06/28 v2.15d AMS math features
\@mathmargin=\skip56
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01 AMS text
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks16
\ex@=\dimen105
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen106
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count91
LaTeX Info: Redefining \frac on input line 199.
\uproot@=\count92
\leftroot@=\count93
LaTeX Info: Redefining \overline on input line 297.
\classnum@=\count94
\DOTSCASE@=\count95
LaTeX Info: Redefining \ldots on input line 394.
LaTeX Info: Redefining \dots on input line 397.
LaTeX Info: Redefining \cdots on input line 518.
\Mathstrutbox@=\box28
\strutbox@=\box29
\big@size=\dimen107
LaTeX Font Info: Redeclaring font encoding OML on input line 634.
LaTeX Font Info: Redeclaring font encoding OMS on input line 635.
\macc@depth=\count96
\c@MaxMatrixCols=\count97
\dotsspace@=\muskip10
\c@parentequation=\count98
\dspbrk@lvl=\count99
\tag@help=\toks17
\row@=\count100
\column@=\count101
\maxfields@=\count102
\andhelp@=\toks18
\eqnshift@=\dimen108
\alignsep@=\dimen109
\tagshift@=\dimen110
\tagwidth@=\dimen111
\totwidth@=\dimen112
\lineht@=\dimen113
\@envbody=\toks19
\multlinegap=\skip57
\multlinetaggap=\skip58
\mathdisplay@stack=\toks20
LaTeX Info: Redefining \[ on input line 2739.
LaTeX Info: Redefining \] on input line 2740.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup6
\symAMSb=\mathgroup7
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
LaTeX Font Info: Redeclaring math symbol \square on input line 141.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/amscls/amsthm.sty
Package: amsthm 2015/03/04 v2.20.2
\thm@style=\toks21
\thm@bodyfont=\toks22
\thm@headfont=\toks23
\thm@notefont=\toks24
\thm@headpunct=\toks25
\thm@preskip=\skip59
\thm@postskip=\skip60
\thm@headsep=\skip61
\dth@everypar=\toks26
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2016/07/10 v1.0t Standard LaTeX Graphics (DPC,SPQR)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 99.
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2016/07/10 v0.06j Graphics/color for pdfTeX
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count103
))
\Gin@req@height=\dimen114
\Gin@req@width=\dimen115
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip11
Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/sectsty/sectsty.sty
Package: sectsty 2002/02/25 v2.0.2 Commands to change all sectional heading sty
les
)
Class scrartcl Warning: Usage of package `fancyhdr' together
(scrartcl) with a KOMA-Script class is not recommended.
(scrartcl) I'd suggest to use
(scrartcl) package `scrlayer-scrpage'.
(scrartcl) Nevertheless, using requested
(scrartcl) package `fancyhdr' on input line 13.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
Package: fancyhdr 2016/09/06 3.8 Extensive control of page headers and footers
\fancy@headwidth=\skip62
\f@ncyO@elh=\skip63
\f@ncyO@erh=\skip64
\f@ncyO@olh=\skip65
\f@ncyO@orh=\skip66
\f@ncyO@elf=\skip67
\f@ncyO@erf=\skip68
\f@ncyO@olf=\skip69
\f@ncyO@orf=\skip70
)
(./writeup.aux)
\openout1 = `writeup.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 40.
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for FML/futm/m/it on input line 40.
LaTeX Font Info: Try loading font information for FML+futm on input line 40.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fmlfutm.fd
File: fmlfutm.fd 2004/10/30 Fontinst v1.926 font definitions for FML/futm.
)
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for FMS/futm/m/n on input line 40.
LaTeX Font Info: Try loading font information for FMS+futm on input line 40.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fmsfutm.fd
File: fmsfutm.fd 2004/10/30 Fontinst v1.926 font definitions for FMS/futm.
)
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for FMX/futm/m/n on input line 40.
LaTeX Font Info: Try loading font information for FMX+futm on input line 40.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fmxfutm.fd
File: fmxfutm.fd futm-extension
)
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 40.
LaTeX Font Info: Try loading font information for TS1+cmr on input line 40.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ts1cmr.fd
File: ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: ... okay on input line 40.
LaTeX Font Info: Try loading font information for T1+futs on input line 40.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/t1futs.fd
File: t1futs.fd 2004/03/02 Fontinst v1.926 font definitions for T1/futs.
)
LaTeX Info: Redefining \microtypecontext on input line 40.
Package microtype Info: Generating PDF output.
Package microtype Info: Character protrusion enabled (level 2).
Package microtype Info: Using default protrusion set `alltext'.
Package microtype Info: Automatic font expansion enabled (level 2),
(microtype) stretch: 20, shrink: 20, step: 1, non-selected.
Package microtype Info: Using default expansion set `basictext'.
Package microtype Info: No adjustment of tracking.
Package microtype Info: No adjustment of interword spacing.
Package microtype Info: No adjustment of character kerning.
Package microtype Info: Loading generic settings for font family
(microtype) `futs' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
(/usr/local/texlive/2016/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count104
\scratchdimen=\dimen116
\scratchbox=\box30
\nofMPsegments=\count105
\nofMParguments=\count106
\everyMPshowfont=\toks27
\MPscratchCnt=\count107
\MPscratchDim=\dimen117
\MPnumerator=\count108
\makeMPintoPDFobject=\count109
\everyMPtoPDFconversion=\toks28
) (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)
))
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
38.
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 456.
(/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
LaTeX Font Info: Try loading font information for T1+cmss on input line 42.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1cmss.fd
File: t1cmss.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
Package microtype Info: Loading generic settings for font family
(microtype) `cmss' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
LaTeX Font Info: Try loading font information for OT1+bch on input line 42.
(/usr/local/texlive/2016/texmf-dist/tex/latex/psnfss/ot1bch.fd
File: ot1bch.fd 2004/10/18 font definitions for OT1/bch.
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/mt-bch.cfg
File: mt-bch.cfg 2007/03/03 v1.5 microtype config. file: Bitstream Charter (RS)
)
LaTeX Font Info: Try loading font information for FML+futmi on input line 42
.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fourier/fmlfutmi.fd
File: fmlfutmi.fd 2004/10/30 Fontinst v1.926 font definitions for FML/futmi.
)
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 13.24796pt on input line 42.
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 9.19998pt on input line 42.
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 7.35999pt on input line 42.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 13.24796pt on input line 42.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 9.19998pt on input line 42.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 7.35999pt on input line 42.
LaTeX Font Info: Try loading font information for U+msa on input line 42.
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/mt-msa.cfg
File: mt-msa.cfg 2006/02/04 v1.1 microtype config. file: AMS symbols (a) (RS)
)
LaTeX Font Info: Try loading font information for U+msb on input line 42.
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
(/usr/local/texlive/2016/texmf-dist/tex/latex/microtype/mt-msb.cfg
File: mt-msb.cfg 2005/06/01 v1.0 microtype config. file: AMS symbols (b) (RS)
) [1
{/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
<figure_1.png, id=7, 578.16pt x 433.62pt>
File: figure_1.png Graphic file (type png)
<use figure_1.png>
Package pdftex.def Info: figure_1.png used on input line 85.
(pdftex.def) Requested size: 578.15858pt x 433.61894pt.
<figure_2.png, id=9, 578.16pt x 433.62pt>
File: figure_2.png Graphic file (type png)
<use figure_2.png>
Package pdftex.def Info: figure_2.png used on input line 86.
(pdftex.def) Requested size: 578.15858pt x 433.61894pt.
Overfull \hbox (55.61937pt too wide) in paragraph at lines 85--87
[][] []
[]
[2 <./figure_1.png> <./figure_2.png>]
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 10.07397pt on input line 165.
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 7.63599pt on input line 165.
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 5.51999pt on input line 165.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 10.07397pt on input line 165.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 7.63599pt on input line 165.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 5.51999pt on input line 165.
LaTeX Font Info: Font shape `T1/futs/bx/n' in size <10.95> not available
(Font) Font shape `T1/futs/b/n' tried instead on input line 165.
[3]
Overfull \vbox (106.04941pt too high) has occurred while \output is active []
[4]
Overfull \vbox (93.56163pt too high) has occurred while \output is active []
[5]
Overfull \vbox (85.54623pt too high) has occurred while \output is active []
[6]
Overfull \vbox (57.40477pt too high) has occurred while \output is active []
[7]
Overfull \vbox (70.76376pt too high) has occurred while \output is active []
[8]
Overfull \vbox (76.10736pt too high) has occurred while \output is active []
[9]
Overfull \vbox (90.97194pt too high) has occurred while \output is active []
[10]
Overfull \vbox (93.64374pt too high) has occurred while \output is active []
[11]
Overfull \vbox (101.65913pt too high) has occurred while \output is active []
[12]
LaTeX Font Info: Font shape `FMX/futm/m/n' will be
(Font) scaled to size 6.99199pt on input line 610.
LaTeX Font Info: Font shape `U/futm/m/n' will be
(Font) scaled to size 6.99199pt on input line 610.
LaTeX Font Info: Font shape `T1/futs/bx/n' in size <10> not available
(Font) Font shape `T1/futs/b/n' tried instead on input line 610.
Underfull \hbox (badness 10000) in paragraph at lines 588--611
[]
Underfull \hbox (badness 10000) in paragraph at lines 615--638
[]
Underfull \hbox (badness 10000) in paragraph at lines 642--665
[]
[13] [14] (./writeup.aux) )
Here is how much of TeX's memory you used:
7577 strings out of 493013
123354 string characters out of 6133327
366922 words of memory out of 5000000
10857 multiletter control sequences out of 15000+600000
97712 words of font info for 171 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
49i,11n,51p,8842b,268s stack positions out of 5000i,500n,10000p,200000b,80000s
{/usr/local/texlive/2016/texmf-dist/fonts/enc/dvips/
base/8r.enc}</usr/local/texlive/2016/texmf-dist/fonts/type1/adobe/utopia/putb8a
.pfb></usr/local/texlive/2016/texmf-dist/fonts/type1/adobe/utopia/putr8a.pfb>
Output written on writeup.pdf (14 pages, 186569 bytes).
PDF statistics:
64 PDF objects out of 1000 (max. 8388607)
41 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
27659 words of extra memory for PDF output out of 29859 (max. 10000000)

Binary file not shown.

@ -0,0 +1,738 @@
\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{13.6pt}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{Central Washington University of the Computer Science Department} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge Project 2 \\
\horrule{2pt} \\[0.5cm]
}
\author{\normalsize Mitchell Hansen \\[-6pt]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\section{Introduction}
For this lab we took the 15 functions that we programmed in the previous
lab and ran them through 3 different optimization functions, each more
accurate than the previous. We have random search, which blindly tests
randomized solutions looking for an optimum. Secondly we have local search,
which takes an initial randomized solution and then attempts to optimize it
until it's at its minimum. Thirdly we have iterative local search, which
combines the two previous functions.
\section{Methods}
A significant portion of the code from the previous lab was rewritten to
allow the functions and search methods to be run from the command line.
Arguments specifying the dimensionality of the solution, id of the function,
id of the search method, and a seed are all handled by the program. Using
this backbone, we wrote a trivial python script that executes each search
method on all of the 15 functions being tested for each dimensionality.
There currently is an issue with run times being significant for a select
few functions on high dimensionalties. As a result some data points have
been omitted.
\section{Analysis}
There were various interesting results both in the new data, what the new
functions were able to find in terms of minimums, and how close some data
points got to the last lab where the search was purely random.
Comparing the new data from the Iterative Local Search (ILS) and the Local
Search (LS) with the previous results, we see that the purely naive method
that we used previously is actually quite sufficient for a few select functions,
namely: Sine Envelope Sine Wave, Pathological, Rosenbrok, and Ackleys
Two functions. Each of these functions evaluated to very similar solutions
in all three methods, naive, ILS and LS. Often being within 10\% of each other.
The differences between the two new methods used in this lab, ILS and LS
are mainly negligible in their cumulative accuracy. There are
some examples where the search methods differ more than others. Griegwangk
and Egg Holder differ the most between the two methods, with a 100 - 200 \%
difference seen between the methods. For single runs of the functions though,
ILS is superior to LS as can be seen in the graphics below for two separate
runs of ILS on differing functions. The top line being the single run results,
and the bottom being the running best solution.
\scalebox{0.4}{\includegraphics{figure_1}}
\scalebox{0.4}{\includegraphics{figure_2}}
There were also a few problems with the experimentation, one being the fact that
we neglected the fact that the delta value within the LS and ILS functions could
throw the function outside of its specified bounds. The implementation checked
each of these bounds each function call, but only returned 0 if it exceeded them.
Thus some results have erroneous values of either 0 or some other integer value.
Another problem, as mentioned again in the conclusion, is the run time of these
search methods. In particular, function 5 and 13 ran extremely slow. Slow enough
for the results having to be omitted as it would take longer to obtain the results
than we have time for the lab. We hope to speed up the implementation prior to the
next lab and include those results then.
All testing was done on an i7-3630QM with 16GB ram using a single thread.
Complete results can be viewed in the sections below.
\section{Conclusion}
The search functions in this lab seem to behave much more accurately than the
random search in the previous lab. Not only are the new functions seemingly accurate,
but they also appear to repeat their values consistently giving the appearance that
they are coming up with a somewhat correct answer. Unfortunately, it seems where these
new functions fall down is in their performance. In the 30 dimension trials for this lab,
there were multiple functions where results had to be omitted because of running time issues.
Some taking up to multiple hours to run for their full permutation count. We hope to see
functions which take care of these issues in the upcoming labs.
\section{Results}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1223.19 & 13286 & 3.18E+09 & 24260 & 114.244 & 5.52567 & 18.2586 & 154.502 & 145.101 & -1714.21 & -1147.36 & 3.95561 & -1.64259 & -3.31459 & -19.1981 \\
& -1399.06 & 19906 & 1.96E+09 & 16700 & 90.6946 & 6.07905 & 20.4112 & 102.177 & 142.077 & -1648.81 & -1560.96 & 4.09041 & -1.39102 & -4.9016 & -19.1981 \\
& -1010.48 & 14917 & 6.76E+09 & 24520 & 51.8071 & 6.28399 & 21.7189 & 125.452 & 138.122 & -1661.62 & -1122.59 & 4.06708 & -1.34332 & -5.57971 & -19.1981 \\
& -1934.21 & 13942 & 4.96E+09 & 29540 & 122.229 & 5.67277 & 19.682 & 123.082 & 139.72 & -2343.48 & -1408.66 & 4.03919 & -1.86534 & -4.43512 & -19.1981 \\
& -794.372 & 14642 & 3.77E+09 & 19260 & 51.4992 & 5.64587 & 17.3606 & 130.231 & 146.019 & -1927.46 & -1392.74 & 4.02665 & -0.919067 & -2.9242 & -19.1981 \\
& -1431.49 & 10213 & 5.51E+09 & 15600 & 99.3078 & 6.37517 & 19.3915 & 106.105 & 147.534 & -1693.06 & -1590.86 & 3.81288 & -1.94752 & -4.41244 & -19.1981 \\
& -1222.58 & 14061 & 6.24E+09 & 27600 & 61.8407 & 5.95916 & 21.8219 & 134.971 & 138.811 & -1120.32 & -1274.41 & 3.90444 & -0.949296 & -5.21336 & -19.1981 \\
& -1659.45 & 14265 & 3.86E+09 & 12040 & 77.3118 & 6.59486 & 19.6264 & 107.374 & 137.152 & -2115.97 & -1151.79 & 3.9272 & -2.01492 & -4.14032 & -10.3861 \\
& -1495.15 & 16757 & 7.43E+09 & 29540 & 90.1975 & 5.82742 & 17.0893 & 118.252 & 133.507 & -1385.32 & -1145.69 & 4.03879 & -1.59431 & -4.89982 & -19.1981 \\
& -869.356 & 16426 & 4.32E+09 & 32060 & 34.4248 & 5.79818 & 19.4186 & 111.549 & 133.483 & -1677.77 & -859.394 & 4.00669 & -0.948425 & -5.22481 & -13.4604 \\
& -1039.51 & 18099 & 3.32E+09 & 34560 & 91.9329 & 6.26357 & 21.1327 & 114.807 & 140.81 & -1668.54 & -1128.23 & 4.07449 & -1.05552 & -3.01325 & -19.1981 \\
& -919.612 & 12176 & 6.94E+09 & 25180 & 90.0024 & 6.26924 & 16.2619 & 113.944 & 128.653 & -2016.45 & -873.684 & 4.06288 & -1.4206 & -4.45688 & -19.1981 \\
& -1506.41 & 14320 & 5.21E+08 & 31120 & 108.815 & 6.47541 & 18.8506 & 92.2691 & 142.909 & -2022.87 & -1605.81 & 4.00233 & -1.76635 & -2.84643 & -19.1981 \\
& -1418.55 & 20724 & 2.01E+09 & 26780 & 82.2471 & 6.03665 & 19.3898 & 106.227 & 133.068 & -2409.09 & -1688.21 & 4.16777 & -2.26334 & -4.32598 & -19.1981 \\
& -1011.89 & 18565 & 7.75E+09 & 23560 & 95.8855 & 6.32915 & 17.2525 & 114.955 & 133.399 & -3479.56 & -988.721 & 4.03036 & -1.32162 & -4.01327 & -19.1981 \\
& -1408.31 & 15157 & 5.16E+09 & 23300 & 85.4808 & 5.70288 & 18.6271 & 150.783 & 138.84 & -2023.31 & -1078.79 & 4.00918 & -1.95085 & -4.44009 & -19.1981 \\
& -748.024 & 23811 & 2.54E+09 & 18940 & 147.794 & 5.43586 & 20.034 & 137.888 & 138.61 & -2389.56 & -1342.49 & 3.70141 & -1.36667 & -4.68997 & -19.1981 \\
& -1638.56 & 18165 & 5.13E+08 & 15660 & 116.448 & 5.86329 & 18.6616 & 114.843 & 144.891 & -2692.09 & -1348.9 & 4.1051 & -2.70373 & -4.78687 & -19.1981 \\
& -840.918 & 20571 & 5.90E+09 & 29040 & 88.0594 & 6.07913 & 21.4554 & 108.89 & 148.508 & -1373.66 & -709.318 & 4.16242 & -1.27512 & -3.5624 & -19.1981 \\
& -918.388 & 19467 & 5.67E+09 & 18540 & 86.3758 & 5.50249 & 16.6631 & 117.034 & 138.953 & -1841.87 & -1118.65 & 4.05446 & -1.43019 & -4.92021 & -19.1981 \\
& -1914.4 & 14579 & 4.51E+09 & 35380 & 112.945 & 6.45106 & 17.4196 & 113.865 & 137.99 & -1295.97 & -1449.41 & 4.04415 & -1.21765 & -3.82571 & -19.1981 \\
& -1152.74 & 16613 & 8.29E+09 & 27140 & 93.3062 & 6.2383 & 18.8128 & 120.968 & 143.59 & -1384.85 & -1405.02 & 4.21014 & -0.963691 & -5.42752 & -13.344 \\
& -1484.78 & 18381 & 5.35E+09 & 36160 & 58.6201 & 6.30713 & 17.9042 & 130.23 & 135.182 & -1930.82 & -1426.85 & 4.00492 & -1.37802 & -4.93164 & -19.1981 \\
& -1049.66 & 8486 & 3.92E+09 & 19580 & 112.332 & 6.55806 & 19.9514 & 141.112 & 135.308 & -1799.74 & -884.562 & 4.23598 & -2.511 & -3.99085 & -13.4604 \\
& -1093.92 & 16661 & 6.44E+09 & 24500 & 92.3324 & 6.30898 & 20.232 & 121.163 & 130.104 & -1710.14 & -967.321 & 4.06013 & -2.29801 & -6.0234 & -19.1981 \\
& -1412.25 & 18188 & 5.81E+09 & 26880 & 109.978 & 5.70144 & 13.2134 & 90.171 & 134.353 & -1785.93 & -819.994 & 3.77693 & -1.0307 & -5.92079 & -19.1981 \\
& -1186.11 & 13189 & 3.77E+09 & 19320 & 106.128 & 6.27975 & 18.8899 & 136.097 & 146.582 & -1703.69 & -1298.35 & 3.73847 & -0.944601 & -3.52666 & -19.1981 \\
& -1356.38 & 18343 & 2.37E+09 & 13500 & 65.7106 & 5.97634 & 21.5128 & 115.854 & 140.762 & -2070.81 & -1319.27 & 4.18465 & -1.24715 & -5.7363 & -19.1981 \\
& -1528.85 & 17689 & 1.03E+10 & 18840 & 107.888 & 6.00707 & 15.2945 & 94.1472 & 144.7 & -3449.27 & -1375.83 & 4.14164 & -1.64993 & -3.02796 & -19.1981 \\
& -1063.76 & 15783 & 2.62E+09 & 32600 & 97.6585 & 6.46626 & 22.6138 & 123.843 & 131.62 & -1700.03 & -1291.51 & 4.01155 & -1.00427 & -4.24119 & -19.1981 \\
\hline \\
Avg. & -1257.7453333333 & 16246.0666666667 & 4.72E+09 & 2.44E+04 & 9.14E+01 & 6.07E+00 & 1.90E+01 & 1.19E+02 & 1.39E+02 & -1.93E+03 & -1.23E+03 & 4.02E+00 & -1.51E+00 & -4.43E+00 & -1.83E+01 \\
Med. & -1222.885 & 16519.5 & 4735540000 & 24510 & 92.13265 & 6.07909 & 19.13985 & 116.444 & 138.8255 & -1792.835 & -1282.96 & 4.03899 & -1.38452 & -4.437605 & -19.1981 \\
Std. Dev. & 315.9494375281 & 3243.999978032 & 2288019739.0926 & 6682.1279905999 & 24.08152579 & 0.3362814731 & 2.0863159585 & 15.7480637114 & 5.4144432384 & 542.1878355628 & 253.2605529849 & 0.1313044821 & 0.4955181247 & 0.901789508 & 2.3117761941 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1910.87 & 40054 & 1.87E+10 & 122800 & 316.532 & 13.3092 & 54.0294 & 272.443 & 302.424 & -4041.92 & -1817.15 & 8.84883 & -2.46942 & -5.56505 & -12.4756 \\
& -1696.99 & 45772 & 7.63E+09 & 147520 & 297.122 & 14.295 & 50.705 & 272.861 & 303.698 & -4286.27 & -2370.93 & 8.81079 & -1.86537 & -5.17117 & -14.6404 \\
& -3381.59 & 40944 & 1.07E+10 & 111960 & 261.007 & 14.2375 & 48.5996 & 293.562 & 312.574 & -2033.17 & -1370.09 & 7.86544 & -1.92465 & -5.47614 & -14.6404 \\
& -2309.24 & 43289 & 2.03E+10 & 114080 & 249.051 & 13.181 & 46.7492 & 254.37 & 312.802 & -2243.62 & -1637.31 & 8.75968 & -3.27363 & -7.05667 & -14.6404 \\
& -3308.55 & 45667 & 1.77E+10 & 98840 & 258.288 & 13.4705 & 48.7221 & 303.815 & 317.885 & -2736.5 & -1716.73 & 8.69769 & -2.13134 & -8.56678 & -14.6404 \\
& -1776.1 & 35152 & 1.97E+10 & 128360 & 282.098 & 14.0992 & 49.7351 & 295.107 & 293.715 & -3083.96 & -1337.39 & 8.904 & -2.72989 & -4.97279 & -14.6404 \\
& -2495.52 & 42321 & 1.55E+10 & 149040 & 314.038 & 12.2785 & 48.4086 & 311.61 & 312.538 & -2241.98 & -1953.24 & 8.84628 & -2.22338 & -5.40834 & -14.6404 \\
& -1753.65 & 54835 & 2.34E+10 & 144560 & 253.313 & 14.0274 & 52.4705 & 265.832 & 306.999 & -2809.58 & -1617.48 & 9.03187 & -2.36168 & -7.64268 & -14.6404 \\
& -1574.77 & 42698 & 1.66E+10 & 105920 & 253.962 & 13.7941 & 47.9362 & 205.073 & 314.335 & -3135.48 & -1120.02 & 8.97631 & -1.76927 & -7.50096 & -12.4756 \\
& -2206.58 & 47544 & 1.38E+10 & 92400 & 267.474 & 12.5201 & 50.5015 & 300.654 & 299.266 & -2352.88 & -1563.85 & 8.57557 & -1.90659 & -4.65802 & -14.6404 \\
& -2159.17 & 27230 & 1.29E+10 & 135280 & 252.351 & 13.261 & 45.9535 & 202.094 & 304.092 & -3073.25 & -2085.45 & 8.53621 & -1.87303 & -8.01815 & -14.6404 \\
& -2138.87 & 42123 & 1.63E+10 & 172680 & 271.911 & 13.2188 & 44.2571 & 238.99 & 310.573 & -2373.5 & -1490.61 & 8.82391 & -1.49354 & -5.60778 & -14.6404 \\
& -1491.32 & 41559 & 1.57E+10 & 120560 & 264.467 & 14.7017 & 49.9226 & 270.661 & 314.715 & -4606.54 & -1594.99 & 8.57499 & -2.34868 & -6.03643 & -12.4756 \\
& -1716.67 & 43371 & 1.96E+10 & 146160 & 256.312 & 13.2972 & 47.8418 & 296.121 & 299.162 & -2949.32 & -1714.88 & 8.94451 & -1.42826 & -7.75141 & -14.6404 \\
& -1353.62 & 30573 & 2.00E+10 & 160960 & 304.457 & 13.6341 & 44.8636 & 281.098 & 302.466 & -2253.05 & -1586.38 & 8.79012 & -3.8665 & -4.02897 & -14.6404 \\
& -1876.11 & 37188 & 1.04E+10 & 89680 & 268.29 & 12.9539 & 43.9137 & 251.274 & 294.581 & -3173.41 & -1092.65 & 8.51772 & -2.85364 & -4.28 & -14.6404 \\
& -1933.32 & 34504 & 2.32E+10 & 145600 & 255.038 & 14.1056 & 52.7792 & 271.035 & 300.68 & -3193.08 & -1565.67 & 8.89243 & -1.22167 & -6.49108 & -14.6404 \\
& -1778.81 & 32208 & 1.21E+10 & 164080 & 250.116 & 13.5012 & 48.5518 & 321.977 & 304.95 & -2310.76 & -1192.91 & 8.99516 & -2.24735 & -3.84925 & -14.6404 \\
& -1429.94 & 42230 & 1.93E+10 & 139160 & 279.049 & 14.2125 & 47.4455 & 275.462 & 308.209 & -2107.31 & -2552.48 & 8.58813 & -1.87343 & -8.05159 & -14.6404 \\
& -1987.26 & 40385 & 2.04E+10 & 151400 & 276.766 & 12.8164 & 53.0487 & 282.964 & 315.214 & -2678.56 & -2387 & 8.6457 & -3.03476 & -6.09081 & -14.6404 \\
& -1213.51 & 37332 & 1.51E+10 & 158560 & 261.681 & 13.675 & 47.6498 & 259.175 & 303.699 & -2531.58 & -1766.16 & 8.84001 & -2.59238 & -3.25015 & -12.4756 \\
& -1695.59 & 32437 & 1.90E+10 & 128640 & 275.131 & 13.0249 & 46.3462 & 248.083 & 306.287 & -2644.79 & -1901.53 & 8.95061 & -2.73942 & -4.03195 & -14.6404 \\
& -1844.9 & 40572 & 2.06E+10 & 166080 & 249.066 & 14.0993 & 44.662 & 267.558 & 302.1 & -2844.67 & -2131.51 & 9.07241 & -1.88671 & -4.71827 & -14.6404 \\
& -2039.62 & 48632 & 1.87E+10 & 138960 & 245.71 & 13.6312 & 38.0255 & 275.48 & 312.316 & -1829.93 & -2004.13 & 8.91483 & -1.52482 & -8.56454 & -14.6404 \\
& -1689.48 & 44937 & 1.61E+10 & 124600 & 282.54 & 13.3536 & 45.8805 & 290.598 & 305.559 & -2133.36 & -1566.78 & 8.72377 & -3.27145 & -6.96928 & -14.6404 \\
& -1633.96 & 51091 & 1.63E+10 & 117000 & 229.145 & 13.471 & 45.3704 & 307.327 & 311.438 & -1961.85 & -2460.35 & 8.80427 & -2.06181 & -7.33068 & -14.6404 \\
& -2439.89 & 45380 & 7.91E+09 & 140880 & 310.028 & 13.7849 & 39.4548 & 280.565 & 301.484 & -3402.53 & -2003.01 & 8.76709 & -2.71809 & -5.60029 & -14.6404 \\
& -2364.89 & 38298 & 1.23E+10 & 145760 & 238.505 & 14.0388 & 46.8051 & 290.425 & 309.168 & -2827.15 & -1049.02 & 8.70034 & -2.46217 & -7.9223 & -14.6404 \\
& -1855.61 & 47187 & 1.06E+10 & 137680 & 248.9 & 13.9612 & 48.5063 & 302.025 & 305.866 & -2152.73 & -1918.95 & 8.4452 & -2.47409 & -6.79521 & -12.4756 \\
& -1260.76 & 46347 & 1.16E+10 & 130600 & 281.027 & 13.9532 & 49.979 & 252.528 & 301.864 & -1840.58 & -1860.37 & 8.04923 & -2.63026 & -7.00734 & -14.6404 \\
\hline \\
Avg. & -1943.9053333333 & 41395.3333333333 & 1.61E+10 & 1.34E+05 & 2.68E+02 & 1.36E+01 & 4.76E+01 & 2.75E+02 & 3.06E+02 & -2.73E+03 & -1.75E+03 & 8.73E+00 & -2.31E+00 & -6.15E+00 & -1.43E+01 \\
Med. & -1850.255 & 42176.5 & 16269000000 & 138320 & 263.074 & 13.63265 & 47.889 & 275.471 & 305.7125 & -2661.675 & -1715.805 & 8.797195 & -2.298015 & -6.06362 & -14.6404 \\
Std. Dev. & 503.7270251575 & 6204.5677408321 & 4287970694.60419 & 21553.682353336 & 22.5100649673 & 0.5550063904 & 3.5839928835 & 28.0219424426 & 6.1634317364 & 693.8827057417 & 399.7555341973 & 0.2654236567 & 0.6045133055 & 1.5251158054 & 0.8205653224 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -2360.73 & 76232 & 3.56E+10 & 354540 & 429.015 & 21.1792 & 78.9986 & 444.386 & 468.28 & -3685.03 & -2174.65 & 13.6966 & -3.39811 & -7.7131 & -18.886 \\
& -2223.96 & 77130 & 2.33E+10 & 427440 & 482.271 & 21.4306 & 78.5455 & 477.565 & 481.841 & -3105.05 & -1719.81 & 13.3772 & -2.28782 & -5.96241 & -18.886 \\
& -2310.43 & 79924 & 2.53E+10 & 381060 & 438.418 & 22.4267 & 85.9081 & 431.309 & 476.297 & -2717.31 & -3512.41 & 13.4609 & -2.95267 & -9.47434 & -18.886 \\
& -1233.77 & 74245 & 3.11E+10 & 405060 & 500.971 & 20.6669 & 77.8205 & 460.647 & 478.937 & -3095.92 & -2547.58 & 13.8835 & -3.62638 & -9.1978 & -18.886 \\
& -1528.18 & 72335 & 3.46E+10 & 407400 & 480.637 & 21.006 & 85.0255 & 492.562 & 464.278 & -5541.45 & -2344.66 & 13.9109 & -2.60874 & -9.66453 & -13.3197 \\
& -1924.52 & 62337 & 2.96E+10 & 350940 & 400.405 & 21.2461 & 72.6017 & 482.764 & 483.487 & -3317.2 & -2334.39 & 13.194 & -2.35764 & -10.1073 & -18.886 \\
& -2423.33 & 65161 & 2.41E+10 & 257700 & 455.803 & 21.3956 & 79.6323 & 453.521 & 483.905 & -2929.27 & -3939.27 & 13.9277 & -2.81222 & -11.1674 & -18.886 \\
& -3297.71 & 56282 & 2.22E+10 & 333720 & 423.001 & 21.1405 & 72.1825 & 455.991 & 472.822 & -3685.92 & -2244.92 & 13.5072 & -3.4393 & -8.00828 & -13.3197 \\
& -2605.99 & 55514 & 2.99E+10 & 258960 & 432.783 & 20.5493 & 77.5907 & 487.188 & 468.534 & -2270.3 & -1770.48 & 13.8159 & -2.20179 & -7.3187 & -18.886 \\
& -2324.67 & 56507 & 3.57E+10 & 321720 & 497.616 & 21.1693 & 81.6804 & 548.596 & 472.64 & -4354.96 & -2232.69 & 13.4288 & -3.11785 & -9.96651 & -18.886 \\
& -3097.93 & 68919 & 3.54E+10 & 281160 & 311.272 & 21.3644 & 76.7997 & 473.195 & 482.708 & -3184.8 & -1491.68 & 13.6581 & -4.08066 & -11.396 & -18.886 \\
& -1810.75 & 74399 & 2.33E+10 & 325980 & 488.695 & 20.1705 & 79.5259 & 425.339 & 467.469 & -3514.4 & -2784.74 & 13.3882 & -2.20352 & -5.85588 & -13.3197 \\
& -2695.32 & 74130 & 2.86E+10 & 286740 & 445.725 & 21.7638 & 78.5654 & 443.915 & 465.322 & -3661.35 & -2224.44 & 13.7479 & -2.58372 & -8.03162 & -18.886 \\
& -1394.7 & 45078 & 4.43E+10 & 366540 & 392.949 & 19.8834 & 78.3782 & 443.771 & 474.73 & -2292.49 & -2073.16 & 13.8387 & -1.60751 & -8.19351 & -18.886 \\
& -2988.33 & 76470 & 3.30E+10 & 356040 & 403.55 & 22.1061 & 66.4539 & 479.545 & 474.343 & -5213 & -2393.19 & 13.621 & -1.97457 & -7.41504 & -18.886 \\
& -2107.9 & 64868 & 2.55E+10 & 335760 & 315.955 & 21.3366 & 76.1817 & 456.456 & 475.502 & -3594.52 & -1990.68 & 13.2762 & -1.95789 & -9.20082 & -18.886 \\
& -2979.51 & 66791 & 3.77E+10 & 300600 & 476.424 & 22.0409 & 79.8235 & 481.37 & 480.499 & -3226.79 & -2044.33 & 13.4292 & -3.30836 & -8.31641 & -18.886 \\
& -2513.73 & 63196 & 2.56E+10 & 378900 & 308.324 & 22.2978 & 73.8612 & 430.727 & 475.581 & -3321.28 & -2602.19 & 13.2479 & -3.04897 & -7.98816 & -18.886 \\
& -1622.69 & 62073 & 2.68E+10 & 370080 & 453.052 & 21.0996 & 80.359 & 480.134 & 477.041 & -3560.86 & -2227.66 & 13.4122 & -2.65343 & -9.57417 & -13.3197 \\
& -898.919 & 71119 & 3.36E+10 & 275400 & 394.268 & 21.1665 & 76.3499 & 475.151 & 482.187 & -3499.9 & -2010.88 & 13.8071 & -1.77653 & -6.50943 & -18.886 \\
& -2228.64 & 59344 & 2.66E+10 & 365520 & 446.585 & 21.9857 & 81.2511 & 473.327 & 469.027 & -4350.96 & -2530.21 & 13.1101 & -2.27438 & -6.5663 & -18.886 \\
& -2524.28 & 70564 & 2.93E+10 & 375960 & 467.46 & 20.6626 & 76.0828 & 458.589 & 473.993 & -3010.55 & -2107.52 & 13.5724 & -2.93552 & -3.36125 & -13.3197 \\
& -2141.75 & 69544 & 3.38E+10 & 275040 & 410.104 & 20.1186 & 72.5838 & 471.886 & 472.222 & -2617.06 & -2105.35 & 13.348 & -2.82033 & -5.74818 & -18.886 \\
& -2203.34 & 72793 & 3.62E+10 & 380220 & 406.591 & 22.0699 & 71.4693 & 407.417 & 484.37 & -2650.34 & -2240.99 & 13.9337 & -1.66277 & -8.93489 & -18.886 \\
& -1836.75 & 73045 & 3.98E+10 & 379800 & 514.007 & 22.242 & 79.9503 & 478.007 & 471.384 & -4044.69 & -2652.98 & 13.6287 & -2.44844 & -7.85381 & -18.886 \\
& -1787.41 & 50713 & 3.85E+10 & 296100 & 445.226 & 20.0734 & 76.9451 & 459.307 & 448.98 & -3725.34 & -1302.85 & 13.9199 & -2.28859 & -7.12064 & -18.886 \\
& -3185.05 & 70905 & 2.69E+10 & 374640 & 424.633 & 22.0167 & 74.4666 & 459.963 & 469.897 & -4000.25 & -2647.59 & 13.8378 & -3.37299 & -10.0858 & -18.886 \\
& -2551.98 & 57495 & 3.29E+10 & 370380 & 352.025 & 21.2376 & 81.8073 & 458.902 & 480.163 & -2257.61 & -2125.84 & 13.3929 & -1.83939 & -6.25541 & -18.886 \\
& -2406.77 & 78787 & 2.80E+10 & 403560 & 472.017 & 20.9728 & 79.011 & 416.437 & 481.494 & -2723.46 & -1653.13 & 13.5631 & -1.96041 & -5.54987 & -13.3197 \\
& -2783.41 & 66765 & 2.70E+10 & 322920 & 330.427 & 21.3975 & 80.8424 & 466.09 & 467.905 & -3393.49 & -2011.66 & 13.5916 & -2.33285 & -5.45623 & -18.886 \\
\hline \\
Avg. & -2266.4149666667 & 67088.8333333333 & 3.08E+10 & 3.44E+05 & 4.27E+02 & 2.13E+01 & 7.77E+01 & 4.62E+02 & 4.74E+02 & -3.42E+03 & -2.27E+03 & 1.36E+01 & -2.60E+00 & -7.93E+00 & -1.78E+01 \\
Med. & -2317.55 & 69231.5 & 29737350000 & 355290 & 435.6005 & 21.24185 & 78.46185 & 460.305 & 474.5365 & -3357.385 & -2226.05 & 13.582 & -2.51608 & -7.99822 & -18.886 \\
Std. Dev. & 584.4233609571 & 8739.8871218282 & 5587568894.7127 & 47357.674511872 & 57.409444418 & 0.6956118635 & 4.0959187591 & 26.9132515273 & 7.5943841166 & 775.2133686027 & 526.201488921 & 0.2412609758 & 0.6322303515 & 1.8774263418 & 2.2645829281 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1722.16 & 0.03025 & 1.31E+10 & 5978.56 & 69.3764 & 7.53377 & 9.04847 & 181.426 & 151.893 & -754.573 & -2406.31 & 4.19767 & -2.05904 & -8.82787 & -8.1772 \\
& -2788.25 & 0.03025 & 1.59E+10 & 29804.2 & 69.0028 & 6.62654 & 9.08272 & 121.985 & 157.316 & 482.297 & -2056.85 & 4.27003 & -0.232247 & -8.81589 & -8.1772 \\
& -1839.66 & 0.03025 & 2.15E+10 & 17368.8 & 63.9238 & 7.28417 & 9.19482 & 170.218 & 140.056 & -1188.15 & -2643.43 & 4.22798 & 0.00103445 & -8.76307 & -8.1772 \\
& -3498.88 & 0.0300057 & 1.25E+10 & 20604.7 & 68.4473 & 5.87015 & 10.7235 & 109.273 & 156.978 & 765.691 & -2240.2 & 4.50026 & 0.0612122 & -8.79559 & -19.1981 \\
& -2373.7 & 0.03025 & 1.93E+10 & 13430.3 & 34.2408 & 7.98904 & 9.18401 & 130.203 & 151.598 & 357.187 & -2195.2 & 4.49177 & 0.843228 & -8.72636 & -19.2635 \\
& -2669.32 & 0.03025 & 1.38E+10 & 13495.7 & 60.3948 & 7.3257 & 9.63616 & 126.236 & 150.787 & -701.815 & -2689.55 & 4.52112 & -0.563567 & -8.62028 & -19.2635 \\
& -2412.63 & 0.0288532 & 1.22E+10 & 30023.6 & 74.2869 & 7.63259 & 9.07038 & 153.164 & 157.549 & -394.844 & -2613.69 & 4.45488 & 0.147295 & -8.74889 & -19.2635 \\
& -2452.59 & 0.03025 & 2.45E+10 & 22446.9 & 42.4768 & 6.59059 & 9.49866 & 167.659 & 153.588 & -2790.05 & -884.232 & 4.49433 & -1.58924 & -8.68392 & -22.0872 \\
& -2827.23 & 0.03025 & 6.57E+09 & 18043.7 & 64.0325 & 6.60687 & 9.40728 & 137.864 & 155.09 & 167.839 & -3035.03 & 4.10601 & 2.38E-05 & -8.77553 & -8.1772 \\
& -3577.85 & 0.0248398 & 1.74E+10 & 25988.4 & 74.2439 & 6.73684 & 9.28461 & 132.581 & 144.729 & -91.2695 & -1509.7 & 4.46538 & -1.92424 & -8.45917 & -11.5852 \\
& -1326.85 & 0.03025 & 2.68E+10 & 7867.05 & 70.423 & 7.52619 & 9.06149 & 111.908 & 154.855 & -117.596 & -2566.91 & 4.49956 & -0.783772 & -8.59181 & -8.1772 \\
& -3735.8 & 0.03025 & 1.80E+10 & 22752.2 & 50.6174 & 6.33447 & 9.1547 & 139.641 & 152.514 & -1316.55 & -2518 & 4.47642 & -0.0463014 & -8.75746 & -19.27 \\
& -2393.27 & 0.03025 & 1.14E+10 & 14274.5 & 40.5886 & 6.41117 & 10.6114 & 224.812 & 151.689 & -1288.83 & -2630.38 & 3.96854 & -1.52409 & -8.57556 & -8.1772 \\
& -2136.79 & 0.0251012 & 1.16E+10 & 13427.8 & 74.9665 & 6.62278 & 9.18783 & 124.629 & 154.597 & -1036 & -2279.34 & 4.08355 & -0.337027 & -8.83124 & -19.27 \\
& -2551.26 & 0.03025 & 2.09E+10 & 14787 & 71.8753 & 6.1052 & 10.2295 & 144.82 & 149.299 & -2255.52 & -2667.36 & 4.48691 & -0.522676 & -8.6941 & -19.27 \\
& -2610.58 & 0.0275071 & 2.19E+10 & 23744.9 & 51.3633 & 6.37208 & 9.21428 & 170.428 & 154.633 & 499.723 & -1960.24 & 4.49717 & -0.225219 & -8.82633 & -22.0364 \\
& -3301.42 & 0.03025 & 1.42E+10 & 17620.1 & 58.3238 & 6.90171 & 9.09557 & 109.074 & 155.68 & -413.377 & -2868.24 & 4.28546 & -0.609139 & -8.78285 & -22.0364 \\
& -2610.41 & 0.0293121 & 1.09E+10 & 27801.8 & 95.0175 & 6.93148 & 9.15471 & 167.973 & 150.033 & 689.394 & -2833.55 & 4.28827 & 0.0360106 & -8.26686 & -8.1772 \\
& -3183.07 & 0.0290287 & 1.69E+10 & 20238.5 & 60.3234 & 6.74264 & 9.67354 & 102.391 & 156.435 & -1058.05 & -2757.67 & 4.00982 & -0.78522 & -8.08889 & -8.1772 \\
& -2432.85 & 0.0301624 & 3.56E+10 & 22842.4 & 35.3722 & 6.46636 & 11.4128 & 170.701 & 148.289 & 1105.59 & -2210.27 & 4.77573 & -1.19427 & -8.509 & -21.9278 \\
& -2630.3 & 0.0278163 & 2.73E+10 & 25658.9 & 83.3985 & 6.10535 & 9.14037 & 121.269 & 154.065 & -958.512 & -2575.3 & 4.48104 & -1.21108 & -7.78537 & -11.6076 \\
& -2095.89 & 0.03025 & 9.81E+09 & 20270.9 & 40.2026 & 7.20097 & 9.0472 & 104.663 & 154.173 & -505.146 & -1771.42 & 4.11262 & -0.613923 & -8.83158 & -8.1772 \\
& -3301.53 & 0.0302264 & 1.35E+10 & 13708.2 & 62.5321 & 8.05472 & 11.0529 & 165.973 & 155.957 & -2069.58 & -2830.66 & 4.2232 & 0.124692 & -8.83616 & -19.2635 \\
& -2314.48 & 0.0296459 & 1.98E+10 & 21595.5 & 66.9216 & 5.32096 & 9.18803 & 119.401 & 156.968 & -728.852 & -3393.19 & 4.37753 & -1.01123 & -8.81274 & -11.6076 \\
& -3380.47 & 0.0302365 & 9.73E+09 & 26948.7 & 96.7156 & 7.25999 & 9.21712 & 187.299 & 153.919 & -213.715 & -2813.35 & 3.95788 & 0.110539 & -8.7079 & -8.1772 \\
& -3143.51 & 0.0199678 & 2.03E+10 & 11383 & 68.7048 & 6.28303 & 9.25189 & 188.644 & 157.746 & 110.405 & -1688.99 & 4.49839 & -1.74384 & -8.7247 & -8.1772 \\
& -2847.49 & 0.029854 & 1.84E+10 & 23915.5 & 72.8991 & 6.63326 & 9.38279 & 105.037 & 150.94 & 862.177 & -2078.53 & 4.58513 & -1.08988 & -8.61938 & -11.5852 \\
& -2926.46 & 0.03025 & 1.77E+10 & 21728.5 & 81.07 & 6.60333 & 9.31926 & 150.771 & 152.901 & -1333.47 & -2068.27 & 4.05192 & -0.656969 & -8.55918 & -21.9278 \\
& -2195.99 & 0.03025 & 2.26E+10 & 19417.8 & 76.3799 & 6.66027 & 9.09237 & 125.473 & 153.158 & -1148.96 & -2269.14 & 4.4759 & -1.44312 & -8.40539 & -8.1772 \\
& -2610.57 & 0.03025 & 1.95E+10 & 10095 & 51.5363 & 6.21274 & 9.11763 & 159.311 & 154.965 & -304.918 & -2250.28 & 4.4864 & 0.365686 & -8.75928 & -8.1772 \\
\hline \\
Avg. & -2663.042 & 0.02921857 & 1.75E+10 & 1.92E+04 & 6.43E+01 & 6.76E+00 & 9.49E+00 & 1.44E+02 & 1.53E+02 & -5.21E+02 & -2.38E+03 & 4.35E+00 & -6.16E-01 & -8.64E+00 & -1.39E+01 \\
Med. & -2610.575 & 0.03025 & 17541950000 & 20254.7 & 67.68445 & 6.6299 & 9.20455 & 138.7525 & 153.992 & -459.2615 & -2462.155 & 4.46013 & -0.586353 & -8.72553 & -11.5964 \\
Std. Dev. & 565.9521286104 & 0.0022586778 & 6227253551.6775 & 6364.105861632 & 15.8722794272 & 0.6200294914 & 0.6404997265 & 30.5973750771 & 3.8796949489 & 947.6193603132 & 502.5410994529 & 0.2088816019 & 0.7371789862 & 0.2404532 & 5.8867273045 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -5793.64 & 0.0605 & 2.54E+10 & 84243.8 & 0.00544314 & 15.7534 & 22.794 & 388.743 & 318.54 & 872.22 & -4878.35 & 9.29745 & -0.868549 & -17.4433 & -18.4163 \\
& -6425.36 & 0.0605 & 3.40E+10 & 83330.5 & 2.59579 & 15.18 & 19.4765 & 282.217 & 326.136 & -890.302 & -5205.81 & 9.19442 & -1.71722 & -18.36 & -18.1189 \\
& -5773.94 & 0.0605 & 5.03E+10 & 81685.7 & 0.0325362 & 14.6438 & 19.2967 & 414.614 & 325.683 & -38.8792 & -4808.13 & 8.96731 & -1.28757 & -18.4541 & -18.1189 \\
& -4312.14 & 0.0605 & 4.46E+10 & 84028.2 & 0.012734 & 14.8892 & 20.1529 & 248.993 & 329.517 & -49.3419 & -5762.01 & 8.95851 & -0.769716 & -18.3303 & -11.5925 \\
& -5201.29 & 0.0528605 & 2.90E+10 & 85961.1 & 0.0175917 & 14.6958 & 20.7801 & 295.784 & 326.719 & 131.108 & -4284.49 & 9.19177 & -0.978247 & -17.4535 & -11.5925 \\
& -5437.26 & 0.0484009 & 4.27E+10 & 81010.4 & 0.0128073 & 14.7319 & 20.2851 & 308.26 & 321.815 & -3179.98 & -5910.02 & 8.83616 & -1.10339 & -18.3132 & -12.1791 \\
& -5911.51 & 0.0605 & 4.18E+10 & 82890.4 & 0.0127846 & 15.3506 & 24.845 & 297.244 & 320.763 & 124.661 & 359.29 & 9.15435 & -0.821465 & -18.5011 & -11.5925 \\
& -5852.3 & 0.0605 & 3.89E+10 & 80465.7 & 0.50121 & 13.8042 & 24.586 & 358.358 & 328.323 & -1240.58 & -5701.28 & 9.48494 & -2.10437 & -17.7341 & -11.5925 \\
& -4549.95 & 0.0554514 & 2.43E+10 & 82872.7 & 0.0150484 & 14.0756 & 21.9814 & 378.772 & 320.122 & 866.459 & -4804.78 & 9.32682 & 0.177762 & -18.4128 & -11.5924 \\
& -5615.93 & 0.0594314 & 3.87E+10 & 85395.4 & 0.0177641 & 14.9938 & 21.737 & 348.39 & 330.393 & -40.7054 & -803.14 & 9.46576 & -0.757524 & -17.8996 & -12.1455 \\
& -6128.66 & 0.0599989 & 5.86E+09 & 82482.7 & 0.022684 & 15.7937 & 23.5337 & 318.578 & 313.61 & -1594.82 & -5561.16 & 9.47295 & -0.0502173 & -18.3411 & -12.1791 \\
& -5911.12 & 0.06046 & 3.82E+10 & 79597.1 & 0.00540948 & 14.6048 & 19.8786 & 343.956 & 316.997 & -1549.64 & -4889 & 9.12806 & 0.593797 & -17.5708 & -11.5925 \\
& -5378.96 & 0.0546049 & 3.55E+10 & 79844.9 & 0.513188 & 13.4111 & 20.819 & 237.504 & 323.974 & -236.878 & -2783.49 & 9.40669 & -1.5814 & -17.8182 & -11.5925 \\
& -6208.09 & 0.0605 & 4.11E+10 & 82806.8 & 0.0423564 & 13.6263 & 19.9244 & 338.475 & 330.509 & 145.801 & -5149.57 & 8.85904 & 0.0709934 & -17.7823 & -11.5925 \\
& -6365.98 & 0.0604318 & 3.95E+10 & 82980.4 & 0.00544314 & 14.5561 & 29.7907 & 373.119 & 316.579 & -3981.64 & -589.742 & 9.45594 & -0.734831 & -17.6115 & -12.1791 \\
& -4865.5 & 0.0605 & 2.70E+10 & 81023.3 & 0.022684 & 14.1321 & 19.6227 & 264.108 & 329.156 & -895.345 & -5298.19 & 9.31191 & -0.709717 & -17.9523 & -12.1791 \\
& -5753.31 & 0.0592495 & 5.53E+10 & 83182.6 & 0.0177641 & 14.3879 & 19.4463 & 326.461 & 329.266 & -736.031 & -36.6239 & 9.20092 & -1.01499 & -18.0679 & -11.5925 \\
& -4964.05 & 0.0495827 & 3.22E+10 & 86350.6 & 7.65341 & 14.4621 & 19.5375 & 354.537 & 329.072 & -98.6246 & -4398.36 & 9.44551 & -1.39255 & -18.4823 & -11.5925 \\
& -5161.97 & 0.0605 & 3.97E+10 & 79778.4 & 0.0244744 & 14.5572 & 22.6856 & 320.654 & 312.234 & -6486.32 & -4736.91 & 9.2983 & -1.06507 & -17.1146 & -11.5925 \\
& -5635.57 & 0.0605 & 4.11E+10 & 81383.2 & 0.0054374 & 14.5234 & 22.1856 & 287.145 & 323.708 & 562.055 & -5532.35 & 9.13131 & 0.712591 & -18.4878 & -12.1791 \\
& -5477.18 & 0.0605 & 2.88E+10 & 83253.2 & 0.012837 & 14.4646 & 20.9163 & 383.667 & 322.139 & -2281.67 & -4092.8 & 9.208 & -2.1219 & -18.2742 & -11.5925 \\
& -5240.77 & 0.0605 & 5.57E+10 & 82110.1 & 13.4906 & 15.0371 & 19.3914 & 205.418 & 324.571 & -3193.3 & -6020.24 & 8.90623 & -2.27157 & -16.7489 & -11.5924 \\
& -5635.19 & 0.0605 & 2.74E+10 & 84813.3 & 0.0447807 & 15.5438 & 19.7167 & 245.99 & 327.78 & -1235.47 & -3310.1 & 9.39152 & -1.5261 & -17.3734 & -11.5925 \\
& -3246.38 & 0.0605 & 3.80E+10 & 83219.6 & 0.00544314 & 14.7169 & 23.0755 & 303.558 & 313.476 & -1673.84 & -4972.31 & 8.87996 & 0.484031 & -18.4883 & -11.5925 \\
& -6168.66 & 0.0558529 & 4.47E+10 & 84716.8 & 2.94032 & 13.5461 & 19.8038 & 247.696 & 325.746 & -550.653 & -5601.88 & 9.47937 & -0.144748 & -17.0377 & -11.5925 \\
& -4213.77 & 0.0581465 & 3.19E+10 & 80103 & 0.00538645 & 16.5718 & 25.1075 & 282.189 & 323.021 & -137.129 & -5451.53 & 9.11948 & -1.01489 & -17.6702 & -11.5729 \\
& -3384.87 & 0.0595524 & 4.13E+10 & 82072.8 & 0.00541907 & 15.7239 & 19.2661 & 329.103 & 324.07 & -1101.79 & -4311.6 & 9.49093 & -0.162895 & -18.1284 & -11.5925 \\
& -5437.75 & 0.0590881 & 2.77E+10 & 87335.7 & 0.486232 & 13.3387 & 19.7886 & 289.14 & 323.126 & -2199.9 & -5897.58 & 9.47676 & 0.0210599 & -17.9211 & -18.4163 \\
& -4154.64 & 0.0605 & 3.50E+10 & 80441.7 & 0.0226616 & 15.9632 & 19.6977 & 323.442 & 319.648 & -2319.97 & -4943.11 & 9.3123 & -1.96752 & -16.6269 & -11.5925 \\
& -4727.06 & 0.0605 & 5.57E+10 & 83475 & 0.0300529 & 15.2459 & 20.5533 & 339.345 & 325.59 & 2361.6 & -3509.27 & 9.4069 & -2.61652 & -17.0723 & -11.5925 \\
\hline \\
Avg. & -5297.76 & 0.05870373 & 3.70E+10 & 8.28E+04 & 9.53E-01 & 1.47E+01 & 2.14E+01 & 3.15E+02 & 3.23E+02 & -1.02E+03 & -4.30E+03 & 9.24E+00 & -8.91E-01 & -1.78E+01 & -1.26E+01 \\
Med. & -5457.465 & 0.0605 & 38465350000 & 82881.55 & 0.02021285 & 14.6698 & 20.4192 & 319.616 & 324.022 & -813.1665 & -4883.675 & 9.297875 & -0.923398 & -17.91035 & -11.5925 \\
Std. Dev. & 817.3212483051 & 0.0033237366 & 10498474328.5921 & 2030.9259258268 & 2.8130712982 & 0.7900945894 & 2.3862355564 & 50.2442400537 & 5.1944841414 & 1705.6218308227 & 1790.4080474217 & 0.210871267 & 0.8822055188 & 0.5520760648 & 2.2743612411 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -8720.03 & 0.09075 & 6.14E+10 & & 468222 & 25.6736 & 29.4629 & 465.724 & 492.399 & -709.211 & -9489.6 & 14.5445 & & -23.8513 & -19.687 \\
& -6962.47 & 0.09075 & 8.45E+10 & & 544786 & 26.105 & 37.1947 & 476.184 & 495.891 & -2092.66 & -1548.36 & 14.1196 & & -27.6662 & -18.039 \\
& -6961.87 & 0.0899048 & 4.08E+10 & & 566160 & 22.9069 & 32.2468 & 572.709 & 495.119 & -724.496 & -1085.52 & 13.6181 & & -26.3649 & -9.98237 \\
& -7022.1 & 0.09075 & 4.80E+10 & & 507124 & 23.5184 & 32.8019 & 474.808 & 504.87 & 1441.2 & -298.734 & 14.6858 & & -27.5487 & -11.4003 \\
& -7554.77 & 0.09075 & 5.62E+10 & & 534480 & 21.3856 & 45.2881 & 407.728 & 499.809 & -1117.15 & -6155.89 & 14.1285 & & -28.0375 & -18.8073 \\
& -7930.32 & 0.0901661 & 3.89E+10 & & 507272 & 21.786 & 39.2269 & 585.973 & 489.683 & -559.234 & -6021.34 & 14.2482 & & -26.9184 & -17.1526 \\
& -7671.66 & 0.09075 & 6.33E+10 & & 544748 & 23.9949 & 39.7063 & 410.723 & 496.021 & -706.327 & -8420.73 & 14.4966 & & -27.7328 & -18.8073 \\
& -9153.89 & 0.0896031 & 5.37E+10 & & 527930 & 22.0799 & 31.5884 & 432.908 & 498.172 & -1000.39 & -7023.77 & 14.0189 & & -27.4268 & -19.6821 \\
& -7475.88 & 0.0825127 & 7.43E+10 & & 441660 & 24.9363 & 30.6169 & 441.306 & 495.542 & 727.837 & -2984.97 & 14.1608 & & -27.0882 & -18.1224 \\
& -7140.58 & 0.09075 & 6.14E+10 & & 461520 & 22.1797 & 32.6729 & 418.557 & 493.104 & -2038.59 & -8148.21 & 13.8726 & & -27.3871 & -17.6842 \\
& -6765.1 & 0.09075 & 5.12E+10 & & 442200 & 22.8712 & 30.8062 & 469.99 & 489.318 & -3404.86 & -1965.15 & 13.9313 & & -27.7029 & -11.4003 \\
& -7278.84 & 0.0705322 & 4.88E+10 & & 387826 & 23.6452 & 29.7264 & 530.633 & 493.766 & 659.589 & -2082.03 & 14.7356 & & -26.4235 & -18.039 \\
& -9804.77 & 0.09075 & 3.16E+10 & & 594900 & 22.2526 & 30.373 & 506.952 & 499.083 & -6243.21 & -7264.67 & 14.0242 & & -25.9648 & -11.4003 \\
& -7258.63 & 0.0815248 & 5.80E+10 & & 506574 & 22.0017 & 38.3344 & 481.961 & 499.895 & -182.164 & -7375.24 & 14.1801 & & -26.8838 & -17.1526 \\
& -7752.47 & 0.09075 & 6.81E+10 & & 594960 & 23.3336 & 32.0357 & 448.093 & 497.64 & 121.125 & -6137.77 & 13.9758 & & -25.8605 & -19.5175 \\
& -6427.54 & 0.0901747 & 6.75E+10 & & 499020 & 24.788 & 39.219 & 550.8 & 497.778 & 197.675 & -6537.16 & 14.0494 & & -26.9742 & -18.3945 \\
& -8048.75 & 0.09075 & 7.70E+10 & & 345160 & 22.4005 & 31.9327 & 351.905 & 500.411 & -5356.76 & -5318.86 & 14.3997 & & -25.4607 & -18.3945 \\
& -6922.6 & 0.0897579 & 7.72E+10 & & 424932 & 21.4528 & 33.8182 & 440.397 & 494.772 & -670.487 & 239.404 & 13.8857 & & -25.2136 & -18.039 \\
& -7534.96 & 0.09075 & 5.81E+10 & & 510105 & 24.7605 & 34.6564 & 481.573 & 493.94 & -2080.9 & -6633.34 & 14.5802 & & -27.3547 & -11.4003 \\
& -6626.39 & 0.0840877 & 6.24E+10 & & 356637 & 26.2454 & 36.2963 & 508.941 & 499.447 & -1921.38 & -7225.03 & 14.007 & & -28.186 & -19.6828 \\
& -8739.22 & 0.0833573 & 6.99E+10 & & 546298 & 21.9408 & 33.581 & 543.216 & 491.856 & -1567.4 & -6976.34 & 13.9828 & & -28.2896 & -11.3613 \\
& -8818.69 & 0.0885963 & 3.97E+10 & & 438240 & 21.1752 & 36.2528 & 460.593 & 499.554 & 72.1365 & -6627.36 & 14.0521 & & -27.4075 & -11.4003 \\
& -7258.09 & 0.0861417 & 3.49E+10 & & 544831 & 25.094 & 30.5593 & 548.84 & 499.339 & -5073.7 & -8456.63 & 14.2453 & & -25.5684 & -19.8561 \\
& -8087.75 & 0.0903371 & 5.46E+10 & & 446157 & 22.9032 & 32.1424 & 421.646 & 492.63 & -3900.26 & 1353.84 & 13.7392 & & -26.6823 & -19.2993 \\
& -8482.43 & 0.090039 & 4.66E+10 & & 552581 & 22.3861 & 36.5625 & 457.61 & 499.245 & 1.35286 & -7844.48 & 13.7055 & & -28.0855 & -19.687 \\
& -6528.81 & 0.09075 & 6.70E+10 & & 498480 & 19.5627 & 34.625 & 464.465 & 492.466 & -6965.86 & -9712.34 & 14.1021 & & -26.9693 & -18.8073 \\
& -8463.27 & 0.09075 & 6.34E+10 & & 479280 & 24.0583 & 34.4645 & 608.036 & 473.426 & -7745.87 & -7636.44 & 14.4946 & & -26.258 & -12.3742 \\
& -8956.81 & 0.0893575 & 4.27E+10 & & 431907 & 23.3802 & 37.1508 & 605.869 & 486.893 & -6378.37 & -7262.28 & 13.9651 & & -27.4611 & -12.3742 \\
& -8443.14 & 0.09075 & 4.63E+10 & & 660240 & 23.5017 & 36.0516 & 503.756 & 478.32 & -1278.35 & -4455.43 & 13.9693 & & -27.2419 & -17.1526 \\
& -6843.66 & 0.0894151 & 7.43E+10 & & 481320 & 23.2531 & 29.9386 & 478.08 & 499.71 & -4075.12 & -5839.02 & 14.2467 & & -27.0834 & -9.98237 \\
\hline \\
Avg. & -7721.183 & 0.0885336 & 5.74E+10 & 4.95E+05 & 2.32E+01 & 3.43E+01 & 4.85E+02 & 4.95E+02 & -2.09E+03 & -5.50E+03 & -5.50E+03 & 1.41E+01 & -2.69E+01 & -2.69E+01 & -1.62E+01 \\
Med. & -7544.865 & 0.0902559 & 58031700000 & 502797 & 23.08 & 33.6996 & 475.496 & 495.7165 & -1197.75 & -6582.26 & -6582.26 & 14.0771 & -27.0858 & -27.0858 & -18.039 \\
Std. Dev. & 879.654776568 & 0.004344398 & 13715570303.9744 & 70598.3086040107 & 1.561052308 & 3.7073113996 & 61.9062241299 & 6.4821907987 & 2517.8253815732 & 3015.9014409368 & 3015.9014409368 & 0.2842525403 & 1.0005521456 & 1.0005521456 & 3.6031873219 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -2353.48 & 0.03025 & 1.88E+10 & 24168.4 & 59.988 & 6.39537 & 9.35607 & 117.932 & 155.879 & -145.889 & -1646.86 & 4.03982 & -0.302471 & -8.64558 & -11.5852 \\
& -2294.56 & 0.0278096 & 2.01E+10 & 23308.8 & 54.3803 & 7.99499 & 9.10285 & 166.587 & 155.557 & -479.37 & -2949.33 & 4.21134 & -0.408084 & -8.79464 & -8.1772 \\
& -2847.49 & 0.0296792 & 1.70E+10 & 32302.9 & 46.5895 & 7.22062 & 9.07374 & 161.811 & 148.705 & -56.1015 & -2988.2 & 3.99908 & -0.616554 & -8.82742 & -8.1772 \\
& -1682.61 & 0.0286486 & 1.90E+10 & 26081.4 & 61.7176 & 6.47021 & 10.7403 & 138.539 & 151.489 & -235.288 & -2321.48 & 4.49389 & -1.30566 & -8.4728 & -8.1772 \\
& -3163.22 & 0.03025 & 1.44E+10 & 15665.2 & 46.493 & 7.87339 & 11.6635 & 143.48 & 152.545 & -1197.31 & -3124.24 & 4.06124 & -1.18534 & -8.60302 & -8.1772 \\
& -1564.28 & 0.0292164 & 3.22E+10 & 9609.37 & 63.0245 & 6.84956 & 9.12636 & 77.5438 & 158.222 & -1306.25 & -2504.62 & 4.49975 & -0.577118 & -8.69359 & -8.1772 \\
& -3005.3 & 0.03025 & 2.60E+10 & 29121.3 & 42.5946 & 7.03493 & 11.0323 & 121.662 & 156.691 & -457.272 & -2495.34 & 4.48833 & -0.676501 & -8.81122 & -8.1772 \\
& -2196.03 & 0.03025 & 9.37E+09 & 24244.2 & 67.6498 & 6.47648 & 9.77288 & 118.753 & 156.684 & -78.0806 & -1123.95 & 4.65848 & -1.34652 & -8.80146 & -8.1772 \\
& -2451.6 & 0.0301868 & 1.89E+10 & 31828.8 & 54.9617 & 7.78021 & 9.1522 & 198.115 & 153.576 & -44.7555 & -1719.94 & 4.49672 & 0.0368576 & -8.82573 & -8.1772 \\
& -2649.5 & 0.03025 & 2.35E+10 & 24122.5 & 78.0887 & 7.02654 & 9.08477 & 145.058 & 146.57 & -359.588 & -2690.69 & 4.44189 & -0.600237 & -8.85059 & -8.1772 \\
& -1978.6 & 0.0302292 & 1.92E+10 & 26676.1 & 67.6724 & 6.72453 & 9.32724 & 184.502 & 154.944 & -978.036 & -2567.04 & 4.49746 & 0.352732 & -8.72541 & -8.1772 \\
& -2590.35 & 0.03025 & 1.86E+10 & 22140.2 & 67.8106 & 7.22723 & 9.27195 & 184.804 & 149.624 & 228.958 & -2156.38 & 4.63231 & 0.000805103 & -8.82982 & -19.2635 \\
& -2492.14 & 0.0302253 & 1.45E+10 & 23038.2 & 54.4243 & 6.35673 & 9.37548 & 64.1279 & 158.208 & -1552.16 & -2516.99 & 4.1252 & -0.977698 & -8.62522 & -8.1772 \\
& -3024.64 & 0.0302113 & 2.35E+10 & 21144 & 68.705 & 7.64069 & 15.3717 & 175.471 & 156.45 & -188.369 & -2261.48 & 4.50388 & -0.189495 & -8.82071 & -19.27 \\
& -2787.77 & 0.0299542 & 3.51E+10 & 30959.5 & 87.3445 & 7.258 & 9.17457 & 174.921 & 154.939 & -549.431 & -2337.16 & 4.51863 & -0.100004 & -8.71327 & -11.6076 \\
& -2412.16 & 0.03025 & 2.46E+10 & 10038.6 & 49.23 & 7.00135 & 9.18972 & 203.733 & 153.641 & -279.738 & -813.436 & 4.13809 & 0.0861884 & -8.70443 & -22.0364 \\
& -2156.47 & 0.03025 & 3.45E+09 & 7563.02 & 90.5625 & 6.32097 & 9.77328 & 161.579 & 153.295 & -83.3801 & -1182.55 & 4.45449 & -0.394575 & -8.82684 & -19.2635 \\
& -3044.69 & 0.03025 & 1.32E+10 & 18228.9 & 53.0633 & 6.98713 & 9.22125 & 139.567 & 151.861 & -101.129 & -2341.09 & 4.27863 & -0.295665 & -8.4791 & -20.3627 \\
& -2294.74 & 0.0128203 & 6.91E+09 & 13513 & 64.0312 & 8.51433 & 9.30183 & 142.512 & 156.996 & -1863.03 & -1398.12 & 4.49987 & -0.496323 & -8.84694 & -8.1772 \\
& -2946.18 & 0.0182463 & 4.41E+09 & 10620.3 & 76.5551 & 7.01442 & 9.13523 & 175.317 & 152.924 & 63.6296 & -2397.78 & 4.50181 & 0.0984758 & -8.7853 & -21.9278 \\
& -2412.71 & 0.03025 & 6.12E+09 & 21231.5 & 47.6436 & 6.37215 & 9.12583 & 152.503 & 151.491 & 662.344 & -2139.36 & 4.50024 & -0.769488 & -8.30502 & -8.1772 \\
& -2669.73 & 0.03025 & 2.28E+10 & 18635 & 46.5956 & 6.62651 & 9.1969 & 179.575 & 155.756 & -1622.23 & -2579.85 & 4.49683 & -0.639761 & -8.72133 & -19.1981 \\
& -2235.49 & 0.03025 & 1.40E+10 & 28141.5 & 72.5154 & 6.69095 & 9.79442 & 127.291 & 145.443 & -2020.13 & -1634.23 & 4.42869 & -1.00679 & -8.78072 & -19.2635 \\
& -2985.69 & 0.0300519 & 9.28E+09 & 37770.1 & 96.61 & 7.83742 & 14.026 & 184.708 & 146.4 & -590.179 & -2498.13 & 4.26544 & -0.0294331 & -8.87411 & -8.1772 \\
& -2353.88 & 0.03025 & 1.14E+10 & 38853.2 & 55.7939 & 7.34237 & 9.23642 & 155.955 & 156.938 & -298.932 & -2034.12 & 4.68428 & 0.020851 & -8.83159 & -21.9278 \\
& -1899.75 & 0.03025 & 3.03E+10 & 19359.5 & 64.5918 & 7.09233 & 10.284 & 99.3849 & 153.521 & -801.555 & -2416.07 & 4.08334 & -0.124733 & -8.71859 & -19.27 \\
& -1623.43 & 0.03025 & 1.17E+10 & 18194 & 72.4011 & 6.26496 & 9.88647 & 133.847 & 156.223 & -1354.62 & -2445.64 & 4.09028 & -1.742 & -8.69851 & -20.3627 \\
& -3222.55 & 0.03025 & 1.86E+10 & 33430.4 & 75.1929 & 6.67338 & 9.50346 & 219.224 & 156.195 & -894.692 & -1572.32 & 4.40705 & -0.587073 & -8.64298 & -8.1772 \\
& -3498.88 & 0.0256026 & 1.53E+10 & 23899.7 & 72.4134 & 6.26663 & 9.14707 & 169.249 & 154.033 & -1419.25 & -2628.3 & 4.49581 & -0.0643777 & -8.10856 & -8.1772 \\
& -3044.4 & 0.0301924 & 3.41E+10 & 11088.4 & 51.1488 & 6.8859 & 9.41934 & 103.838 & 155.568 & -2127.94 & -2428.83 & 4.49982 & -1.26039 & -8.74994 & -8.1772 \\
\hline \\
Avg. & -2529.4106666667 & 0.02890247 & 1.79E+10 & 2.25E+04 & 6.37E+01 & 7.01E+00 & 9.90E+00 & 1.51E+02 & 1.54E+02 & -6.71E+02 & -2.20E+03 & 4.38E+00 & -5.03E-01 & -8.70E+00 & -1.28E+01 \\
Med. & -2471.87 & 0.03025 & 18559750000 & 23173.5 & 63.52785 & 6.99424 & 9.314535 & 154.229 & 154.486 & -468.321 & -2369.435 & 4.49111 & -0.4522035 & -8.737675 & -8.1772 \\
Std. Dev. & 495.6619476322 & 0.0038284652 & 8448356883.66839 & 8305.8388465674 & 13.8542434661 & 0.5807405608 & 1.4575514207 & 36.4813660807 & 3.4660196682 & 719.7744604556 & 569.5535684889 & 0.1984223336 & 0.5169316097 & 0.17100592 & 5.8206220674 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -4549.4 & 0.0605 & 2.51E+10 & 83731.6 & 0.651206 & 14.7944 & 21.9681 & 279.695 & 321.001 & -1566.84 & -5338.46 & 9.21621 & -0.142619 & -17.715 & -11.8869 \\
& -6050.16 & 0.0605 & 4.55E+10 & 80745.8 & 0.268086 & 16.284 & 19.3337 & 343.725 & 313.969 & -1993.75 & -4148.75 & 9.46446 & -0.548652 & -18.1772 & -11.5925 \\
& -5398.23 & 0.0591995 & 5.06E+10 & 82401.3 & 0.032413 & 15.3526 & 23.9768 & 296.889 & 321.956 & -4633.19 & -4848.21 & 9.01646 & 0.218791 & -18.4282 & -11.5925 \\
& -5675.22 & 0.0605 & 4.42E+10 & 82591.3 & 0.00544314 & 14.7622 & 22.6234 & 331.276 & 323.228 & -4014.04 & -5436.05 & 9.26537 & 0.626347 & -18.2969 & -12.1455 \\
& -3976.37 & 0.0588747 & 3.25E+10 & 82036.8 & 0.0128344 & 13.9223 & 25.6647 & 325.015 & 329.982 & -1246.54 & -4823.87 & 9.12409 & -1.33997 & -17.3054 & -11.5925 \\
& -5082.38 & 0.0605 & 2.61E+10 & 87382.5 & 0.0201434 & 14.3422 & 21.3897 & 396.392 & 326.205 & -392.775 & -6280.62 & 9.13477 & -2.26781 & -18.1703 & -11.5925 \\
& -5891.86 & 0.0605 & 3.85E+10 & 89279.1 & 0.684922 & 15.2594 & 23.0754 & 329.302 & 326.381 & -337.14 & -3871.16 & 9.02972 & -0.0242582 & -18.4513 & -11.5925 \\
& -5003.93 & 0.0605 & 3.00E+10 & 85879 & 0.0151074 & 14.8268 & 19.9157 & 325.527 & 314.19 & -1212.15 & -4189.52 & 9.17302 & 0.0681864 & -18.2963 & -11.5925 \\
& -5418.57 & 0.0605 & 4.30E+10 & 82890.7 & 0.00544314 & 15.9129 & 20.2634 & 332.571 & 325.788 & -1548.21 & -5548.41 & 9.39065 & -0.906265 & -18.5396 & -11.5925 \\
& -5516.7 & 0.0599162 & 3.51E+10 & 82665.9 & 0.03008 & 16.1692 & 19.9074 & 388.651 & 327.169 & 923.714 & -563.104 & 9.20288 & -1.59829 & -18.1054 & -11.5925 \\
& -3937.92 & 0.0547374 & 3.35E+10 & 86354.3 & 0.0153078 & 15.3926 & 19.532 & 312.15 & 322.111 & -1598.94 & -4648.01 & 8.87789 & -1.49817 & -17.8506 & -11.5925 \\
& -4588.88 & 0.0605 & 3.51E+10 & 81101.4 & 0.00542657 & 15.7841 & 21.7808 & 357.263 & 330.684 & -1319.67 & -4261.9 & 9.33048 & -1.93719 & -18.2627 & -12.1791 \\
& -5082.97 & 0.0559769 & 2.42E+10 & 76218.4 & 0.00544314 & 15.1429 & 22.4065 & 346.209 & 324.783 & 1500.62 & -6032.9 & 9.18852 & -1.88437 & -18.2285 & -11.5925 \\
& -6070.01 & 0.0594556 & 3.21E+10 & 83486.2 & 0.0201913 & 14.966 & 19.342 & 393.145 & 324.682 & -404.273 & -5094.61 & 8.57302 & 0.126058 & -16.446 & -11.5925 \\
& -5043.31 & 0.0605 & 1.85E+10 & 82935.5 & 0.220955 & 14.0295 & 20.2134 & 316.233 & 325.996 & 2079.2 & -4572.43 & 9.70061 & -1.33897 & -18.2227 & -11.5925 \\
& -5161.34 & 0.0605 & 3.87E+10 & 85337.7 & 0.00541984 & 14.9478 & 19.5923 & 274.232 & 327.758 & -1727.17 & -4684.33 & 9.01989 & 0.290542 & -18.4796 & -12.1791 \\
& -4589.3 & 0.060484 & 3.08E+10 & 83765.5 & 0.01776 & 14.714 & 20.0449 & 314.196 & 325.896 & -1632.08 & -5179.06 & 8.52944 & -0.524841 & -18.3505 & -18.4163 \\
& -4332.6 & 0.0600202 & 6.77E+10 & 81498.7 & 0.0153003 & 16.5447 & 20.0096 & 314.165 & 307.423 & 1567.7 & -4461.73 & 9.43874 & -1.20997 & -18.3268 & -11.5925 \\
& -6267.41 & 0.0605 & 4.65E+10 & 81603.3 & 1.88596 & 16.1234 & 20.2482 & 316.52 & 317.494 & -5550.9 & -3693.39 & 9.4962 & 0.510028 & -18.1621 & -11.5925 \\
& -4588.98 & 0.0605 & 4.06E+10 & 85076.2 & 0.0225431 & 14.0527 & 20.8396 & 325.67 & 324.854 & -2326.43 & -5346.36 & 9.33666 & -1.32004 & -18.555 & -11.5925 \\
& -5477.69 & 0.0604347 & 5.13E+10 & 80799.5 & 0.00535823 & 14.7108 & 20.8015 & 261.241 & 319.17 & 485.619 & -4782.73 & 9.17792 & -1.22079 & -17.7232 & -18.1189 \\
& -6109.42 & 0.0472961 & 2.54E+10 & 83373.9 & 0.177322 & 15.6127 & 22.9987 & 286.368 & 321.812 & -2998.41 & -4456.01 & 8.6997 & -2.29998 & -18.4625 & -11.5925 \\
& -4885.09 & 0.0570039 & 4.39E+10 & 80163.4 & 0.255374 & 15.6927 & 23.8355 & 324.354 & 325.002 & -1578.78 & -4075.51 & 9.10547 & -0.131814 & -17.7901 & -11.5925 \\
& -4035.51 & 0.0600693 & 4.32E+10 & 81415.3 & 0.0152417 & 14.9575 & 19.5572 & 296.019 & 321.434 & 824.034 & -4011.91 & 9.31902 & -1.51993 & -17.8755 & -11.5924 \\
& -3917.22 & 0.0586818 & 4.16E+10 & 87878.4 & 0.0128369 & 14.4221 & 19.8007 & 375.301 & 300.768 & 1043.95 & -5037.25 & 9.57629 & -1.73324 & -18.2571 & -11.5925 \\
& -5754.04 & 0.0575467 & 2.76E+10 & 83622.3 & 0.272711 & 17.8043 & 20.3977 & 370.717 & 317.424 & -1133.68 & -4973.3 & 9.0252 & -1.10353 & -18.3087 & -11.5925 \\
& -4786.87 & 0.0605 & 5.54E+10 & 81190 & 0.0324796 & 14.4401 & 19.8204 & 358.965 & 296.103 & 692.475 & -4121.91 & 8.76355 & -0.860885 & -18.484 & -18.4163 \\
& -4510.47 & 0.0597792 & 3.24E+10 & 83530.5 & 4.0042 & 16.0272 & 20.4454 & 225.399 & 326.39 & -478.625 & -5370.33 & 9.32801 & -1.13941 & -18.4418 & -11.5729 \\
& -5398.26 & 0.0605 & 2.12E+10 & 85510.6 & 0.43707 & 14.8375 & 19.3774 & 332.986 & 327.903 & -985.672 & -316.499 & 8.94067 & 0.336942 & -17.9256 & -11.5925 \\
& -4253.69 & 0.0600716 & 3.11E+10 & 84551 & 0.0128391 & 15.5474 & 21.1043 & 361.928 & 322.473 & -2662.15 & -5159.38 & 7.88002 & -0.784451 & -18.5094 & -11.5924 \\
\hline \\
Avg. & -5045.1266666667 & 0.05921826 & 3.70E+10 & 8.33E+04 & 3.06E-01 & 1.52E+01 & 2.10E+01 & 3.27E+02 & 3.21E+02 & -1.07E+03 & -4.51E+03 & 9.11E+00 & -8.39E-01 & -1.81E+01 & -1.23E+01 \\
Med. & -5062.845 & 0.06045935 & 35130150000 & 83154.7 & 0.02016735 & 15.05445 & 20.33055 & 325.5985 & 323.955 & -1229.345 & -4733.53 & 9.17547 & -1.0048975 & -18.2599 & -11.5925 \\
Std. Dev. & 698.8094252189 & 0.0026900942 & 10975111347.1528 & 2619.8872400694 & 0.791604351 & 0.8539153929 & 1.6317417953 & 39.4394076324 & 8.0216805796 & 1808.4389363295 & 1268.809305736 & 0.3628603461 & 0.8562948838 & 0.4364346365 & 2.0376857083 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -9410.25 & 0.0833082 & 2.47E+10 & 320497 & & 21.2591 & 29.99 & 368.495 & 473.165 & -6278.62 & -8324.6 & 13.026 & & -28.105 & -19.687 \\
& -8976.5 & 0.0769728 & 2.89E+10 & 255960 & & 21.382 & 29.5846 & 390.77 & 473.46 & -6837.82 & -9171.82 & 13.5603 & & -28.2307 & -19.8561 \\
& -9489.96 & 0.0869344 & 3.07E+10 & 349495 & & 20.4102 & 29.7188 & 389.025 & 476.709 & -6935.81 & -9139.13 & 13.5408 & & -28.2876 & -19.687 \\
& -9074.77 & 0.0754036 & 2.83E+10 & 337920 & & 21.3585 & 29.459 & 330.204 & 459.783 & -7391.32 & -8408.34 & 12.9661 & & -28.411 & -19.687 \\
& -9568.94 & 0.0569313 & 3.10E+10 & 338600 & & 21.4582 & 29.6347 & 379.984 & 477.567 & -6970.99 & -9684.67 & 13.1975 & & -28.3428 & -19.8561 \\
& -9351.64 & -0.0490078 & 2.68E+10 & 345600 & & 20.7617 & 29.9363 & 7.87853 & 475.43 & -6241.29 & -9773.48 & 13.359 & & -28.1681 & -19.8561 \\
& -124.883 & 0.0683202 & 3.31E+10 & 277860 & & 20.4901 & 29.4315 & 374.832 & 472.378 & -7256.36 & -9653.19 & 13.1889 & & -28.1063 & -19.687 \\
& -9924.25 & 0.0791061 & 3.19E+10 & 372780 & & 20.9216 & 29.7907 & 373.748 & 455.648 & -6665.63 & 283.59 & 12.8196 & & -28.1588 & -19.8561 \\
& -9311.68 & 0.0746452 & 3.24E+10 & 334380 & & 21.3375 & 29.6274 & 372.786 & 472.562 & -6572.91 & -8859.86 & 13.3459 & & -28.316 & -19.8561 \\
& -9035.97 & 0.0662556 & 3.18E+10 & 349440 & & 20.4238 & 30.1293 & 352.798 & 478.836 & -7007.39 & -9049.74 & 13.4248 & & -28.2245 & -19.8561 \\
& -9864.99 & -0.0636759 & 3.03E+10 & 312060 & & 21.0197 & 29.4352 & 376.266 & 466.391 & -8396.7 & -9143.81 & 13.5041 & & -28.2922 & -19.8561 \\
& -8996.29 & 0.0789434 & 2.87E+10 & -1.66599 & & 20.6647 & 29.6205 & 358.251 & 479.544 & -8751 & -10268.6 & 13.2663 & & -28.1594 & -19.8561 \\
& -9391.2 & 0.0749528 & 2.68E+10 & 338160 & & 20.4382 & 29.777 & 345.008 & 458.006 & -5866.24 & -8878.84 & 13.203 & & -28.3379 & -19.8561 \\
& -9450.26 & 0.0845282 & 2.94E+10 & 368202 & & 20.5752 & 29.6886 & 368.195 & 474.65 & -8633.36 & 464.389 & 13.6934 & & -3.43673 & -19.8561 \\
& -9746.52 & 0.0751487 & 2.75E+10 & 357000 & & 21.1032 & 29.7037 & 351.542 & 467.12 & -7698.6 & -8541.65 & 13.0522 & & -28.3234 & -19.8561 \\
& -9865.04 & 0.0805431 & -1.00E+01 & 330432 & & 20.6857 & 29.5885 & -7.69393 & 473.355 & -6756.61 & -9540.85 & 13.5152 & & -28.2612 & -19.687 \\
& -9272.8 & 0.0795918 & 3.80E+10 & 286598 & & 20.6426 & 19.8658 & 371.765 & 486.552 & -6547.46 & -9854.97 & 13.5049 & & -28.1688 & -19.8561 \\
& -10062.5 & 0.0768222 & 3.74E+10 & 350160 & & 20.0135 & 29.7339 & 390.477 & 475.739 & -6719.72 & -9440.52 & 13.4156 & & -28.2127 & -19.8561 \\
& -9134.53 & 0.0711327 & 3.08E+10 & 360420 & & 20.3865 & 29.9421 & 378.888 & 462.393 & -8281.31 & -9663.62 & 12.4277 & & -28.2074 & -19.8561 \\
& -9390.69 & -0.0309291 & 3.97E+10 & 295997 & & 20.7647 & 30.6015 & 359.88 & 484.513 & -5065.59 & -9134.86 & 13.6274 & & -28.3904 & -19.8561 \\
& -9134.47 & 0.0804281 & 4.70E+10 & 334360 & & 20.6145 & 27.8698 & 381.484 & 474.708 & -4226.77 & -8811.44 & 13.4809 & & -28.0928 & -19.8561 \\
& -9568.88 & 0.0785976 & 3.02E+10 & 296580 & & 20.5503 & 29.785 & 398.854 & 455.846 & -7596.93 & -8997.45 & 13.5753 & & -28.1787 & -19.8561 \\
& -9272.85 & 0.0817261 & 2.52E+10 & 306300 & & 20.8571 & 29.6731 & 380.627 & 470.576 & -6667.08 & -9397.49 & 13.1267 & & -28.1215 & -19.6839 \\
& -9212.05 & 0.0702678 & 2.59E+10 & 335460 & & 20.1083 & 30.1306 & 381.129 & 463.962 & -8674.4 & -9315.6 & 12.7335 & & -28.2767 & -19.8561 \\
& -9726.64 & 0.0741334 & 3.79E+10 & 363524 & & 21.4061 & 29.8537 & 332.172 & 458.809 & -6933.42 & -9365.76 & 13.402 & & -28.2994 & -19.8561 \\
& -10457.2 & 0.081483 & 3.46E+10 & 313260 & & 21.4092 & 29.7197 & 333.342 & 476.861 & -8640.37 & -9338.14 & 13.5832 & & -28.3677 & -19.8561 \\
& -9173.48 & 0.0870585 & 3.42E+10 & 312000 & & 20.6161 & 29.6849 & 336 & 471.518 & -6486.48 & -9721.42 & 13.651 & & -28.1929 & -19.8561 \\
& -9133.36 & 0.0840459 & 3.16E+10 & 381645 & & 20.5456 & 30.4368 & 362.339 & 459.739 & -6593.12 & -9396.22 & 13.5676 & & -28.2393 & -19.8561 \\
& -9391.21 & 0.0797617 & 4.23E+10 & 346620 & & 20.5208 & 29.7877 & 368.834 & 477.598 & -6145.95 & -9651.49 & 13.1248 & & -28.3445 & -19.8561 \\
& -9568.74 & 0.074442 & 2.17E+10 & 311040 & & 18.9379 & 29.5349 & 355.219 & 475.06 & -8780 & -9200.77 & 13.5091 & & -28.3269 & -19.8561 \\
\hline \\
Avg. & -9136.0847666667 & 0.06459572 & 3.06E+10 & 3.19E+05 & 2.07E+01 & 2.94E+01 & 3.42E+02 & 4.71E+02 & 4.71E+02 & -7.05E+03 & -8.63E+03 & 1.33E+01 & -2.74E+01 & -2.74E+01 & -1.98E+01 \\
Med. & -9390.945 & 0.0768975 & 30729500000 & 334920 & 20.65365 & 29.71125 & 368.6645 & 473.26 & 473.26 & -6885.62 & -9258.185 & 13.4088 & -28.235 & -28.235 & -19.8561 \\
Std. Dev. & 1736.4971456685 & 0.0388817803 & 7961125157.97467 & 67087.9428677671 & 0.5231419506 & 1.8518270929 & 94.7625256457 & 8.3344717638 & 8.3344717638 & 1094.2052693977 & 2486.4963265932 & 0.3016843863 & 4.5304816776 & 4.5304816776 & 0.0690085236 \\
\hline \\
\end{tabular}
}
}
\small{Random Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 0.0028796196 & 0.0027256012 & 0.004216671 \\
Function 2 & 0.0037307739 & 0.0027096272 & 0.0042328835 \\
Function 3 & 0.0027823448 & 0.0035073757 & 0.003777504 \\
Function 4 & 0.0041363239 & 0.0041460991 & 0.0026381016 \\
Function 5 & 0.0037288666 & 0.003030777 & 0.0026414394 \\
Function 6 & 0.0037727356 & 0.0028493404 & 0.0026321411 \\
Function 7 & 0.0035896301 & 0.0027751923 & 0.0037312508 \\
Function 8 & 0.0035607815 & 0.0028815269 & 0.0037713051 \\
Function 9 & 0.0044622421 & 0.0026602745 & 0.0027508736 \\
Function 10 & 0.0040593147 & 0.0027322769 & 0.0027010441 \\
Function 11 & 0.0030579567 & 0.0026328564 & 0.0026137829 \\
Function 12 & 0.0029666424 & 0.0026972294 & 0.0026974678 \\
Function 13 & 0.0027945042 & 0.003254652 & 0.0025961399 \\
Function 14 & 0.0028162003 & 0.004308939 & 0.0026042461 \\
Function 15 & 0.0027165413 & 0.0028510094 & 0.0024940968 \\
\hline
\end{tabular}
}\\[0.5cm]
\small{Local Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 0.2714903355 & 0.3662781715 & 0.8037896156 \\
Function 2 & 0.0122189522 & 0.1061990261 & 0.0311796665 \\
Function 3 & 0.0036041737 & 0.0034754276 & 0.0039658546 \\
Function 4 & 0.0045986176 & 0.0037958622 & 0.0057651997 \\
Function 5 & 3.5046873093 & 107.3777658939 & 237.3515529633 \\
Function 6 & 0.0053646564 & 0.0071499348 & 0.0078163147 \\
Function 7 & 0.1593027115 & 0.1934890747 & 36.0658888817 \\
Function 8 & 0.0124971867 & 0.1606588364 & 0.0684037209 \\
Function 9 & 0.0049269199 & 0.0049231052 & 0.0069723129 \\
Function 10 & 0.0056340694 & 0.0120668411 & 0.0046567917 \\
Function 11 & 0.0049116611 & 0.1781361103 & 3.4641461372 \\
Function 12 & 0.0035014153 & 0.0031409264 & 0.0071520805 \\
Function 13 & 0.0022878647 & 0.0031747818 & 0.008487463 \\
Function 14 & 0.0166265965 & 0.1419093609 & 0.2867805958 \\
Function 15 & 0.0709223747 & 0.0597565174 & 0.1033499241 \\
\hline \\
\end{tabular}
} \\[0.5cm]
\small{Iterative Local Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 5.355587244 & 21.5247523785 & 47.5882720947 \\
Function 2 & 0.4999251366 & 1.151144743 & 2.4649145603 \\
Function 3 & 0.0042607784 & 0.0112228394 & 0.0144929886 \\
Function 4 & 0.0058951378 & 0.0114533901 & 0.0161828995 \\
Function 5 & 150.1059572697 & 2928.3961615563 & N/A \\
Function 6 & 0.0101454258 & 0.0255510807 & 0.0222308636 \\
Function 7 & 32.4964332581 & 41.5021996498 & 168.8056237698 \\
Function 8 & 0.3526818752 & 1.6770370007 & 3.8826031685 \\
Function 9 & 0.0110986233 & 0.0125215054 & 0.0229070187 \\
Function 10 & 0.0899729729 & 0.2644715309 & 0.7342042923 \\
Function 11 & 30.093629837 & 165.0208876133 & 384.6772966385 \\
Function 12 & 297.458874464 & 25.3617525101 & 21.2174470425 \\
Function 13 & 0.0197796822 & 0.0436241627 & 0.0463643074 \\
Function 14 & 1.5726833344 & 7.7616007328 & 9.7854065895 \\
Function 15 & 6.6486163139 & 23.9164574146 & 32.7224471569 \\
\hline \\
\end{tabular}
} \\[0.5cm]
\section{Previous Results}
\hskip+1.0cm\scalebox{0.7}{
\begin{tabular}{| l | l | l | l | l | l|}
\hline
Function & Dimensionality & Mean & Median & Deviation & Avg. Time \\ \hline
Schwefel's & 10 & 40.03647 & 0.0623 & 547.27404 & 3.1285 \\ \hline
& 20 & -273.92765 & 16.52 & 883.3137 & 2.942 \\ \hline
& 30 & -63.79153 & 255.3487 & 925.71758 & 3.132 \\ \hline
De Jong's & 10 & 3775.96667 & 3772 & 3116.12957 & 0.667 \\ \hline
& 20 & 3748.5 & 4105 & 2885.095608 & 0.132 \\ \hline
& 30 & 3429.8334 & 3429 & 2608.0073 & 0.0933 \\ \hline
Rosenbrock & 10 & 2093118197.7 & 951513386 & 2466626292.4 & 0.90 \\ \hline
& 20 & 2109933654.57 & 997811808.5 &2696811330.46 & 1.679 \\ \hline
& 30 & 1784558137.97 & 543961363 & 2372214627.61 & 2.98 \\ \hline
Rastrigin & 10 & 318.2 & 262.5 & 289.575003684 & 1.04 \\ \hline
& 20 & 202.2666667 & 111 & 232.951516834 & 1.98 \\ \hline
& 30 & 309.9 & 246 & 264.111829763 & 2.788 \\ \hline
Griegwangk & 10 & 27.326983 & 22.8316 & 19.94304775 & 1.32 \\ \hline
& 20 & 22.247975 & 18.4916 & 17.41881647 & 4.98 \\ \hline
& 30 & 25.04950833 & 24.1043 & 19.11108789 & 5.67 \\ \hline
Sine Envelope Sine Wave & 10 & -4.70534 &-4.6083 & 0.2380683 & 1.112 \\ \hline
& 20 & -9.805175 & -9.6732 & 0.3503130 & 2.223 \\ \hline
& 30 & -15.1282 & -15.0166 & 0.410964 & 4.121 \\ \hline
Stretched V Sine Wave & 10 & -5.85114 & -5.8511 & 4.5168102e-15 & 3.55 \\ \hline
& 20 & -12.3524 & -12.35 & 5.420172e-15 & 6.88 \\ \hline
& 30 & -18.8536 & -18.8537 & 3.61344822e-15 & 9.87 \\ \hline
Ackley's One & 10 & 187.917 & 184.0721 & 33.190007 & 3.1298 \\ \hline
& 20 & 389.45238 & 382.962 & 40.1378 & 4.6731 \\ \hline
& 30 & 593.39786 & 599.1116 & 64.28003 & 8.7728 \\ \hline
Ackley's Two & 10 & 217.1978 & 217.922 & 2.26465 & 3.055 \\ \hline
& 20 & 456.7024 & 459.70244 & 6.447889 & 7.001 \\ \hline
& 30 & 698.9139 & 700.1936 & 4.42437 & 8.4356 \\ \hline
Egg Holder & 10 & -374.3114 & -529.396 & 877.367109 & 1.998 \\ \hline
& 20 & -197.32204 & -339.2197 & 1196.0543 & 4.7621 \\ \hline
& 30 & -533.43484 & -507.8253 & 1366.0572 & 6.9981 \\ \hline
Rana & 10 & 126.682 & 92.4435 & 762.991158 & 5.1433 \\ \hline
& 20 & 44.632258 & 144.748 & 897.22947 & 9.4239 \\ \hline
& 30 & 147.21517 & 280.21517 & 1161.5825 & 14.221 \\ \hline
Pathological & 10 & 4.7605744 & 4.5666& 0.320334 & 3.1561 \\ \hline
& 20 & 10.02892 & 9.9324 & 0.485784 & 3.9714 \\ \hline
& 30 & 15.28425 & 15.1622 & 0.66075 & 4.9912 \\ \hline
Michalewicz & 10 & 0.904288 & 0.942 & 0.544008 & 1.3241 \\ \hline
& 20 & 1.73464 & 1.5955 & 0.733736 & 3.1149 \\ \hline
& 30 & 2.108609 & 1.9897 & 0.974908 & 4.8229 \\ \hline
Masters Cosine Wave & 10 &0.6488827 & 0.5623 & 2.0702 & 2.3341 \\ \hline
& 20 & -1.492407& -1.0483& 2.270724 & 3.4256 \\ \hline
& 30 & 0.885458 & 0.9459 & 3.441345 & 5.3243 \\ \hline
Shekel's Foxhole & 10 & -0.2105669 & -0.2023 & 0.038925 & 4.5623 \\ \hline
\end{tabular}
}
\end{document}

@ -0,0 +1,738 @@
\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{13.6pt}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{Central Washington University of the Computer Science Department} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge Project 2 \\
\horrule{2pt} \\[0.5cm]
}
\author{\normalsize Mitchell Hansen \\[-6pt]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\section{Introduction}
For this lab we took the 15 functions that we programmed in the previous
lab and ran them through 3 different optimization functions, each more
accurate than the previous. We have random search, which blindly tests
randomized solutions looking for an optimum. Secondly we have local search,
which takes an initial randomized solution and then attempts to optimize it
until it's at its minimum. Thirdly we have iterative local search, which
combines the two previous functions.
\section{Methods}
A significant portion of the code from the previous lab was rewritten to
allow the functions and search methods to be run from the command line.
Arguments specifying the dimensionality of the solution, id of the funtion,
id of the search method, and a seed are all handled by the program. Using
this backbone, we wrote a trivial python script that executes each search
method on all of the 15 functions being tested for each dimensionality.
There currently is an issue with runtimes being significant for a select
few functions on high dimensionalties. As a result some data points have
been omitted.
\section{Analysis}
There were various interesting results both in the new data, what the new
functions were able to find in terms of minimums, and how close some data
points got to the last lab where the search was purely random.
Comparing the new data from the Iterative Local Search (ILS) and the Local
Search (LS) with the previous results, we see that the purely naive method
that we used previously is actually quite sufficient for a few select functions,
namely: Sine Envelope Sine Wave, Pathological, Rosenbrok, and Ackleys
Two functions. Each of these functions evaluated to very similar solutions
in all three methods, naive, ILS and LS. Often being within 10\% of each other.
The differences between the two new methods used in this lab, ILS and LS
are mainly negligible in their cumulative accuracy. There are
some examples where the search methods differ more than others. Griegwangk
and Egg Holder differ the most between the two methods, with a 100 - 200 \%
difference seen between the methods. For single runs of the functions though,
ILS is superior to LS as can be seen in the graphics below for two seperate
runs of ILS on differing functions. The top line being the single run results,
and the bottom being the running best solution.
\scalebox{0.4}{\includegraphics{figure_1}}
\scalebox{0.4}{\includegraphics{figure_2}}
There were also a few problems with the expirementation, one being the fact that
we neglected the fact that the delta value within the LS and ILS functions could
throw the function outside of its specified bounds. The implimentation checked
each of these bounds each function call, but only returned 0 if it exceeded them.
Thus some results have errenous values of either 0 or some other integer value.
Another problem, as mentioned again in the conclusion, is the runtime of these
search methods. In particular, function 5 and 13 ran extremely slow. Slow enough
for the results having to be omitted as it would take longer to obtain the results
than we have time for the lab. We hope to speed up the implimentation prior to the
next lab and include those results then.
All testing was done on an i7-3630QM with 16GB ram using a single thread.
Complete results can be viewed in the sections below.
\section{Conclusion}
The search functions in this lab seem to behave much more accurately than the
random search in the previous lab. Not only are the new functions seemingly accurate,
but they also appear to repeat their values consistently giving the appearance that
they are coming up with a somewhat correct answer. Unfortunately, it seems where these
new functions fall down is in their performance. In the 30 dimension trials for this lab,
there were multiple functions where results had to be omitted because of running time issues.
Some taking up to multiple hours to run for their full permutation count. We hope to see
functions which take care of these issues in the upcoming labs.
\section{Results}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1223.19 & 13286 & 3.18E+09 & 24260 & 114.244 & 5.52567 & 18.2586 & 154.502 & 145.101 & -1714.21 & -1147.36 & 3.95561 & -1.64259 & -3.31459 & -19.1981 \\
& -1399.06 & 19906 & 1.96E+09 & 16700 & 90.6946 & 6.07905 & 20.4112 & 102.177 & 142.077 & -1648.81 & -1560.96 & 4.09041 & -1.39102 & -4.9016 & -19.1981 \\
& -1010.48 & 14917 & 6.76E+09 & 24520 & 51.8071 & 6.28399 & 21.7189 & 125.452 & 138.122 & -1661.62 & -1122.59 & 4.06708 & -1.34332 & -5.57971 & -19.1981 \\
& -1934.21 & 13942 & 4.96E+09 & 29540 & 122.229 & 5.67277 & 19.682 & 123.082 & 139.72 & -2343.48 & -1408.66 & 4.03919 & -1.86534 & -4.43512 & -19.1981 \\
& -794.372 & 14642 & 3.77E+09 & 19260 & 51.4992 & 5.64587 & 17.3606 & 130.231 & 146.019 & -1927.46 & -1392.74 & 4.02665 & -0.919067 & -2.9242 & -19.1981 \\
& -1431.49 & 10213 & 5.51E+09 & 15600 & 99.3078 & 6.37517 & 19.3915 & 106.105 & 147.534 & -1693.06 & -1590.86 & 3.81288 & -1.94752 & -4.41244 & -19.1981 \\
& -1222.58 & 14061 & 6.24E+09 & 27600 & 61.8407 & 5.95916 & 21.8219 & 134.971 & 138.811 & -1120.32 & -1274.41 & 3.90444 & -0.949296 & -5.21336 & -19.1981 \\
& -1659.45 & 14265 & 3.86E+09 & 12040 & 77.3118 & 6.59486 & 19.6264 & 107.374 & 137.152 & -2115.97 & -1151.79 & 3.9272 & -2.01492 & -4.14032 & -10.3861 \\
& -1495.15 & 16757 & 7.43E+09 & 29540 & 90.1975 & 5.82742 & 17.0893 & 118.252 & 133.507 & -1385.32 & -1145.69 & 4.03879 & -1.59431 & -4.89982 & -19.1981 \\
& -869.356 & 16426 & 4.32E+09 & 32060 & 34.4248 & 5.79818 & 19.4186 & 111.549 & 133.483 & -1677.77 & -859.394 & 4.00669 & -0.948425 & -5.22481 & -13.4604 \\
& -1039.51 & 18099 & 3.32E+09 & 34560 & 91.9329 & 6.26357 & 21.1327 & 114.807 & 140.81 & -1668.54 & -1128.23 & 4.07449 & -1.05552 & -3.01325 & -19.1981 \\
& -919.612 & 12176 & 6.94E+09 & 25180 & 90.0024 & 6.26924 & 16.2619 & 113.944 & 128.653 & -2016.45 & -873.684 & 4.06288 & -1.4206 & -4.45688 & -19.1981 \\
& -1506.41 & 14320 & 5.21E+08 & 31120 & 108.815 & 6.47541 & 18.8506 & 92.2691 & 142.909 & -2022.87 & -1605.81 & 4.00233 & -1.76635 & -2.84643 & -19.1981 \\
& -1418.55 & 20724 & 2.01E+09 & 26780 & 82.2471 & 6.03665 & 19.3898 & 106.227 & 133.068 & -2409.09 & -1688.21 & 4.16777 & -2.26334 & -4.32598 & -19.1981 \\
& -1011.89 & 18565 & 7.75E+09 & 23560 & 95.8855 & 6.32915 & 17.2525 & 114.955 & 133.399 & -3479.56 & -988.721 & 4.03036 & -1.32162 & -4.01327 & -19.1981 \\
& -1408.31 & 15157 & 5.16E+09 & 23300 & 85.4808 & 5.70288 & 18.6271 & 150.783 & 138.84 & -2023.31 & -1078.79 & 4.00918 & -1.95085 & -4.44009 & -19.1981 \\
& -748.024 & 23811 & 2.54E+09 & 18940 & 147.794 & 5.43586 & 20.034 & 137.888 & 138.61 & -2389.56 & -1342.49 & 3.70141 & -1.36667 & -4.68997 & -19.1981 \\
& -1638.56 & 18165 & 5.13E+08 & 15660 & 116.448 & 5.86329 & 18.6616 & 114.843 & 144.891 & -2692.09 & -1348.9 & 4.1051 & -2.70373 & -4.78687 & -19.1981 \\
& -840.918 & 20571 & 5.90E+09 & 29040 & 88.0594 & 6.07913 & 21.4554 & 108.89 & 148.508 & -1373.66 & -709.318 & 4.16242 & -1.27512 & -3.5624 & -19.1981 \\
& -918.388 & 19467 & 5.67E+09 & 18540 & 86.3758 & 5.50249 & 16.6631 & 117.034 & 138.953 & -1841.87 & -1118.65 & 4.05446 & -1.43019 & -4.92021 & -19.1981 \\
& -1914.4 & 14579 & 4.51E+09 & 35380 & 112.945 & 6.45106 & 17.4196 & 113.865 & 137.99 & -1295.97 & -1449.41 & 4.04415 & -1.21765 & -3.82571 & -19.1981 \\
& -1152.74 & 16613 & 8.29E+09 & 27140 & 93.3062 & 6.2383 & 18.8128 & 120.968 & 143.59 & -1384.85 & -1405.02 & 4.21014 & -0.963691 & -5.42752 & -13.344 \\
& -1484.78 & 18381 & 5.35E+09 & 36160 & 58.6201 & 6.30713 & 17.9042 & 130.23 & 135.182 & -1930.82 & -1426.85 & 4.00492 & -1.37802 & -4.93164 & -19.1981 \\
& -1049.66 & 8486 & 3.92E+09 & 19580 & 112.332 & 6.55806 & 19.9514 & 141.112 & 135.308 & -1799.74 & -884.562 & 4.23598 & -2.511 & -3.99085 & -13.4604 \\
& -1093.92 & 16661 & 6.44E+09 & 24500 & 92.3324 & 6.30898 & 20.232 & 121.163 & 130.104 & -1710.14 & -967.321 & 4.06013 & -2.29801 & -6.0234 & -19.1981 \\
& -1412.25 & 18188 & 5.81E+09 & 26880 & 109.978 & 5.70144 & 13.2134 & 90.171 & 134.353 & -1785.93 & -819.994 & 3.77693 & -1.0307 & -5.92079 & -19.1981 \\
& -1186.11 & 13189 & 3.77E+09 & 19320 & 106.128 & 6.27975 & 18.8899 & 136.097 & 146.582 & -1703.69 & -1298.35 & 3.73847 & -0.944601 & -3.52666 & -19.1981 \\
& -1356.38 & 18343 & 2.37E+09 & 13500 & 65.7106 & 5.97634 & 21.5128 & 115.854 & 140.762 & -2070.81 & -1319.27 & 4.18465 & -1.24715 & -5.7363 & -19.1981 \\
& -1528.85 & 17689 & 1.03E+10 & 18840 & 107.888 & 6.00707 & 15.2945 & 94.1472 & 144.7 & -3449.27 & -1375.83 & 4.14164 & -1.64993 & -3.02796 & -19.1981 \\
& -1063.76 & 15783 & 2.62E+09 & 32600 & 97.6585 & 6.46626 & 22.6138 & 123.843 & 131.62 & -1700.03 & -1291.51 & 4.01155 & -1.00427 & -4.24119 & -19.1981 \\
\hline \\
Avg. & -1257.7453333333 & 16246.0666666667 & 4.72E+09 & 2.44E+04 & 9.14E+01 & 6.07E+00 & 1.90E+01 & 1.19E+02 & 1.39E+02 & -1.93E+03 & -1.23E+03 & 4.02E+00 & -1.51E+00 & -4.43E+00 & -1.83E+01 \\
Med. & -1222.885 & 16519.5 & 4735540000 & 24510 & 92.13265 & 6.07909 & 19.13985 & 116.444 & 138.8255 & -1792.835 & -1282.96 & 4.03899 & -1.38452 & -4.437605 & -19.1981 \\
Std. Dev. & 315.9494375281 & 3243.999978032 & 2288019739.0926 & 6682.1279905999 & 24.08152579 & 0.3362814731 & 2.0863159585 & 15.7480637114 & 5.4144432384 & 542.1878355628 & 253.2605529849 & 0.1313044821 & 0.4955181247 & 0.901789508 & 2.3117761941 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1910.87 & 40054 & 1.87E+10 & 122800 & 316.532 & 13.3092 & 54.0294 & 272.443 & 302.424 & -4041.92 & -1817.15 & 8.84883 & -2.46942 & -5.56505 & -12.4756 \\
& -1696.99 & 45772 & 7.63E+09 & 147520 & 297.122 & 14.295 & 50.705 & 272.861 & 303.698 & -4286.27 & -2370.93 & 8.81079 & -1.86537 & -5.17117 & -14.6404 \\
& -3381.59 & 40944 & 1.07E+10 & 111960 & 261.007 & 14.2375 & 48.5996 & 293.562 & 312.574 & -2033.17 & -1370.09 & 7.86544 & -1.92465 & -5.47614 & -14.6404 \\
& -2309.24 & 43289 & 2.03E+10 & 114080 & 249.051 & 13.181 & 46.7492 & 254.37 & 312.802 & -2243.62 & -1637.31 & 8.75968 & -3.27363 & -7.05667 & -14.6404 \\
& -3308.55 & 45667 & 1.77E+10 & 98840 & 258.288 & 13.4705 & 48.7221 & 303.815 & 317.885 & -2736.5 & -1716.73 & 8.69769 & -2.13134 & -8.56678 & -14.6404 \\
& -1776.1 & 35152 & 1.97E+10 & 128360 & 282.098 & 14.0992 & 49.7351 & 295.107 & 293.715 & -3083.96 & -1337.39 & 8.904 & -2.72989 & -4.97279 & -14.6404 \\
& -2495.52 & 42321 & 1.55E+10 & 149040 & 314.038 & 12.2785 & 48.4086 & 311.61 & 312.538 & -2241.98 & -1953.24 & 8.84628 & -2.22338 & -5.40834 & -14.6404 \\
& -1753.65 & 54835 & 2.34E+10 & 144560 & 253.313 & 14.0274 & 52.4705 & 265.832 & 306.999 & -2809.58 & -1617.48 & 9.03187 & -2.36168 & -7.64268 & -14.6404 \\
& -1574.77 & 42698 & 1.66E+10 & 105920 & 253.962 & 13.7941 & 47.9362 & 205.073 & 314.335 & -3135.48 & -1120.02 & 8.97631 & -1.76927 & -7.50096 & -12.4756 \\
& -2206.58 & 47544 & 1.38E+10 & 92400 & 267.474 & 12.5201 & 50.5015 & 300.654 & 299.266 & -2352.88 & -1563.85 & 8.57557 & -1.90659 & -4.65802 & -14.6404 \\
& -2159.17 & 27230 & 1.29E+10 & 135280 & 252.351 & 13.261 & 45.9535 & 202.094 & 304.092 & -3073.25 & -2085.45 & 8.53621 & -1.87303 & -8.01815 & -14.6404 \\
& -2138.87 & 42123 & 1.63E+10 & 172680 & 271.911 & 13.2188 & 44.2571 & 238.99 & 310.573 & -2373.5 & -1490.61 & 8.82391 & -1.49354 & -5.60778 & -14.6404 \\
& -1491.32 & 41559 & 1.57E+10 & 120560 & 264.467 & 14.7017 & 49.9226 & 270.661 & 314.715 & -4606.54 & -1594.99 & 8.57499 & -2.34868 & -6.03643 & -12.4756 \\
& -1716.67 & 43371 & 1.96E+10 & 146160 & 256.312 & 13.2972 & 47.8418 & 296.121 & 299.162 & -2949.32 & -1714.88 & 8.94451 & -1.42826 & -7.75141 & -14.6404 \\
& -1353.62 & 30573 & 2.00E+10 & 160960 & 304.457 & 13.6341 & 44.8636 & 281.098 & 302.466 & -2253.05 & -1586.38 & 8.79012 & -3.8665 & -4.02897 & -14.6404 \\
& -1876.11 & 37188 & 1.04E+10 & 89680 & 268.29 & 12.9539 & 43.9137 & 251.274 & 294.581 & -3173.41 & -1092.65 & 8.51772 & -2.85364 & -4.28 & -14.6404 \\
& -1933.32 & 34504 & 2.32E+10 & 145600 & 255.038 & 14.1056 & 52.7792 & 271.035 & 300.68 & -3193.08 & -1565.67 & 8.89243 & -1.22167 & -6.49108 & -14.6404 \\
& -1778.81 & 32208 & 1.21E+10 & 164080 & 250.116 & 13.5012 & 48.5518 & 321.977 & 304.95 & -2310.76 & -1192.91 & 8.99516 & -2.24735 & -3.84925 & -14.6404 \\
& -1429.94 & 42230 & 1.93E+10 & 139160 & 279.049 & 14.2125 & 47.4455 & 275.462 & 308.209 & -2107.31 & -2552.48 & 8.58813 & -1.87343 & -8.05159 & -14.6404 \\
& -1987.26 & 40385 & 2.04E+10 & 151400 & 276.766 & 12.8164 & 53.0487 & 282.964 & 315.214 & -2678.56 & -2387 & 8.6457 & -3.03476 & -6.09081 & -14.6404 \\
& -1213.51 & 37332 & 1.51E+10 & 158560 & 261.681 & 13.675 & 47.6498 & 259.175 & 303.699 & -2531.58 & -1766.16 & 8.84001 & -2.59238 & -3.25015 & -12.4756 \\
& -1695.59 & 32437 & 1.90E+10 & 128640 & 275.131 & 13.0249 & 46.3462 & 248.083 & 306.287 & -2644.79 & -1901.53 & 8.95061 & -2.73942 & -4.03195 & -14.6404 \\
& -1844.9 & 40572 & 2.06E+10 & 166080 & 249.066 & 14.0993 & 44.662 & 267.558 & 302.1 & -2844.67 & -2131.51 & 9.07241 & -1.88671 & -4.71827 & -14.6404 \\
& -2039.62 & 48632 & 1.87E+10 & 138960 & 245.71 & 13.6312 & 38.0255 & 275.48 & 312.316 & -1829.93 & -2004.13 & 8.91483 & -1.52482 & -8.56454 & -14.6404 \\
& -1689.48 & 44937 & 1.61E+10 & 124600 & 282.54 & 13.3536 & 45.8805 & 290.598 & 305.559 & -2133.36 & -1566.78 & 8.72377 & -3.27145 & -6.96928 & -14.6404 \\
& -1633.96 & 51091 & 1.63E+10 & 117000 & 229.145 & 13.471 & 45.3704 & 307.327 & 311.438 & -1961.85 & -2460.35 & 8.80427 & -2.06181 & -7.33068 & -14.6404 \\
& -2439.89 & 45380 & 7.91E+09 & 140880 & 310.028 & 13.7849 & 39.4548 & 280.565 & 301.484 & -3402.53 & -2003.01 & 8.76709 & -2.71809 & -5.60029 & -14.6404 \\
& -2364.89 & 38298 & 1.23E+10 & 145760 & 238.505 & 14.0388 & 46.8051 & 290.425 & 309.168 & -2827.15 & -1049.02 & 8.70034 & -2.46217 & -7.9223 & -14.6404 \\
& -1855.61 & 47187 & 1.06E+10 & 137680 & 248.9 & 13.9612 & 48.5063 & 302.025 & 305.866 & -2152.73 & -1918.95 & 8.4452 & -2.47409 & -6.79521 & -12.4756 \\
& -1260.76 & 46347 & 1.16E+10 & 130600 & 281.027 & 13.9532 & 49.979 & 252.528 & 301.864 & -1840.58 & -1860.37 & 8.04923 & -2.63026 & -7.00734 & -14.6404 \\
\hline \\
Avg. & -1943.9053333333 & 41395.3333333333 & 1.61E+10 & 1.34E+05 & 2.68E+02 & 1.36E+01 & 4.76E+01 & 2.75E+02 & 3.06E+02 & -2.73E+03 & -1.75E+03 & 8.73E+00 & -2.31E+00 & -6.15E+00 & -1.43E+01 \\
Med. & -1850.255 & 42176.5 & 16269000000 & 138320 & 263.074 & 13.63265 & 47.889 & 275.471 & 305.7125 & -2661.675 & -1715.805 & 8.797195 & -2.298015 & -6.06362 & -14.6404 \\
Std. Dev. & 503.7270251575 & 6204.5677408321 & 4287970694.60419 & 21553.682353336 & 22.5100649673 & 0.5550063904 & 3.5839928835 & 28.0219424426 & 6.1634317364 & 693.8827057417 & 399.7555341973 & 0.2654236567 & 0.6045133055 & 1.5251158054 & 0.8205653224 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Random Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -2360.73 & 76232 & 3.56E+10 & 354540 & 429.015 & 21.1792 & 78.9986 & 444.386 & 468.28 & -3685.03 & -2174.65 & 13.6966 & -3.39811 & -7.7131 & -18.886 \\
& -2223.96 & 77130 & 2.33E+10 & 427440 & 482.271 & 21.4306 & 78.5455 & 477.565 & 481.841 & -3105.05 & -1719.81 & 13.3772 & -2.28782 & -5.96241 & -18.886 \\
& -2310.43 & 79924 & 2.53E+10 & 381060 & 438.418 & 22.4267 & 85.9081 & 431.309 & 476.297 & -2717.31 & -3512.41 & 13.4609 & -2.95267 & -9.47434 & -18.886 \\
& -1233.77 & 74245 & 3.11E+10 & 405060 & 500.971 & 20.6669 & 77.8205 & 460.647 & 478.937 & -3095.92 & -2547.58 & 13.8835 & -3.62638 & -9.1978 & -18.886 \\
& -1528.18 & 72335 & 3.46E+10 & 407400 & 480.637 & 21.006 & 85.0255 & 492.562 & 464.278 & -5541.45 & -2344.66 & 13.9109 & -2.60874 & -9.66453 & -13.3197 \\
& -1924.52 & 62337 & 2.96E+10 & 350940 & 400.405 & 21.2461 & 72.6017 & 482.764 & 483.487 & -3317.2 & -2334.39 & 13.194 & -2.35764 & -10.1073 & -18.886 \\
& -2423.33 & 65161 & 2.41E+10 & 257700 & 455.803 & 21.3956 & 79.6323 & 453.521 & 483.905 & -2929.27 & -3939.27 & 13.9277 & -2.81222 & -11.1674 & -18.886 \\
& -3297.71 & 56282 & 2.22E+10 & 333720 & 423.001 & 21.1405 & 72.1825 & 455.991 & 472.822 & -3685.92 & -2244.92 & 13.5072 & -3.4393 & -8.00828 & -13.3197 \\
& -2605.99 & 55514 & 2.99E+10 & 258960 & 432.783 & 20.5493 & 77.5907 & 487.188 & 468.534 & -2270.3 & -1770.48 & 13.8159 & -2.20179 & -7.3187 & -18.886 \\
& -2324.67 & 56507 & 3.57E+10 & 321720 & 497.616 & 21.1693 & 81.6804 & 548.596 & 472.64 & -4354.96 & -2232.69 & 13.4288 & -3.11785 & -9.96651 & -18.886 \\
& -3097.93 & 68919 & 3.54E+10 & 281160 & 311.272 & 21.3644 & 76.7997 & 473.195 & 482.708 & -3184.8 & -1491.68 & 13.6581 & -4.08066 & -11.396 & -18.886 \\
& -1810.75 & 74399 & 2.33E+10 & 325980 & 488.695 & 20.1705 & 79.5259 & 425.339 & 467.469 & -3514.4 & -2784.74 & 13.3882 & -2.20352 & -5.85588 & -13.3197 \\
& -2695.32 & 74130 & 2.86E+10 & 286740 & 445.725 & 21.7638 & 78.5654 & 443.915 & 465.322 & -3661.35 & -2224.44 & 13.7479 & -2.58372 & -8.03162 & -18.886 \\
& -1394.7 & 45078 & 4.43E+10 & 366540 & 392.949 & 19.8834 & 78.3782 & 443.771 & 474.73 & -2292.49 & -2073.16 & 13.8387 & -1.60751 & -8.19351 & -18.886 \\
& -2988.33 & 76470 & 3.30E+10 & 356040 & 403.55 & 22.1061 & 66.4539 & 479.545 & 474.343 & -5213 & -2393.19 & 13.621 & -1.97457 & -7.41504 & -18.886 \\
& -2107.9 & 64868 & 2.55E+10 & 335760 & 315.955 & 21.3366 & 76.1817 & 456.456 & 475.502 & -3594.52 & -1990.68 & 13.2762 & -1.95789 & -9.20082 & -18.886 \\
& -2979.51 & 66791 & 3.77E+10 & 300600 & 476.424 & 22.0409 & 79.8235 & 481.37 & 480.499 & -3226.79 & -2044.33 & 13.4292 & -3.30836 & -8.31641 & -18.886 \\
& -2513.73 & 63196 & 2.56E+10 & 378900 & 308.324 & 22.2978 & 73.8612 & 430.727 & 475.581 & -3321.28 & -2602.19 & 13.2479 & -3.04897 & -7.98816 & -18.886 \\
& -1622.69 & 62073 & 2.68E+10 & 370080 & 453.052 & 21.0996 & 80.359 & 480.134 & 477.041 & -3560.86 & -2227.66 & 13.4122 & -2.65343 & -9.57417 & -13.3197 \\
& -898.919 & 71119 & 3.36E+10 & 275400 & 394.268 & 21.1665 & 76.3499 & 475.151 & 482.187 & -3499.9 & -2010.88 & 13.8071 & -1.77653 & -6.50943 & -18.886 \\
& -2228.64 & 59344 & 2.66E+10 & 365520 & 446.585 & 21.9857 & 81.2511 & 473.327 & 469.027 & -4350.96 & -2530.21 & 13.1101 & -2.27438 & -6.5663 & -18.886 \\
& -2524.28 & 70564 & 2.93E+10 & 375960 & 467.46 & 20.6626 & 76.0828 & 458.589 & 473.993 & -3010.55 & -2107.52 & 13.5724 & -2.93552 & -3.36125 & -13.3197 \\
& -2141.75 & 69544 & 3.38E+10 & 275040 & 410.104 & 20.1186 & 72.5838 & 471.886 & 472.222 & -2617.06 & -2105.35 & 13.348 & -2.82033 & -5.74818 & -18.886 \\
& -2203.34 & 72793 & 3.62E+10 & 380220 & 406.591 & 22.0699 & 71.4693 & 407.417 & 484.37 & -2650.34 & -2240.99 & 13.9337 & -1.66277 & -8.93489 & -18.886 \\
& -1836.75 & 73045 & 3.98E+10 & 379800 & 514.007 & 22.242 & 79.9503 & 478.007 & 471.384 & -4044.69 & -2652.98 & 13.6287 & -2.44844 & -7.85381 & -18.886 \\
& -1787.41 & 50713 & 3.85E+10 & 296100 & 445.226 & 20.0734 & 76.9451 & 459.307 & 448.98 & -3725.34 & -1302.85 & 13.9199 & -2.28859 & -7.12064 & -18.886 \\
& -3185.05 & 70905 & 2.69E+10 & 374640 & 424.633 & 22.0167 & 74.4666 & 459.963 & 469.897 & -4000.25 & -2647.59 & 13.8378 & -3.37299 & -10.0858 & -18.886 \\
& -2551.98 & 57495 & 3.29E+10 & 370380 & 352.025 & 21.2376 & 81.8073 & 458.902 & 480.163 & -2257.61 & -2125.84 & 13.3929 & -1.83939 & -6.25541 & -18.886 \\
& -2406.77 & 78787 & 2.80E+10 & 403560 & 472.017 & 20.9728 & 79.011 & 416.437 & 481.494 & -2723.46 & -1653.13 & 13.5631 & -1.96041 & -5.54987 & -13.3197 \\
& -2783.41 & 66765 & 2.70E+10 & 322920 & 330.427 & 21.3975 & 80.8424 & 466.09 & 467.905 & -3393.49 & -2011.66 & 13.5916 & -2.33285 & -5.45623 & -18.886 \\
\hline \\
Avg. & -2266.4149666667 & 67088.8333333333 & 3.08E+10 & 3.44E+05 & 4.27E+02 & 2.13E+01 & 7.77E+01 & 4.62E+02 & 4.74E+02 & -3.42E+03 & -2.27E+03 & 1.36E+01 & -2.60E+00 & -7.93E+00 & -1.78E+01 \\
Med. & -2317.55 & 69231.5 & 29737350000 & 355290 & 435.6005 & 21.24185 & 78.46185 & 460.305 & 474.5365 & -3357.385 & -2226.05 & 13.582 & -2.51608 & -7.99822 & -18.886 \\
Std. Dev. & 584.4233609571 & 8739.8871218282 & 5587568894.7127 & 47357.674511872 & 57.409444418 & 0.6956118635 & 4.0959187591 & 26.9132515273 & 7.5943841166 & 775.2133686027 & 526.201488921 & 0.2412609758 & 0.6322303515 & 1.8774263418 & 2.2645829281 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -1722.16 & 0.03025 & 1.31E+10 & 5978.56 & 69.3764 & 7.53377 & 9.04847 & 181.426 & 151.893 & -754.573 & -2406.31 & 4.19767 & -2.05904 & -8.82787 & -8.1772 \\
& -2788.25 & 0.03025 & 1.59E+10 & 29804.2 & 69.0028 & 6.62654 & 9.08272 & 121.985 & 157.316 & 482.297 & -2056.85 & 4.27003 & -0.232247 & -8.81589 & -8.1772 \\
& -1839.66 & 0.03025 & 2.15E+10 & 17368.8 & 63.9238 & 7.28417 & 9.19482 & 170.218 & 140.056 & -1188.15 & -2643.43 & 4.22798 & 0.00103445 & -8.76307 & -8.1772 \\
& -3498.88 & 0.0300057 & 1.25E+10 & 20604.7 & 68.4473 & 5.87015 & 10.7235 & 109.273 & 156.978 & 765.691 & -2240.2 & 4.50026 & 0.0612122 & -8.79559 & -19.1981 \\
& -2373.7 & 0.03025 & 1.93E+10 & 13430.3 & 34.2408 & 7.98904 & 9.18401 & 130.203 & 151.598 & 357.187 & -2195.2 & 4.49177 & 0.843228 & -8.72636 & -19.2635 \\
& -2669.32 & 0.03025 & 1.38E+10 & 13495.7 & 60.3948 & 7.3257 & 9.63616 & 126.236 & 150.787 & -701.815 & -2689.55 & 4.52112 & -0.563567 & -8.62028 & -19.2635 \\
& -2412.63 & 0.0288532 & 1.22E+10 & 30023.6 & 74.2869 & 7.63259 & 9.07038 & 153.164 & 157.549 & -394.844 & -2613.69 & 4.45488 & 0.147295 & -8.74889 & -19.2635 \\
& -2452.59 & 0.03025 & 2.45E+10 & 22446.9 & 42.4768 & 6.59059 & 9.49866 & 167.659 & 153.588 & -2790.05 & -884.232 & 4.49433 & -1.58924 & -8.68392 & -22.0872 \\
& -2827.23 & 0.03025 & 6.57E+09 & 18043.7 & 64.0325 & 6.60687 & 9.40728 & 137.864 & 155.09 & 167.839 & -3035.03 & 4.10601 & 2.38E-05 & -8.77553 & -8.1772 \\
& -3577.85 & 0.0248398 & 1.74E+10 & 25988.4 & 74.2439 & 6.73684 & 9.28461 & 132.581 & 144.729 & -91.2695 & -1509.7 & 4.46538 & -1.92424 & -8.45917 & -11.5852 \\
& -1326.85 & 0.03025 & 2.68E+10 & 7867.05 & 70.423 & 7.52619 & 9.06149 & 111.908 & 154.855 & -117.596 & -2566.91 & 4.49956 & -0.783772 & -8.59181 & -8.1772 \\
& -3735.8 & 0.03025 & 1.80E+10 & 22752.2 & 50.6174 & 6.33447 & 9.1547 & 139.641 & 152.514 & -1316.55 & -2518 & 4.47642 & -0.0463014 & -8.75746 & -19.27 \\
& -2393.27 & 0.03025 & 1.14E+10 & 14274.5 & 40.5886 & 6.41117 & 10.6114 & 224.812 & 151.689 & -1288.83 & -2630.38 & 3.96854 & -1.52409 & -8.57556 & -8.1772 \\
& -2136.79 & 0.0251012 & 1.16E+10 & 13427.8 & 74.9665 & 6.62278 & 9.18783 & 124.629 & 154.597 & -1036 & -2279.34 & 4.08355 & -0.337027 & -8.83124 & -19.27 \\
& -2551.26 & 0.03025 & 2.09E+10 & 14787 & 71.8753 & 6.1052 & 10.2295 & 144.82 & 149.299 & -2255.52 & -2667.36 & 4.48691 & -0.522676 & -8.6941 & -19.27 \\
& -2610.58 & 0.0275071 & 2.19E+10 & 23744.9 & 51.3633 & 6.37208 & 9.21428 & 170.428 & 154.633 & 499.723 & -1960.24 & 4.49717 & -0.225219 & -8.82633 & -22.0364 \\
& -3301.42 & 0.03025 & 1.42E+10 & 17620.1 & 58.3238 & 6.90171 & 9.09557 & 109.074 & 155.68 & -413.377 & -2868.24 & 4.28546 & -0.609139 & -8.78285 & -22.0364 \\
& -2610.41 & 0.0293121 & 1.09E+10 & 27801.8 & 95.0175 & 6.93148 & 9.15471 & 167.973 & 150.033 & 689.394 & -2833.55 & 4.28827 & 0.0360106 & -8.26686 & -8.1772 \\
& -3183.07 & 0.0290287 & 1.69E+10 & 20238.5 & 60.3234 & 6.74264 & 9.67354 & 102.391 & 156.435 & -1058.05 & -2757.67 & 4.00982 & -0.78522 & -8.08889 & -8.1772 \\
& -2432.85 & 0.0301624 & 3.56E+10 & 22842.4 & 35.3722 & 6.46636 & 11.4128 & 170.701 & 148.289 & 1105.59 & -2210.27 & 4.77573 & -1.19427 & -8.509 & -21.9278 \\
& -2630.3 & 0.0278163 & 2.73E+10 & 25658.9 & 83.3985 & 6.10535 & 9.14037 & 121.269 & 154.065 & -958.512 & -2575.3 & 4.48104 & -1.21108 & -7.78537 & -11.6076 \\
& -2095.89 & 0.03025 & 9.81E+09 & 20270.9 & 40.2026 & 7.20097 & 9.0472 & 104.663 & 154.173 & -505.146 & -1771.42 & 4.11262 & -0.613923 & -8.83158 & -8.1772 \\
& -3301.53 & 0.0302264 & 1.35E+10 & 13708.2 & 62.5321 & 8.05472 & 11.0529 & 165.973 & 155.957 & -2069.58 & -2830.66 & 4.2232 & 0.124692 & -8.83616 & -19.2635 \\
& -2314.48 & 0.0296459 & 1.98E+10 & 21595.5 & 66.9216 & 5.32096 & 9.18803 & 119.401 & 156.968 & -728.852 & -3393.19 & 4.37753 & -1.01123 & -8.81274 & -11.6076 \\
& -3380.47 & 0.0302365 & 9.73E+09 & 26948.7 & 96.7156 & 7.25999 & 9.21712 & 187.299 & 153.919 & -213.715 & -2813.35 & 3.95788 & 0.110539 & -8.7079 & -8.1772 \\
& -3143.51 & 0.0199678 & 2.03E+10 & 11383 & 68.7048 & 6.28303 & 9.25189 & 188.644 & 157.746 & 110.405 & -1688.99 & 4.49839 & -1.74384 & -8.7247 & -8.1772 \\
& -2847.49 & 0.029854 & 1.84E+10 & 23915.5 & 72.8991 & 6.63326 & 9.38279 & 105.037 & 150.94 & 862.177 & -2078.53 & 4.58513 & -1.08988 & -8.61938 & -11.5852 \\
& -2926.46 & 0.03025 & 1.77E+10 & 21728.5 & 81.07 & 6.60333 & 9.31926 & 150.771 & 152.901 & -1333.47 & -2068.27 & 4.05192 & -0.656969 & -8.55918 & -21.9278 \\
& -2195.99 & 0.03025 & 2.26E+10 & 19417.8 & 76.3799 & 6.66027 & 9.09237 & 125.473 & 153.158 & -1148.96 & -2269.14 & 4.4759 & -1.44312 & -8.40539 & -8.1772 \\
& -2610.57 & 0.03025 & 1.95E+10 & 10095 & 51.5363 & 6.21274 & 9.11763 & 159.311 & 154.965 & -304.918 & -2250.28 & 4.4864 & 0.365686 & -8.75928 & -8.1772 \\
\hline \\
Avg. & -2663.042 & 0.02921857 & 1.75E+10 & 1.92E+04 & 6.43E+01 & 6.76E+00 & 9.49E+00 & 1.44E+02 & 1.53E+02 & -5.21E+02 & -2.38E+03 & 4.35E+00 & -6.16E-01 & -8.64E+00 & -1.39E+01 \\
Med. & -2610.575 & 0.03025 & 17541950000 & 20254.7 & 67.68445 & 6.6299 & 9.20455 & 138.7525 & 153.992 & -459.2615 & -2462.155 & 4.46013 & -0.586353 & -8.72553 & -11.5964 \\
Std. Dev. & 565.9521286104 & 0.0022586778 & 6227253551.6775 & 6364.105861632 & 15.8722794272 & 0.6200294914 & 0.6404997265 & 30.5973750771 & 3.8796949489 & 947.6193603132 & 502.5410994529 & 0.2088816019 & 0.7371789862 & 0.2404532 & 5.8867273045 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -5793.64 & 0.0605 & 2.54E+10 & 84243.8 & 0.00544314 & 15.7534 & 22.794 & 388.743 & 318.54 & 872.22 & -4878.35 & 9.29745 & -0.868549 & -17.4433 & -18.4163 \\
& -6425.36 & 0.0605 & 3.40E+10 & 83330.5 & 2.59579 & 15.18 & 19.4765 & 282.217 & 326.136 & -890.302 & -5205.81 & 9.19442 & -1.71722 & -18.36 & -18.1189 \\
& -5773.94 & 0.0605 & 5.03E+10 & 81685.7 & 0.0325362 & 14.6438 & 19.2967 & 414.614 & 325.683 & -38.8792 & -4808.13 & 8.96731 & -1.28757 & -18.4541 & -18.1189 \\
& -4312.14 & 0.0605 & 4.46E+10 & 84028.2 & 0.012734 & 14.8892 & 20.1529 & 248.993 & 329.517 & -49.3419 & -5762.01 & 8.95851 & -0.769716 & -18.3303 & -11.5925 \\
& -5201.29 & 0.0528605 & 2.90E+10 & 85961.1 & 0.0175917 & 14.6958 & 20.7801 & 295.784 & 326.719 & 131.108 & -4284.49 & 9.19177 & -0.978247 & -17.4535 & -11.5925 \\
& -5437.26 & 0.0484009 & 4.27E+10 & 81010.4 & 0.0128073 & 14.7319 & 20.2851 & 308.26 & 321.815 & -3179.98 & -5910.02 & 8.83616 & -1.10339 & -18.3132 & -12.1791 \\
& -5911.51 & 0.0605 & 4.18E+10 & 82890.4 & 0.0127846 & 15.3506 & 24.845 & 297.244 & 320.763 & 124.661 & 359.29 & 9.15435 & -0.821465 & -18.5011 & -11.5925 \\
& -5852.3 & 0.0605 & 3.89E+10 & 80465.7 & 0.50121 & 13.8042 & 24.586 & 358.358 & 328.323 & -1240.58 & -5701.28 & 9.48494 & -2.10437 & -17.7341 & -11.5925 \\
& -4549.95 & 0.0554514 & 2.43E+10 & 82872.7 & 0.0150484 & 14.0756 & 21.9814 & 378.772 & 320.122 & 866.459 & -4804.78 & 9.32682 & 0.177762 & -18.4128 & -11.5924 \\
& -5615.93 & 0.0594314 & 3.87E+10 & 85395.4 & 0.0177641 & 14.9938 & 21.737 & 348.39 & 330.393 & -40.7054 & -803.14 & 9.46576 & -0.757524 & -17.8996 & -12.1455 \\
& -6128.66 & 0.0599989 & 5.86E+09 & 82482.7 & 0.022684 & 15.7937 & 23.5337 & 318.578 & 313.61 & -1594.82 & -5561.16 & 9.47295 & -0.0502173 & -18.3411 & -12.1791 \\
& -5911.12 & 0.06046 & 3.82E+10 & 79597.1 & 0.00540948 & 14.6048 & 19.8786 & 343.956 & 316.997 & -1549.64 & -4889 & 9.12806 & 0.593797 & -17.5708 & -11.5925 \\
& -5378.96 & 0.0546049 & 3.55E+10 & 79844.9 & 0.513188 & 13.4111 & 20.819 & 237.504 & 323.974 & -236.878 & -2783.49 & 9.40669 & -1.5814 & -17.8182 & -11.5925 \\
& -6208.09 & 0.0605 & 4.11E+10 & 82806.8 & 0.0423564 & 13.6263 & 19.9244 & 338.475 & 330.509 & 145.801 & -5149.57 & 8.85904 & 0.0709934 & -17.7823 & -11.5925 \\
& -6365.98 & 0.0604318 & 3.95E+10 & 82980.4 & 0.00544314 & 14.5561 & 29.7907 & 373.119 & 316.579 & -3981.64 & -589.742 & 9.45594 & -0.734831 & -17.6115 & -12.1791 \\
& -4865.5 & 0.0605 & 2.70E+10 & 81023.3 & 0.022684 & 14.1321 & 19.6227 & 264.108 & 329.156 & -895.345 & -5298.19 & 9.31191 & -0.709717 & -17.9523 & -12.1791 \\
& -5753.31 & 0.0592495 & 5.53E+10 & 83182.6 & 0.0177641 & 14.3879 & 19.4463 & 326.461 & 329.266 & -736.031 & -36.6239 & 9.20092 & -1.01499 & -18.0679 & -11.5925 \\
& -4964.05 & 0.0495827 & 3.22E+10 & 86350.6 & 7.65341 & 14.4621 & 19.5375 & 354.537 & 329.072 & -98.6246 & -4398.36 & 9.44551 & -1.39255 & -18.4823 & -11.5925 \\
& -5161.97 & 0.0605 & 3.97E+10 & 79778.4 & 0.0244744 & 14.5572 & 22.6856 & 320.654 & 312.234 & -6486.32 & -4736.91 & 9.2983 & -1.06507 & -17.1146 & -11.5925 \\
& -5635.57 & 0.0605 & 4.11E+10 & 81383.2 & 0.0054374 & 14.5234 & 22.1856 & 287.145 & 323.708 & 562.055 & -5532.35 & 9.13131 & 0.712591 & -18.4878 & -12.1791 \\
& -5477.18 & 0.0605 & 2.88E+10 & 83253.2 & 0.012837 & 14.4646 & 20.9163 & 383.667 & 322.139 & -2281.67 & -4092.8 & 9.208 & -2.1219 & -18.2742 & -11.5925 \\
& -5240.77 & 0.0605 & 5.57E+10 & 82110.1 & 13.4906 & 15.0371 & 19.3914 & 205.418 & 324.571 & -3193.3 & -6020.24 & 8.90623 & -2.27157 & -16.7489 & -11.5924 \\
& -5635.19 & 0.0605 & 2.74E+10 & 84813.3 & 0.0447807 & 15.5438 & 19.7167 & 245.99 & 327.78 & -1235.47 & -3310.1 & 9.39152 & -1.5261 & -17.3734 & -11.5925 \\
& -3246.38 & 0.0605 & 3.80E+10 & 83219.6 & 0.00544314 & 14.7169 & 23.0755 & 303.558 & 313.476 & -1673.84 & -4972.31 & 8.87996 & 0.484031 & -18.4883 & -11.5925 \\
& -6168.66 & 0.0558529 & 4.47E+10 & 84716.8 & 2.94032 & 13.5461 & 19.8038 & 247.696 & 325.746 & -550.653 & -5601.88 & 9.47937 & -0.144748 & -17.0377 & -11.5925 \\
& -4213.77 & 0.0581465 & 3.19E+10 & 80103 & 0.00538645 & 16.5718 & 25.1075 & 282.189 & 323.021 & -137.129 & -5451.53 & 9.11948 & -1.01489 & -17.6702 & -11.5729 \\
& -3384.87 & 0.0595524 & 4.13E+10 & 82072.8 & 0.00541907 & 15.7239 & 19.2661 & 329.103 & 324.07 & -1101.79 & -4311.6 & 9.49093 & -0.162895 & -18.1284 & -11.5925 \\
& -5437.75 & 0.0590881 & 2.77E+10 & 87335.7 & 0.486232 & 13.3387 & 19.7886 & 289.14 & 323.126 & -2199.9 & -5897.58 & 9.47676 & 0.0210599 & -17.9211 & -18.4163 \\
& -4154.64 & 0.0605 & 3.50E+10 & 80441.7 & 0.0226616 & 15.9632 & 19.6977 & 323.442 & 319.648 & -2319.97 & -4943.11 & 9.3123 & -1.96752 & -16.6269 & -11.5925 \\
& -4727.06 & 0.0605 & 5.57E+10 & 83475 & 0.0300529 & 15.2459 & 20.5533 & 339.345 & 325.59 & 2361.6 & -3509.27 & 9.4069 & -2.61652 & -17.0723 & -11.5925 \\
\hline \\
Avg. & -5297.76 & 0.05870373 & 3.70E+10 & 8.28E+04 & 9.53E-01 & 1.47E+01 & 2.14E+01 & 3.15E+02 & 3.23E+02 & -1.02E+03 & -4.30E+03 & 9.24E+00 & -8.91E-01 & -1.78E+01 & -1.26E+01 \\
Med. & -5457.465 & 0.0605 & 38465350000 & 82881.55 & 0.02021285 & 14.6698 & 20.4192 & 319.616 & 324.022 & -813.1665 & -4883.675 & 9.297875 & -0.923398 & -17.91035 & -11.5925 \\
Std. Dev. & 817.3212483051 & 0.0033237366 & 10498474328.5921 & 2030.9259258268 & 2.8130712982 & 0.7900945894 & 2.3862355564 & 50.2442400537 & 5.1944841414 & 1705.6218308227 & 1790.4080474217 & 0.210871267 & 0.8822055188 & 0.5520760648 & 2.2743612411 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Local Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -8720.03 & 0.09075 & 6.14E+10 & & 468222 & 25.6736 & 29.4629 & 465.724 & 492.399 & -709.211 & -9489.6 & 14.5445 & & -23.8513 & -19.687 \\
& -6962.47 & 0.09075 & 8.45E+10 & & 544786 & 26.105 & 37.1947 & 476.184 & 495.891 & -2092.66 & -1548.36 & 14.1196 & & -27.6662 & -18.039 \\
& -6961.87 & 0.0899048 & 4.08E+10 & & 566160 & 22.9069 & 32.2468 & 572.709 & 495.119 & -724.496 & -1085.52 & 13.6181 & & -26.3649 & -9.98237 \\
& -7022.1 & 0.09075 & 4.80E+10 & & 507124 & 23.5184 & 32.8019 & 474.808 & 504.87 & 1441.2 & -298.734 & 14.6858 & & -27.5487 & -11.4003 \\
& -7554.77 & 0.09075 & 5.62E+10 & & 534480 & 21.3856 & 45.2881 & 407.728 & 499.809 & -1117.15 & -6155.89 & 14.1285 & & -28.0375 & -18.8073 \\
& -7930.32 & 0.0901661 & 3.89E+10 & & 507272 & 21.786 & 39.2269 & 585.973 & 489.683 & -559.234 & -6021.34 & 14.2482 & & -26.9184 & -17.1526 \\
& -7671.66 & 0.09075 & 6.33E+10 & & 544748 & 23.9949 & 39.7063 & 410.723 & 496.021 & -706.327 & -8420.73 & 14.4966 & & -27.7328 & -18.8073 \\
& -9153.89 & 0.0896031 & 5.37E+10 & & 527930 & 22.0799 & 31.5884 & 432.908 & 498.172 & -1000.39 & -7023.77 & 14.0189 & & -27.4268 & -19.6821 \\
& -7475.88 & 0.0825127 & 7.43E+10 & & 441660 & 24.9363 & 30.6169 & 441.306 & 495.542 & 727.837 & -2984.97 & 14.1608 & & -27.0882 & -18.1224 \\
& -7140.58 & 0.09075 & 6.14E+10 & & 461520 & 22.1797 & 32.6729 & 418.557 & 493.104 & -2038.59 & -8148.21 & 13.8726 & & -27.3871 & -17.6842 \\
& -6765.1 & 0.09075 & 5.12E+10 & & 442200 & 22.8712 & 30.8062 & 469.99 & 489.318 & -3404.86 & -1965.15 & 13.9313 & & -27.7029 & -11.4003 \\
& -7278.84 & 0.0705322 & 4.88E+10 & & 387826 & 23.6452 & 29.7264 & 530.633 & 493.766 & 659.589 & -2082.03 & 14.7356 & & -26.4235 & -18.039 \\
& -9804.77 & 0.09075 & 3.16E+10 & & 594900 & 22.2526 & 30.373 & 506.952 & 499.083 & -6243.21 & -7264.67 & 14.0242 & & -25.9648 & -11.4003 \\
& -7258.63 & 0.0815248 & 5.80E+10 & & 506574 & 22.0017 & 38.3344 & 481.961 & 499.895 & -182.164 & -7375.24 & 14.1801 & & -26.8838 & -17.1526 \\
& -7752.47 & 0.09075 & 6.81E+10 & & 594960 & 23.3336 & 32.0357 & 448.093 & 497.64 & 121.125 & -6137.77 & 13.9758 & & -25.8605 & -19.5175 \\
& -6427.54 & 0.0901747 & 6.75E+10 & & 499020 & 24.788 & 39.219 & 550.8 & 497.778 & 197.675 & -6537.16 & 14.0494 & & -26.9742 & -18.3945 \\
& -8048.75 & 0.09075 & 7.70E+10 & & 345160 & 22.4005 & 31.9327 & 351.905 & 500.411 & -5356.76 & -5318.86 & 14.3997 & & -25.4607 & -18.3945 \\
& -6922.6 & 0.0897579 & 7.72E+10 & & 424932 & 21.4528 & 33.8182 & 440.397 & 494.772 & -670.487 & 239.404 & 13.8857 & & -25.2136 & -18.039 \\
& -7534.96 & 0.09075 & 5.81E+10 & & 510105 & 24.7605 & 34.6564 & 481.573 & 493.94 & -2080.9 & -6633.34 & 14.5802 & & -27.3547 & -11.4003 \\
& -6626.39 & 0.0840877 & 6.24E+10 & & 356637 & 26.2454 & 36.2963 & 508.941 & 499.447 & -1921.38 & -7225.03 & 14.007 & & -28.186 & -19.6828 \\
& -8739.22 & 0.0833573 & 6.99E+10 & & 546298 & 21.9408 & 33.581 & 543.216 & 491.856 & -1567.4 & -6976.34 & 13.9828 & & -28.2896 & -11.3613 \\
& -8818.69 & 0.0885963 & 3.97E+10 & & 438240 & 21.1752 & 36.2528 & 460.593 & 499.554 & 72.1365 & -6627.36 & 14.0521 & & -27.4075 & -11.4003 \\
& -7258.09 & 0.0861417 & 3.49E+10 & & 544831 & 25.094 & 30.5593 & 548.84 & 499.339 & -5073.7 & -8456.63 & 14.2453 & & -25.5684 & -19.8561 \\
& -8087.75 & 0.0903371 & 5.46E+10 & & 446157 & 22.9032 & 32.1424 & 421.646 & 492.63 & -3900.26 & 1353.84 & 13.7392 & & -26.6823 & -19.2993 \\
& -8482.43 & 0.090039 & 4.66E+10 & & 552581 & 22.3861 & 36.5625 & 457.61 & 499.245 & 1.35286 & -7844.48 & 13.7055 & & -28.0855 & -19.687 \\
& -6528.81 & 0.09075 & 6.70E+10 & & 498480 & 19.5627 & 34.625 & 464.465 & 492.466 & -6965.86 & -9712.34 & 14.1021 & & -26.9693 & -18.8073 \\
& -8463.27 & 0.09075 & 6.34E+10 & & 479280 & 24.0583 & 34.4645 & 608.036 & 473.426 & -7745.87 & -7636.44 & 14.4946 & & -26.258 & -12.3742 \\
& -8956.81 & 0.0893575 & 4.27E+10 & & 431907 & 23.3802 & 37.1508 & 605.869 & 486.893 & -6378.37 & -7262.28 & 13.9651 & & -27.4611 & -12.3742 \\
& -8443.14 & 0.09075 & 4.63E+10 & & 660240 & 23.5017 & 36.0516 & 503.756 & 478.32 & -1278.35 & -4455.43 & 13.9693 & & -27.2419 & -17.1526 \\
& -6843.66 & 0.0894151 & 7.43E+10 & & 481320 & 23.2531 & 29.9386 & 478.08 & 499.71 & -4075.12 & -5839.02 & 14.2467 & & -27.0834 & -9.98237 \\
\hline \\
Avg. & -7721.183 & 0.0885336 & 5.74E+10 & 4.95E+05 & 2.32E+01 & 3.43E+01 & 4.85E+02 & 4.95E+02 & -2.09E+03 & -5.50E+03 & -5.50E+03 & 1.41E+01 & -2.69E+01 & -2.69E+01 & -1.62E+01 \\
Med. & -7544.865 & 0.0902559 & 58031700000 & 502797 & 23.08 & 33.6996 & 475.496 & 495.7165 & -1197.75 & -6582.26 & -6582.26 & 14.0771 & -27.0858 & -27.0858 & -18.039 \\
Std. Dev. & 879.654776568 & 0.004344398 & 13715570303.9744 & 70598.3086040107 & 1.561052308 & 3.7073113996 & 61.9062241299 & 6.4821907987 & 2517.8253815732 & 3015.9014409368 & 3015.9014409368 & 0.2842525403 & 1.0005521456 & 1.0005521456 & 3.6031873219 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 10 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -2353.48 & 0.03025 & 1.88E+10 & 24168.4 & 59.988 & 6.39537 & 9.35607 & 117.932 & 155.879 & -145.889 & -1646.86 & 4.03982 & -0.302471 & -8.64558 & -11.5852 \\
& -2294.56 & 0.0278096 & 2.01E+10 & 23308.8 & 54.3803 & 7.99499 & 9.10285 & 166.587 & 155.557 & -479.37 & -2949.33 & 4.21134 & -0.408084 & -8.79464 & -8.1772 \\
& -2847.49 & 0.0296792 & 1.70E+10 & 32302.9 & 46.5895 & 7.22062 & 9.07374 & 161.811 & 148.705 & -56.1015 & -2988.2 & 3.99908 & -0.616554 & -8.82742 & -8.1772 \\
& -1682.61 & 0.0286486 & 1.90E+10 & 26081.4 & 61.7176 & 6.47021 & 10.7403 & 138.539 & 151.489 & -235.288 & -2321.48 & 4.49389 & -1.30566 & -8.4728 & -8.1772 \\
& -3163.22 & 0.03025 & 1.44E+10 & 15665.2 & 46.493 & 7.87339 & 11.6635 & 143.48 & 152.545 & -1197.31 & -3124.24 & 4.06124 & -1.18534 & -8.60302 & -8.1772 \\
& -1564.28 & 0.0292164 & 3.22E+10 & 9609.37 & 63.0245 & 6.84956 & 9.12636 & 77.5438 & 158.222 & -1306.25 & -2504.62 & 4.49975 & -0.577118 & -8.69359 & -8.1772 \\
& -3005.3 & 0.03025 & 2.60E+10 & 29121.3 & 42.5946 & 7.03493 & 11.0323 & 121.662 & 156.691 & -457.272 & -2495.34 & 4.48833 & -0.676501 & -8.81122 & -8.1772 \\
& -2196.03 & 0.03025 & 9.37E+09 & 24244.2 & 67.6498 & 6.47648 & 9.77288 & 118.753 & 156.684 & -78.0806 & -1123.95 & 4.65848 & -1.34652 & -8.80146 & -8.1772 \\
& -2451.6 & 0.0301868 & 1.89E+10 & 31828.8 & 54.9617 & 7.78021 & 9.1522 & 198.115 & 153.576 & -44.7555 & -1719.94 & 4.49672 & 0.0368576 & -8.82573 & -8.1772 \\
& -2649.5 & 0.03025 & 2.35E+10 & 24122.5 & 78.0887 & 7.02654 & 9.08477 & 145.058 & 146.57 & -359.588 & -2690.69 & 4.44189 & -0.600237 & -8.85059 & -8.1772 \\
& -1978.6 & 0.0302292 & 1.92E+10 & 26676.1 & 67.6724 & 6.72453 & 9.32724 & 184.502 & 154.944 & -978.036 & -2567.04 & 4.49746 & 0.352732 & -8.72541 & -8.1772 \\
& -2590.35 & 0.03025 & 1.86E+10 & 22140.2 & 67.8106 & 7.22723 & 9.27195 & 184.804 & 149.624 & 228.958 & -2156.38 & 4.63231 & 0.000805103 & -8.82982 & -19.2635 \\
& -2492.14 & 0.0302253 & 1.45E+10 & 23038.2 & 54.4243 & 6.35673 & 9.37548 & 64.1279 & 158.208 & -1552.16 & -2516.99 & 4.1252 & -0.977698 & -8.62522 & -8.1772 \\
& -3024.64 & 0.0302113 & 2.35E+10 & 21144 & 68.705 & 7.64069 & 15.3717 & 175.471 & 156.45 & -188.369 & -2261.48 & 4.50388 & -0.189495 & -8.82071 & -19.27 \\
& -2787.77 & 0.0299542 & 3.51E+10 & 30959.5 & 87.3445 & 7.258 & 9.17457 & 174.921 & 154.939 & -549.431 & -2337.16 & 4.51863 & -0.100004 & -8.71327 & -11.6076 \\
& -2412.16 & 0.03025 & 2.46E+10 & 10038.6 & 49.23 & 7.00135 & 9.18972 & 203.733 & 153.641 & -279.738 & -813.436 & 4.13809 & 0.0861884 & -8.70443 & -22.0364 \\
& -2156.47 & 0.03025 & 3.45E+09 & 7563.02 & 90.5625 & 6.32097 & 9.77328 & 161.579 & 153.295 & -83.3801 & -1182.55 & 4.45449 & -0.394575 & -8.82684 & -19.2635 \\
& -3044.69 & 0.03025 & 1.32E+10 & 18228.9 & 53.0633 & 6.98713 & 9.22125 & 139.567 & 151.861 & -101.129 & -2341.09 & 4.27863 & -0.295665 & -8.4791 & -20.3627 \\
& -2294.74 & 0.0128203 & 6.91E+09 & 13513 & 64.0312 & 8.51433 & 9.30183 & 142.512 & 156.996 & -1863.03 & -1398.12 & 4.49987 & -0.496323 & -8.84694 & -8.1772 \\
& -2946.18 & 0.0182463 & 4.41E+09 & 10620.3 & 76.5551 & 7.01442 & 9.13523 & 175.317 & 152.924 & 63.6296 & -2397.78 & 4.50181 & 0.0984758 & -8.7853 & -21.9278 \\
& -2412.71 & 0.03025 & 6.12E+09 & 21231.5 & 47.6436 & 6.37215 & 9.12583 & 152.503 & 151.491 & 662.344 & -2139.36 & 4.50024 & -0.769488 & -8.30502 & -8.1772 \\
& -2669.73 & 0.03025 & 2.28E+10 & 18635 & 46.5956 & 6.62651 & 9.1969 & 179.575 & 155.756 & -1622.23 & -2579.85 & 4.49683 & -0.639761 & -8.72133 & -19.1981 \\
& -2235.49 & 0.03025 & 1.40E+10 & 28141.5 & 72.5154 & 6.69095 & 9.79442 & 127.291 & 145.443 & -2020.13 & -1634.23 & 4.42869 & -1.00679 & -8.78072 & -19.2635 \\
& -2985.69 & 0.0300519 & 9.28E+09 & 37770.1 & 96.61 & 7.83742 & 14.026 & 184.708 & 146.4 & -590.179 & -2498.13 & 4.26544 & -0.0294331 & -8.87411 & -8.1772 \\
& -2353.88 & 0.03025 & 1.14E+10 & 38853.2 & 55.7939 & 7.34237 & 9.23642 & 155.955 & 156.938 & -298.932 & -2034.12 & 4.68428 & 0.020851 & -8.83159 & -21.9278 \\
& -1899.75 & 0.03025 & 3.03E+10 & 19359.5 & 64.5918 & 7.09233 & 10.284 & 99.3849 & 153.521 & -801.555 & -2416.07 & 4.08334 & -0.124733 & -8.71859 & -19.27 \\
& -1623.43 & 0.03025 & 1.17E+10 & 18194 & 72.4011 & 6.26496 & 9.88647 & 133.847 & 156.223 & -1354.62 & -2445.64 & 4.09028 & -1.742 & -8.69851 & -20.3627 \\
& -3222.55 & 0.03025 & 1.86E+10 & 33430.4 & 75.1929 & 6.67338 & 9.50346 & 219.224 & 156.195 & -894.692 & -1572.32 & 4.40705 & -0.587073 & -8.64298 & -8.1772 \\
& -3498.88 & 0.0256026 & 1.53E+10 & 23899.7 & 72.4134 & 6.26663 & 9.14707 & 169.249 & 154.033 & -1419.25 & -2628.3 & 4.49581 & -0.0643777 & -8.10856 & -8.1772 \\
& -3044.4 & 0.0301924 & 3.41E+10 & 11088.4 & 51.1488 & 6.8859 & 9.41934 & 103.838 & 155.568 & -2127.94 & -2428.83 & 4.49982 & -1.26039 & -8.74994 & -8.1772 \\
\hline \\
Avg. & -2529.4106666667 & 0.02890247 & 1.79E+10 & 2.25E+04 & 6.37E+01 & 7.01E+00 & 9.90E+00 & 1.51E+02 & 1.54E+02 & -6.71E+02 & -2.20E+03 & 4.38E+00 & -5.03E-01 & -8.70E+00 & -1.28E+01 \\
Med. & -2471.87 & 0.03025 & 18559750000 & 23173.5 & 63.52785 & 6.99424 & 9.314535 & 154.229 & 154.486 & -468.321 & -2369.435 & 4.49111 & -0.4522035 & -8.737675 & -8.1772 \\
Std. Dev. & 495.6619476322 & 0.0038284652 & 8448356883.66839 & 8305.8388465674 & 13.8542434661 & 0.5807405608 & 1.4575514207 & 36.4813660807 & 3.4660196682 & 719.7744604556 & 569.5535684889 & 0.1984223336 & 0.5169316097 & 0.17100592 & 5.8206220674 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -4549.4 & 0.0605 & 2.51E+10 & 83731.6 & 0.651206 & 14.7944 & 21.9681 & 279.695 & 321.001 & -1566.84 & -5338.46 & 9.21621 & -0.142619 & -17.715 & -11.8869 \\
& -6050.16 & 0.0605 & 4.55E+10 & 80745.8 & 0.268086 & 16.284 & 19.3337 & 343.725 & 313.969 & -1993.75 & -4148.75 & 9.46446 & -0.548652 & -18.1772 & -11.5925 \\
& -5398.23 & 0.0591995 & 5.06E+10 & 82401.3 & 0.032413 & 15.3526 & 23.9768 & 296.889 & 321.956 & -4633.19 & -4848.21 & 9.01646 & 0.218791 & -18.4282 & -11.5925 \\
& -5675.22 & 0.0605 & 4.42E+10 & 82591.3 & 0.00544314 & 14.7622 & 22.6234 & 331.276 & 323.228 & -4014.04 & -5436.05 & 9.26537 & 0.626347 & -18.2969 & -12.1455 \\
& -3976.37 & 0.0588747 & 3.25E+10 & 82036.8 & 0.0128344 & 13.9223 & 25.6647 & 325.015 & 329.982 & -1246.54 & -4823.87 & 9.12409 & -1.33997 & -17.3054 & -11.5925 \\
& -5082.38 & 0.0605 & 2.61E+10 & 87382.5 & 0.0201434 & 14.3422 & 21.3897 & 396.392 & 326.205 & -392.775 & -6280.62 & 9.13477 & -2.26781 & -18.1703 & -11.5925 \\
& -5891.86 & 0.0605 & 3.85E+10 & 89279.1 & 0.684922 & 15.2594 & 23.0754 & 329.302 & 326.381 & -337.14 & -3871.16 & 9.02972 & -0.0242582 & -18.4513 & -11.5925 \\
& -5003.93 & 0.0605 & 3.00E+10 & 85879 & 0.0151074 & 14.8268 & 19.9157 & 325.527 & 314.19 & -1212.15 & -4189.52 & 9.17302 & 0.0681864 & -18.2963 & -11.5925 \\
& -5418.57 & 0.0605 & 4.30E+10 & 82890.7 & 0.00544314 & 15.9129 & 20.2634 & 332.571 & 325.788 & -1548.21 & -5548.41 & 9.39065 & -0.906265 & -18.5396 & -11.5925 \\
& -5516.7 & 0.0599162 & 3.51E+10 & 82665.9 & 0.03008 & 16.1692 & 19.9074 & 388.651 & 327.169 & 923.714 & -563.104 & 9.20288 & -1.59829 & -18.1054 & -11.5925 \\
& -3937.92 & 0.0547374 & 3.35E+10 & 86354.3 & 0.0153078 & 15.3926 & 19.532 & 312.15 & 322.111 & -1598.94 & -4648.01 & 8.87789 & -1.49817 & -17.8506 & -11.5925 \\
& -4588.88 & 0.0605 & 3.51E+10 & 81101.4 & 0.00542657 & 15.7841 & 21.7808 & 357.263 & 330.684 & -1319.67 & -4261.9 & 9.33048 & -1.93719 & -18.2627 & -12.1791 \\
& -5082.97 & 0.0559769 & 2.42E+10 & 76218.4 & 0.00544314 & 15.1429 & 22.4065 & 346.209 & 324.783 & 1500.62 & -6032.9 & 9.18852 & -1.88437 & -18.2285 & -11.5925 \\
& -6070.01 & 0.0594556 & 3.21E+10 & 83486.2 & 0.0201913 & 14.966 & 19.342 & 393.145 & 324.682 & -404.273 & -5094.61 & 8.57302 & 0.126058 & -16.446 & -11.5925 \\
& -5043.31 & 0.0605 & 1.85E+10 & 82935.5 & 0.220955 & 14.0295 & 20.2134 & 316.233 & 325.996 & 2079.2 & -4572.43 & 9.70061 & -1.33897 & -18.2227 & -11.5925 \\
& -5161.34 & 0.0605 & 3.87E+10 & 85337.7 & 0.00541984 & 14.9478 & 19.5923 & 274.232 & 327.758 & -1727.17 & -4684.33 & 9.01989 & 0.290542 & -18.4796 & -12.1791 \\
& -4589.3 & 0.060484 & 3.08E+10 & 83765.5 & 0.01776 & 14.714 & 20.0449 & 314.196 & 325.896 & -1632.08 & -5179.06 & 8.52944 & -0.524841 & -18.3505 & -18.4163 \\
& -4332.6 & 0.0600202 & 6.77E+10 & 81498.7 & 0.0153003 & 16.5447 & 20.0096 & 314.165 & 307.423 & 1567.7 & -4461.73 & 9.43874 & -1.20997 & -18.3268 & -11.5925 \\
& -6267.41 & 0.0605 & 4.65E+10 & 81603.3 & 1.88596 & 16.1234 & 20.2482 & 316.52 & 317.494 & -5550.9 & -3693.39 & 9.4962 & 0.510028 & -18.1621 & -11.5925 \\
& -4588.98 & 0.0605 & 4.06E+10 & 85076.2 & 0.0225431 & 14.0527 & 20.8396 & 325.67 & 324.854 & -2326.43 & -5346.36 & 9.33666 & -1.32004 & -18.555 & -11.5925 \\
& -5477.69 & 0.0604347 & 5.13E+10 & 80799.5 & 0.00535823 & 14.7108 & 20.8015 & 261.241 & 319.17 & 485.619 & -4782.73 & 9.17792 & -1.22079 & -17.7232 & -18.1189 \\
& -6109.42 & 0.0472961 & 2.54E+10 & 83373.9 & 0.177322 & 15.6127 & 22.9987 & 286.368 & 321.812 & -2998.41 & -4456.01 & 8.6997 & -2.29998 & -18.4625 & -11.5925 \\
& -4885.09 & 0.0570039 & 4.39E+10 & 80163.4 & 0.255374 & 15.6927 & 23.8355 & 324.354 & 325.002 & -1578.78 & -4075.51 & 9.10547 & -0.131814 & -17.7901 & -11.5925 \\
& -4035.51 & 0.0600693 & 4.32E+10 & 81415.3 & 0.0152417 & 14.9575 & 19.5572 & 296.019 & 321.434 & 824.034 & -4011.91 & 9.31902 & -1.51993 & -17.8755 & -11.5924 \\
& -3917.22 & 0.0586818 & 4.16E+10 & 87878.4 & 0.0128369 & 14.4221 & 19.8007 & 375.301 & 300.768 & 1043.95 & -5037.25 & 9.57629 & -1.73324 & -18.2571 & -11.5925 \\
& -5754.04 & 0.0575467 & 2.76E+10 & 83622.3 & 0.272711 & 17.8043 & 20.3977 & 370.717 & 317.424 & -1133.68 & -4973.3 & 9.0252 & -1.10353 & -18.3087 & -11.5925 \\
& -4786.87 & 0.0605 & 5.54E+10 & 81190 & 0.0324796 & 14.4401 & 19.8204 & 358.965 & 296.103 & 692.475 & -4121.91 & 8.76355 & -0.860885 & -18.484 & -18.4163 \\
& -4510.47 & 0.0597792 & 3.24E+10 & 83530.5 & 4.0042 & 16.0272 & 20.4454 & 225.399 & 326.39 & -478.625 & -5370.33 & 9.32801 & -1.13941 & -18.4418 & -11.5729 \\
& -5398.26 & 0.0605 & 2.12E+10 & 85510.6 & 0.43707 & 14.8375 & 19.3774 & 332.986 & 327.903 & -985.672 & -316.499 & 8.94067 & 0.336942 & -17.9256 & -11.5925 \\
& -4253.69 & 0.0600716 & 3.11E+10 & 84551 & 0.0128391 & 15.5474 & 21.1043 & 361.928 & 322.473 & -2662.15 & -5159.38 & 7.88002 & -0.784451 & -18.5094 & -11.5924 \\
\hline \\
Avg. & -5045.1266666667 & 0.05921826 & 3.70E+10 & 8.33E+04 & 3.06E-01 & 1.52E+01 & 2.10E+01 & 3.27E+02 & 3.21E+02 & -1.07E+03 & -4.51E+03 & 9.11E+00 & -8.39E-01 & -1.81E+01 & -1.23E+01 \\
Med. & -5062.845 & 0.06045935 & 35130150000 & 83154.7 & 0.02016735 & 15.05445 & 20.33055 & 325.5985 & 323.955 & -1229.345 & -4733.53 & 9.17547 & -1.0048975 & -18.2599 & -11.5925 \\
Std. Dev. & 698.8094252189 & 0.0026900942 & 10975111347.1528 & 2619.8872400694 & 0.791604351 & 0.8539153929 & 1.6317417953 & 39.4394076324 & 8.0216805796 & 1808.4389363295 & 1268.809305736 & 0.3628603461 & 0.8562948838 & 0.4364346365 & 2.0376857083 \\
\hline \\
\end{tabular}
}
}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 30 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -9410.25 & 0.0833082 & 2.47E+10 & 320497 & & 21.2591 & 29.99 & 368.495 & 473.165 & -6278.62 & -8324.6 & 13.026 & & -28.105 & -19.687 \\
& -8976.5 & 0.0769728 & 2.89E+10 & 255960 & & 21.382 & 29.5846 & 390.77 & 473.46 & -6837.82 & -9171.82 & 13.5603 & & -28.2307 & -19.8561 \\
& -9489.96 & 0.0869344 & 3.07E+10 & 349495 & & 20.4102 & 29.7188 & 389.025 & 476.709 & -6935.81 & -9139.13 & 13.5408 & & -28.2876 & -19.687 \\
& -9074.77 & 0.0754036 & 2.83E+10 & 337920 & & 21.3585 & 29.459 & 330.204 & 459.783 & -7391.32 & -8408.34 & 12.9661 & & -28.411 & -19.687 \\
& -9568.94 & 0.0569313 & 3.10E+10 & 338600 & & 21.4582 & 29.6347 & 379.984 & 477.567 & -6970.99 & -9684.67 & 13.1975 & & -28.3428 & -19.8561 \\
& -9351.64 & -0.0490078 & 2.68E+10 & 345600 & & 20.7617 & 29.9363 & 7.87853 & 475.43 & -6241.29 & -9773.48 & 13.359 & & -28.1681 & -19.8561 \\
& -124.883 & 0.0683202 & 3.31E+10 & 277860 & & 20.4901 & 29.4315 & 374.832 & 472.378 & -7256.36 & -9653.19 & 13.1889 & & -28.1063 & -19.687 \\
& -9924.25 & 0.0791061 & 3.19E+10 & 372780 & & 20.9216 & 29.7907 & 373.748 & 455.648 & -6665.63 & 283.59 & 12.8196 & & -28.1588 & -19.8561 \\
& -9311.68 & 0.0746452 & 3.24E+10 & 334380 & & 21.3375 & 29.6274 & 372.786 & 472.562 & -6572.91 & -8859.86 & 13.3459 & & -28.316 & -19.8561 \\
& -9035.97 & 0.0662556 & 3.18E+10 & 349440 & & 20.4238 & 30.1293 & 352.798 & 478.836 & -7007.39 & -9049.74 & 13.4248 & & -28.2245 & -19.8561 \\
& -9864.99 & -0.0636759 & 3.03E+10 & 312060 & & 21.0197 & 29.4352 & 376.266 & 466.391 & -8396.7 & -9143.81 & 13.5041 & & -28.2922 & -19.8561 \\
& -8996.29 & 0.0789434 & 2.87E+10 & -1.66599 & & 20.6647 & 29.6205 & 358.251 & 479.544 & -8751 & -10268.6 & 13.2663 & & -28.1594 & -19.8561 \\
& -9391.2 & 0.0749528 & 2.68E+10 & 338160 & & 20.4382 & 29.777 & 345.008 & 458.006 & -5866.24 & -8878.84 & 13.203 & & -28.3379 & -19.8561 \\
& -9450.26 & 0.0845282 & 2.94E+10 & 368202 & & 20.5752 & 29.6886 & 368.195 & 474.65 & -8633.36 & 464.389 & 13.6934 & & -3.43673 & -19.8561 \\
& -9746.52 & 0.0751487 & 2.75E+10 & 357000 & & 21.1032 & 29.7037 & 351.542 & 467.12 & -7698.6 & -8541.65 & 13.0522 & & -28.3234 & -19.8561 \\
& -9865.04 & 0.0805431 & -1.00E+01 & 330432 & & 20.6857 & 29.5885 & -7.69393 & 473.355 & -6756.61 & -9540.85 & 13.5152 & & -28.2612 & -19.687 \\
& -9272.8 & 0.0795918 & 3.80E+10 & 286598 & & 20.6426 & 19.8658 & 371.765 & 486.552 & -6547.46 & -9854.97 & 13.5049 & & -28.1688 & -19.8561 \\
& -10062.5 & 0.0768222 & 3.74E+10 & 350160 & & 20.0135 & 29.7339 & 390.477 & 475.739 & -6719.72 & -9440.52 & 13.4156 & & -28.2127 & -19.8561 \\
& -9134.53 & 0.0711327 & 3.08E+10 & 360420 & & 20.3865 & 29.9421 & 378.888 & 462.393 & -8281.31 & -9663.62 & 12.4277 & & -28.2074 & -19.8561 \\
& -9390.69 & -0.0309291 & 3.97E+10 & 295997 & & 20.7647 & 30.6015 & 359.88 & 484.513 & -5065.59 & -9134.86 & 13.6274 & & -28.3904 & -19.8561 \\
& -9134.47 & 0.0804281 & 4.70E+10 & 334360 & & 20.6145 & 27.8698 & 381.484 & 474.708 & -4226.77 & -8811.44 & 13.4809 & & -28.0928 & -19.8561 \\
& -9568.88 & 0.0785976 & 3.02E+10 & 296580 & & 20.5503 & 29.785 & 398.854 & 455.846 & -7596.93 & -8997.45 & 13.5753 & & -28.1787 & -19.8561 \\
& -9272.85 & 0.0817261 & 2.52E+10 & 306300 & & 20.8571 & 29.6731 & 380.627 & 470.576 & -6667.08 & -9397.49 & 13.1267 & & -28.1215 & -19.6839 \\
& -9212.05 & 0.0702678 & 2.59E+10 & 335460 & & 20.1083 & 30.1306 & 381.129 & 463.962 & -8674.4 & -9315.6 & 12.7335 & & -28.2767 & -19.8561 \\
& -9726.64 & 0.0741334 & 3.79E+10 & 363524 & & 21.4061 & 29.8537 & 332.172 & 458.809 & -6933.42 & -9365.76 & 13.402 & & -28.2994 & -19.8561 \\
& -10457.2 & 0.081483 & 3.46E+10 & 313260 & & 21.4092 & 29.7197 & 333.342 & 476.861 & -8640.37 & -9338.14 & 13.5832 & & -28.3677 & -19.8561 \\
& -9173.48 & 0.0870585 & 3.42E+10 & 312000 & & 20.6161 & 29.6849 & 336 & 471.518 & -6486.48 & -9721.42 & 13.651 & & -28.1929 & -19.8561 \\
& -9133.36 & 0.0840459 & 3.16E+10 & 381645 & & 20.5456 & 30.4368 & 362.339 & 459.739 & -6593.12 & -9396.22 & 13.5676 & & -28.2393 & -19.8561 \\
& -9391.21 & 0.0797617 & 4.23E+10 & 346620 & & 20.5208 & 29.7877 & 368.834 & 477.598 & -6145.95 & -9651.49 & 13.1248 & & -28.3445 & -19.8561 \\
& -9568.74 & 0.074442 & 2.17E+10 & 311040 & & 18.9379 & 29.5349 & 355.219 & 475.06 & -8780 & -9200.77 & 13.5091 & & -28.3269 & -19.8561 \\
\hline \\
Avg. & -9136.0847666667 & 0.06459572 & 3.06E+10 & 3.19E+05 & 2.07E+01 & 2.94E+01 & 3.42E+02 & 4.71E+02 & 4.71E+02 & -7.05E+03 & -8.63E+03 & 1.33E+01 & -2.74E+01 & -2.74E+01 & -1.98E+01 \\
Med. & -9390.945 & 0.0768975 & 30729500000 & 334920 & 20.65365 & 29.71125 & 368.6645 & 473.26 & 473.26 & -6885.62 & -9258.185 & 13.4088 & -28.235 & -28.235 & -19.8561 \\
Std. Dev. & 1736.4971456685 & 0.0388817803 & 7961125157.97467 & 67087.9428677671 & 0.5231419506 & 1.8518270929 & 94.7625256457 & 8.3344717638 & 8.3344717638 & 1094.2052693977 & 2486.4963265932 & 0.3016843863 & 4.5304816776 & 4.5304816776 & 0.0690085236 \\
\hline \\
\end{tabular}
}
}
\small{Random Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 0.0028796196 & 0.0027256012 & 0.004216671 \\
Function 2 & 0.0037307739 & 0.0027096272 & 0.0042328835 \\
Function 3 & 0.0027823448 & 0.0035073757 & 0.003777504 \\
Function 4 & 0.0041363239 & 0.0041460991 & 0.0026381016 \\
Function 5 & 0.0037288666 & 0.003030777 & 0.0026414394 \\
Function 6 & 0.0037727356 & 0.0028493404 & 0.0026321411 \\
Function 7 & 0.0035896301 & 0.0027751923 & 0.0037312508 \\
Function 8 & 0.0035607815 & 0.0028815269 & 0.0037713051 \\
Function 9 & 0.0044622421 & 0.0026602745 & 0.0027508736 \\
Function 10 & 0.0040593147 & 0.0027322769 & 0.0027010441 \\
Function 11 & 0.0030579567 & 0.0026328564 & 0.0026137829 \\
Function 12 & 0.0029666424 & 0.0026972294 & 0.0026974678 \\
Function 13 & 0.0027945042 & 0.003254652 & 0.0025961399 \\
Function 14 & 0.0028162003 & 0.004308939 & 0.0026042461 \\
Function 15 & 0.0027165413 & 0.0028510094 & 0.0024940968 \\
\hline
\end{tabular}
}\\[0.5cm]
\small{Local Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 0.2714903355 & 0.3662781715 & 0.8037896156 \\
Function 2 & 0.0122189522 & 0.1061990261 & 0.0311796665 \\
Function 3 & 0.0036041737 & 0.0034754276 & 0.0039658546 \\
Function 4 & 0.0045986176 & 0.0037958622 & 0.0057651997 \\
Function 5 & 3.5046873093 & 107.3777658939 & 237.3515529633 \\
Function 6 & 0.0053646564 & 0.0071499348 & 0.0078163147 \\
Function 7 & 0.1593027115 & 0.1934890747 & 36.0658888817 \\
Function 8 & 0.0124971867 & 0.1606588364 & 0.0684037209 \\
Function 9 & 0.0049269199 & 0.0049231052 & 0.0069723129 \\
Function 10 & 0.0056340694 & 0.0120668411 & 0.0046567917 \\
Function 11 & 0.0049116611 & 0.1781361103 & 3.4641461372 \\
Function 12 & 0.0035014153 & 0.0031409264 & 0.0071520805 \\
Function 13 & 0.0022878647 & 0.0031747818 & 0.008487463 \\
Function 14 & 0.0166265965 & 0.1419093609 & 0.2867805958 \\
Function 15 & 0.0709223747 & 0.0597565174 & 0.1033499241 \\
\hline \\
\end{tabular}
} \\[0.5cm]
\small{Iterative Local Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 5.355587244 & 21.5247523785 & 47.5882720947 \\
Function 2 & 0.4999251366 & 1.151144743 & 2.4649145603 \\
Function 3 & 0.0042607784 & 0.0112228394 & 0.0144929886 \\
Function 4 & 0.0058951378 & 0.0114533901 & 0.0161828995 \\
Function 5 & 150.1059572697 & 2928.3961615563 & N/A \\
Function 6 & 0.0101454258 & 0.0255510807 & 0.0222308636 \\
Function 7 & 32.4964332581 & 41.5021996498 & 168.8056237698 \\
Function 8 & 0.3526818752 & 1.6770370007 & 3.8826031685 \\
Function 9 & 0.0110986233 & 0.0125215054 & 0.0229070187 \\
Function 10 & 0.0899729729 & 0.2644715309 & 0.7342042923 \\
Function 11 & 30.093629837 & 165.0208876133 & 384.6772966385 \\
Function 12 & 297.458874464 & 25.3617525101 & 21.2174470425 \\
Function 13 & 0.0197796822 & 0.0436241627 & 0.0463643074 \\
Function 14 & 1.5726833344 & 7.7616007328 & 9.7854065895 \\
Function 15 & 6.6486163139 & 23.9164574146 & 32.7224471569 \\
\hline \\
\end{tabular}
} \\[0.5cm]
\section{Previous Results}
\hskip+1.0cm\scalebox{0.7}{
\begin{tabular}{| l | l | l | l | l | l|}
\hline
Function & Dimensionality & Mean & Median & Deviation & Avg. Time \\ \hline
Schwefel's & 10 & 40.03647 & 0.0623 & 547.27404 & 3.1285 \\ \hline
& 20 & -273.92765 & 16.52 & 883.3137 & 2.942 \\ \hline
& 30 & -63.79153 & 255.3487 & 925.71758 & 3.132 \\ \hline
De Jong's & 10 & 3775.96667 & 3772 & 3116.12957 & 0.667 \\ \hline
& 20 & 3748.5 & 4105 & 2885.095608 & 0.132 \\ \hline
& 30 & 3429.8334 & 3429 & 2608.0073 & 0.0933 \\ \hline
Rosenbrock & 10 & 2093118197.7 & 951513386 & 2466626292.4 & 0.90 \\ \hline
& 20 & 2109933654.57 & 997811808.5 &2696811330.46 & 1.679 \\ \hline
& 30 & 1784558137.97 & 543961363 & 2372214627.61 & 2.98 \\ \hline
Rastrigin & 10 & 318.2 & 262.5 & 289.575003684 & 1.04 \\ \hline
& 20 & 202.2666667 & 111 & 232.951516834 & 1.98 \\ \hline
& 30 & 309.9 & 246 & 264.111829763 & 2.788 \\ \hline
Griegwangk & 10 & 27.326983 & 22.8316 & 19.94304775 & 1.32 \\ \hline
& 20 & 22.247975 & 18.4916 & 17.41881647 & 4.98 \\ \hline
& 30 & 25.04950833 & 24.1043 & 19.11108789 & 5.67 \\ \hline
Sine Envelope Sine Wave & 10 & -4.70534 &-4.6083 & 0.2380683 & 1.112 \\ \hline
& 20 & -9.805175 & -9.6732 & 0.3503130 & 2.223 \\ \hline
& 30 & -15.1282 & -15.0166 & 0.410964 & 4.121 \\ \hline
Stretched V Sine Wave & 10 & -5.85114 & -5.8511 & 4.5168102e-15 & 3.55 \\ \hline
& 20 & -12.3524 & -12.35 & 5.420172e-15 & 6.88 \\ \hline
& 30 & -18.8536 & -18.8537 & 3.61344822e-15 & 9.87 \\ \hline
Ackley's One & 10 & 187.917 & 184.0721 & 33.190007 & 3.1298 \\ \hline
& 20 & 389.45238 & 382.962 & 40.1378 & 4.6731 \\ \hline
& 30 & 593.39786 & 599.1116 & 64.28003 & 8.7728 \\ \hline
Ackley's Two & 10 & 217.1978 & 217.922 & 2.26465 & 3.055 \\ \hline
& 20 & 456.7024 & 459.70244 & 6.447889 & 7.001 \\ \hline
& 30 & 698.9139 & 700.1936 & 4.42437 & 8.4356 \\ \hline
Egg Holder & 10 & -374.3114 & -529.396 & 877.367109 & 1.998 \\ \hline
& 20 & -197.32204 & -339.2197 & 1196.0543 & 4.7621 \\ \hline
& 30 & -533.43484 & -507.8253 & 1366.0572 & 6.9981 \\ \hline
Rana & 10 & 126.682 & 92.4435 & 762.991158 & 5.1433 \\ \hline
& 20 & 44.632258 & 144.748 & 897.22947 & 9.4239 \\ \hline
& 30 & 147.21517 & 280.21517 & 1161.5825 & 14.221 \\ \hline
Pathological & 10 & 4.7605744 & 4.5666& 0.320334 & 3.1561 \\ \hline
& 20 & 10.02892 & 9.9324 & 0.485784 & 3.9714 \\ \hline
& 30 & 15.28425 & 15.1622 & 0.66075 & 4.9912 \\ \hline
Michalewicz & 10 & 0.904288 & 0.942 & 0.544008 & 1.3241 \\ \hline
& 20 & 1.73464 & 1.5955 & 0.733736 & 3.1149 \\ \hline
& 30 & 2.108609 & 1.9897 & 0.974908 & 4.8229 \\ \hline
Masters Cosine Wave & 10 &0.6488827 & 0.5623 & 2.0702 & 2.3341 \\ \hline
& 20 & -1.492407& -1.0483& 2.270724 & 3.4256 \\ \hline
& 30 & 0.885458 & 0.9459 & 3.441345 & 5.3243 \\ \hline
Shekel's Foxhole & 10 & -0.2105669 & -0.2023 & 0.038925 & 4.5623 \\ \hline
\end{tabular}
}
\end{document}

@ -0,0 +1,13 @@
#pragma once
class search_function {
public:
function func;
search_function(function f) : func(f) {
};
virtual double search(int permutations, int dimensionality) = 0;
};

@ -0,0 +1,181 @@
// http://www.math.keio.ac.jp/~matumoto/ver980409.html
// This is the ``Mersenne Twister'' random number generator MT19937, which
// generates pseudorandom integers uniformly distributed in 0..(2^32 - 1)
// starting from any odd seed in 0..(2^32 - 1). This version is a recode
// by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by
// Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in
// July-August 1997).
//
// Effectiveness of the recoding (on Goedel2.math.washington.edu, a DEC Alpha
// running OSF/1) using GCC -O3 as a compiler: before recoding: 51.6 sec. to
// generate 300 million random numbers; after recoding: 24.0 sec. for the same
// (i.e., 46.5% of original time), so speed is now about 12.5 million random
// number generations per second on this machine.
//
// According to the URL <http://www.math.keio.ac.jp/~matumoto/emt.html>
// (and paraphrasing a bit in places), the Mersenne Twister is ``designed
// with consideration of the flaws of various existing generators,'' has
// a period of 2^19937 - 1, gives a sequence that is 623-dimensionally
// equidistributed, and ``has passed many stringent tests, including the
// die-hard test of G. Marsaglia and the load test of P. Hellekalek and
// S. Wegenkittl.'' It is efficient in memory usage (typically using 2506
// to 5012 bytes of static data, depending on data type sizes, and the code
// is quite short as well). It generates random numbers in batches of 624
// at a time, so the caching and pipelining of modern systems is exploited.
// It is also divide- and mod-free.
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation (either version 2 of the License or, at your
// option, any later version). This library is distributed in the hope that
// it will be useful, but WITHOUT ANY WARRANTY, without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU Library General Public License for more details. You should have
// received a copy of the GNU Library General Public License along with this
// library; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307, USA.
//
// The code as Shawn received it included the following notice:
//
// Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. When
// you use this, send an e-mail to <matumoto@math.keio.ac.jp> with
// an appropriate reference to your work.
//
// It would be nice to CC: <Cokus@math.washington.edu> when you write.
//
#include <stdio.h>
#include <stdlib.h>
//
// uint32 must be an unsigned integer type capable of holding at least 32
// bits; exactly 32 should be fastest, but 64 is better on an Alpha with
// GCC at -O3 optimization so try your options and see what's best for you
//
typedef unsigned long uint32;
#define N (624) // length of state vector
#define M (397) // a period parameter
#define K (0x9908B0DFU) // a magic constant
#define hiBit(u) ((u) & 0x80000000U) // mask all but highest bit of u
#define loBit(u) ((u) & 0x00000001U) // mask all but lowest bit of u
#define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u
#define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v
static uint32 state[N+1]; // state vector + 1 extra to not violate ANSI C
static uint32 *next; // next random value is computed from here
static int left = -1; // can *next++ this many times before reloading
void seedMT(uint32 seed)
{
//
// We initialize state[0..(N-1)] via the generator
//
// x_new = (69069 * x_old) mod 2^32
//
// from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's
// _The Art of Computer Programming_, Volume 2, 3rd ed.
//
// Notes (SJC): I do not know what the initial state requirements
// of the Mersenne Twister are, but it seems this seeding generator
// could be better. It achieves the maximum period for its modulus
// (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if
// x_initial can be even, you have sequences like 0, 0, 0, ...;
// 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,
// 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.
//
// Even if x_initial is odd, if x_initial is 1 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 0,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,
// ...
//
// and if x_initial is 3 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 1,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,
// ...
//
// The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is
// 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It
// also does well in the dimension 2..5 spectral tests, but it could be
// better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).
//
// Note that the random number user does not see the values generated
// here directly since reloadMT() will always munge them first, so maybe
// none of all of this matters. In fact, the seed values made here could
// even be extra-special desirable if the Mersenne Twister theory says
// so-- that's why the only change I made is to restrict to odd seeds.
//
register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = state;
register int j;
for(left=0, *s++=x, j=N; --j;
*s++ = (x*=69069U) & 0xFFFFFFFFU);
}
uint32 reloadMT(void)
{
register uint32 *p0=state, *p2=state+2, *pM=state+M, s0, s1;
register int j;
if(left < -1)
seedMT(4357U);
left=N-1, next=state+1;
for(s0=state[0], s1=state[1], j=N-M+1; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
for(pM=state, j=M; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1=state[0], *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1 ^= (s1 >> 11);
s1 ^= (s1 << 7) & 0x9D2C5680U;
s1 ^= (s1 << 15) & 0xEFC60000U;
return(s1 ^ (s1 >> 18));
}
uint32 randomMT(void)
{
uint32 y;
if(--left < 0)
return(reloadMT());
y = *next++;
y ^= (y >> 11);
y ^= (y << 7) & 0x9D2C5680U;
y ^= (y << 15) & 0xEFC60000U;
return(y ^ (y >> 18));
}
#ifdef NOCOMPILE
int main(void)
{
int j;
// you can seed with any uint32, but the best are odds in 0..(2^32 - 1)
seedMT(4357U);
// print the first 2,002 random numbers seven to a line as an example
for(j=0; j<2002; j++)
printf(" %10lu%s", (unsigned long) randomMT(), (j%7)==6 ? "\n" : "");
return(EXIT_SUCCESS);
}
#endif

@ -0,0 +1,8 @@
struct timer{
std::chrono::high_resolution_clock::time_point t1;
std::chrono::high_resolution_clock::time_point t2;
void start(){t1 = std::chrono::high_resolution_clock::now();}
void end(){t2 = std::chrono::high_resolution_clock::now();}
double duration(){ return std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();}
};

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.5.1)
project(Lab3)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
file(GLOB SOURCES "*.cpp")
file(GLOB HEADERS "*.h" "*.hpp")
set(SOURCE_FILES ${HEADERS} ${SOURCES} )
add_executable(Lab3 ${SOURCE_FILES})

Binary file not shown.

@ -0,0 +1,169 @@
#pragma once
#include "search_function.h"
class differential_evolution : public search_function {
public:
differential_evolution(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start
std::vector<std::vector<double>> population = generate_population(50, dimensionality);
for (int g = 0; g < maximum_generation_number; g++) {
for (int i = 0; i < population.size(); i++) {
// Create the U, temp vector to hold values
std::vector<double> u(dimensionality, 0);
// select a random dimension
int j_rand = rand() % dimensionality;
for (int j = j_rand; j < dimensionality; j++){
// Accept changes if rng returns < 0.9
if (randomMT() * 1.0 / RAND_MAX < 0.9)
u.at(j) = check_bounds(compute_with_strategy(&population, j, i));
else
u.at(j) = population.at(i).at(j);
}
// If the new population has a better fitness, replace it
if (func.compute(population.at(i)) > func.compute(u))
population.at(i) = u;
}
}
// Generation is done, return the best value from the population
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
return func.compute(population[0]);
};
void set_strategy(int strategy){
this->strategy = strategy;
}
private:
// G
int maximum_generation_number = 30;
// Tuning variable
double tuning_variable_f = 0.8;
double tuning_variable_lambda = 1.0;
int strategy = 0;
// Compute using different strategies
double compute_with_strategy(std::vector<std::vector<double>> *population, int j, int i){
// Setup and find the best solution in the population that was passed in
std::vector<double> best_solution;
double best_fitness = 999999999999;
for (auto p: *population){
double val = func.compute(p);
if (val < best_fitness){
best_fitness = val;
best_solution = p;
}
}
// Depending on the strategy, determine the new solution at J
switch(strategy){
case 1: {
std::vector<int> r = distinct_indices(2, population[0].size());
return best_solution[j] + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 2: {
std::vector<int> r = distinct_indices(3, population[0].size());
return population->at(r[0]).at(j) + tuning_variable_f * (population->at(r[1]).at(j) - population->at(r[2]).at(j));
}
case 3:{
std::vector<int> r = distinct_indices(2, population[0].size());
return population->at(i).at(j) + tuning_variable_lambda * (best_solution.at(j) - population->at(i).at(j)) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 4:{
std::vector<int> r = distinct_indices(4, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 5:{
std::vector<int> r = distinct_indices(5, population[0].size());
return population->at(r[4]).at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 6:{
std::vector<int> r = distinct_indices(2, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 7:{
std::vector<int> r = distinct_indices(3, population[0].size());
return population->at(r[0]).at(j) + tuning_variable_f * (population->at(r[1]).at(j) - population->at(r[2]).at(j));
}
case 8:{
std::vector<int> r = distinct_indices(2, population[0].size());
return population->at(i).at(j) + tuning_variable_lambda * (best_solution.at(j) - population->at(i).at(j)) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 9:{
std::vector<int> r = distinct_indices(4, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 10:{
std::vector<int> r = distinct_indices(5, population[0].size());
return population->at(r[4]).at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
}
}
std::vector<int> distinct_indices(int count, int max){
std::vector<int> indices;
for (int q = 0; q < count; q++) {
int val = 1 + (rand() % (max - 1));
while (std::count(indices.begin(), indices.end(), val) != 0)
val = randomMT() % max;
indices.push_back(val);
}
return indices;
}
};

@ -0,0 +1,319 @@
std::vector<double> c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462,
0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369,
0.992,0.332,0.817,0.632,0.883,0.608,0.326};
double a[][10] =
{
{9.681,0.667,4.783,9.095,3.517,9.325,6.544,0.211,5.122,2.02},
{9.4,2.041,3.788,7.931,2.882,2.672,3.568,1.284,7.033,7.374},
{8.025,9.152,5.114,7.621,4.564,4.711,2.996,6.126,0.734,4.982},
{2.196,0.415,5.649,6.979,9.510,9.166,6.304,6.054,9.377,1.426},
{8.074,8.777,3.467,1.863,6.708,6.349,4.534,0.276,7.633,1.567},
{7.650,5.658,0.720,2.764,3.278,5.283,7.474,6.274,1.409,8.208},
{1.256,3.605,8.623,6.905,4.584,8.133,6.071,6.888,4.187,5.448},
{8.314,2.261,4.24,1.781,4.124,0.932,8.129,8.658,1.208,5.762},
{0.226,8.858,1.42,0.954,1.622,4.698,6.228,9.096,0.972,7.637},
{7.305,2.228,1.242,5.928,9.133,1.826,4.06,5.204,8.713,8.247},
{0.652,7.027,0.508,4.876,8.807,4.632,5.808,6.937,3.291,7.016},
{2.699,3.516,5.847,4.119,4.461,7.496,8.817,0.69,6.593,9.789},
{8.327,3.897,2.017,9.57,9.825,1.15,1.395,3.885,6.354,0.109},
{2.132,7.006,7.136,2.641,1.882,5.943,7.273,7.691,2.88,0.564},
{4.707,5.579,4.08,0.581,9.698,8.542,8.077,8.515,9.231,4.67},
{8.304,7.559,8.567,0.322,7.128,8.392,1.472,8.524,2.277,7.826},
{8.632,4.409,4.832,5.768,7.05,6.715,1.711,4.323,4.405,4.591},
{4.887,9.112,0.17,8.967,9.693,9.867,7.508,7.77,8.382,6.74},
{2.44,6.686,4.299,1.007,7.008,1.427,9.398,8.48,9.95,1.675},
{6.306,8.583,6.084,1.138,4.350,3.134,7.853,6.061,7.457,2.258},
{0.652,2.343,1.37,0.821,1.31,1.063,0.689,8.819,8.833,9.07},
{5.558,1.272,5.756,9.857,2.279,2.764,1.284,1.677,1.244,1.234},
{3.352,7.549,9.817,9.437,8.687,4.167,2.57,6.54,0.228,0.027},
{8.798,0.88,2.37,0.168,1.701,3.68,1.231,2.39,2.499,0.064},
{1.46,8.057,1.337,7.217,7.914,3.615,9.981,9.198,5.292,1.224},
{0.432,8.645,8.774,0.249,8.081,7.461,4.416,0.652,4.002,4.644},
{0.679,2.8,5.523,3.049,2.968,7.225,6.73,4.199,9.614,9.229},
{4.263,1.074,7.286,5.599,8.291,5.2,9.214,8.272,4.398,4.506},
{9.496,4.83,3.15,8.27,5.079,1.231,5.731,9.494,1.883,9.732},
{4.138,2.562,2.532,9.661,5.611,5.5,6.886,2.341,9.699,6.5}
};
double schwefel(std::vector<double> input){
int upper_bound = 512;
int lower_bound = -512;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += (-input[i]) * std::sin(std::sqrt(std::abs(input[i])));
}
return sum;
}
double first_de_jong(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2);
}
return sum;
}
double rosenbrock(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 100 * std::pow((std::pow(input[i], 2) - input[i + 1]), 2) + std::pow((1 - input[i]), 2);
}
return sum;
}
double rastrigin(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) - 10 * std::cos(2 * M_PI * input[i]);
}
sum *= 2 * input.size();
return sum;
}
double griewangk(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) / 4000;
}
double product = 1;
for (int i = 0; i < input.size(); i++){
product *= std::cos(input[i] / sqrt(i + 1));
}
return 1 + sum - product;
}
double sine_envelope_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 0.5 + (std::pow(std::sin(std::pow(input[i], 2) + std::pow(input[i + 1], 2) - 0.5), 2)) /
(1 + 0.001 * (std::pow(input[i], 2) + std::pow(input[i + 1], 2)));
}
return sum;
}
double stretched_v_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 4) *
std::pow(std::sin(50 * std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 10)), 2) + 1;
}
return sum;
}
double ackleys_one(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += (1.0 / pow(M_E, 0.2)) *
std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2)) +
3 * std::cos(2 * input[i]) +
std::sin(2 * input[i + 1]);
}
return sum;
}
double ackleys_two(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 20 + M_E -
(20 / (std::pow(M_E, 0.2) * std::sqrt(((std::pow(input[i], 2) + std::pow(input[i+1], 2) + 1) / 2)))) -
std::pow(M_E, 0.5 * std::cos(2 * M_PI * input[i]) + cos(2 * M_PI * input[i + 1]));
}
return sum;
}
double egg_holder(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += -input[i] * std::sin(std::sqrt(abs(input[i] - input[i + 1] - 47))) -
(input[i + 1] + 47) * std::sin(std::sqrt(std::abs(input[i + 1] + 47 + input[i] / 2)));
}
return sum;
}
double rana(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += input[i] * std::sin(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::cos(std::sqrt(std::abs(input[i + 1] + input[i] + 1))) +
(input[i + 1] + 1) *
std::cos(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::sin(std::sqrt(std::abs(input[i + 1] + input[i] + 1)));
}
return sum;
}
double pathological(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += 0.5 +
(std::pow(std::sin(std::sqrt(100 * std::pow(input[i], 2) + std::pow(input[i + 1], 2))), 2) - 0.5) /
(1 + 0.001 * std::pow(std::pow(input[i], 2) - 2 * input[i] * input[i + 1] + std::pow(input[i + 1], 2), 2));
}
return sum;
}
double michalewicz(std::vector<double> input){
int upper_bound = M_PI;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::sin(input[i]) * std::pow(std::sin(i * std::pow(input[i], 2) / M_PI), 20);
}
return -sum;
}
double masters_cosine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::pow(M_E, -(1/8) * (std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i + 1] * input[i])) *
std::cos(4 * std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i] * input[i + 1]));
}
return -sum;
}
double shekels_foxholes(std::vector<double> input){
int upper_bound = 10;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < c.size() - 1; i++) {
double bottom_sum = 0;
for (int q = 0; q < input.size(); q++){
bottom_sum = std::pow(input.at(q) - a[i][q], 2);
}
sum += 1 / (bottom_sum + c[i]);
}
return -sum;
}
double set_within(double val, double prior_upper, double prior_lower, double after_upper, double after_lower){
return ((after_upper - after_lower) * (val - prior_lower) / (prior_upper - prior_lower)) + after_lower;
}
struct function {
double (*function_pointer)(std::vector<double>);
double range = 0;
double upper_bound = 0;
double lower_bound = 0;
timer t;
function(){};
function(double (*func)(std::vector<double>), double upper_bound, double lower_bound) {
function_pointer = func;
this->upper_bound = upper_bound;
this->lower_bound = lower_bound;
}
double compute(std::vector<double> input) {
for (auto v: input) {
if (v <= lower_bound && v >= upper_bound) {
std::cout << "Function exceeded bounds";
return 0;
}
}
double res = function_pointer(input);
return res;
};
};

@ -0,0 +1,167 @@
#pragma once
#include "search_function.h"
class genetic_algorithm : public search_function {
public:
genetic_algorithm(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
elitism = elitism_rate * number_of_solutions;
// Set up random start population
std::vector<std::vector<double>> population;
for (int p = 0; p < number_of_solutions; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
for (int i = 0; i < max_iterations; i++){
// Setup the random new population
std::vector<std::vector<double>> new_population;
for (int p = 0; p < number_of_solutions; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
new_population.push_back(tmp);
}
for (int s = 0; s < number_of_solutions; s += 2){
auto p1p2 = select(&population);
crossover(&std::get<0>(p1p2), &std::get<1>(p1p2));
mutate(&std::get<0>(p1p2));
mutate(&std::get<1>(p1p2));
}
reduce(&population, &new_population);
for (auto q: population){
double val = func.compute(q);
if (val < best_fitness)
best_fitness = val;
}
}
return best_fitness;
};
private:
double crossover_rate = 0.90;
double elitism_rate = 0.2;
int elitism = 10;
double mutation_rate = 0.008;
double mutation_range = 0.1;
double muration_precision = 3.5;
double best_fitness = 99999999999999999;
int number_of_solutions = 50;
int max_iterations = 100;
double get_fitness(std::vector<std::vector<double>> *population){
double fitness_sum = 0;
for (auto p: *population){
double fitness = func.compute(p);
if (fitness >= 0)
fitness_sum += 1 / (1 + fitness);
else
fitness_sum += 1 + abs(fitness);
}
return fitness_sum;
}
int select_parent(std::vector<std::vector<double>> *population){
double r = fmod(randomMT(), total_fitness(population));
int s = 0;
while (s < population->size()-1 && (r - func.compute(population->at(s)) > 0)) {
r -= func.compute(population->at(s++));
}
return s;
}
std::tuple<std::vector<double>, std::vector<double>> select(std::vector<std::vector<double>> *population){
auto p1 = population->at(select_parent(population));
auto p2 = population->at(select_parent(population));
return std::make_tuple(p1, p2);
};
void mutate(std::vector<double> *solution){
for (auto i: *solution){
if ((randomMT() * 1.0 / UINT32_MAX) < mutation_rate){
i += ((randomMT() * 1.0 / UINT32_MAX) * 2 - 1) * (func.upper_bound - func.lower_bound) *
mutation_range * pow(2, (-1 * (randomMT() * 1.0 / UINT32_MAX) * muration_precision));
}
}
}
void crossover(std::vector<double> *parent1, std::vector<double> *parent2){
if ((randomMT() * 1.0 / UINT32_MAX) < crossover_rate){
int d = randomMT() % (parent1->size() - 1) + 1;
int dim = parent1->size();
std::vector<double> temp;
temp.insert(temp.begin(), parent1->begin(), parent1->begin() + d);
parent1->erase(parent1->begin(), parent1->begin() + d);
parent1->insert(parent1->end(), parent2->begin() + dim - d, parent2->end());
parent2->erase(parent2->begin() + dim - d, parent2->end());
parent2->insert(parent2->end(), temp.begin(), temp.end());
}
}
void reduce(std::vector<std::vector<double>> *population, std::vector<std::vector<double>> *new_population){
std::sort(population->begin(), population->end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
std::sort(new_population->begin(), new_population->end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
for (int s = 0; s < elitism; s++) {
new_population->at(elitism + 1 - s) = population->at(s);
}
*population = *new_population;
}
double total_fitness(std::vector<std::vector<double>> *population){
double val = 0;
for (auto i: *population)
val += func.compute(i);
return val;
}
};

@ -0,0 +1,65 @@
#pragma once
#include "search_function.h"
class iterative_local_search : public search_function {
public:
iterative_local_search(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start
std::vector<double> global_best_solution;
for (int i = 0; i < dimensionality; i++) {
global_best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
// 30 iteration max
int iteration_max = 30;
for (int i = 0; i < iteration_max; i++){
// Random new solution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is still being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
// Set up the new solution
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// test it
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
// Check to see if we found a better global solution
if (func.compute(best_solution) < func.compute(global_best_solution)){
global_best_solution = best_solution;
}
}
};
};

@ -0,0 +1,53 @@
#pragma once
#include "search_function.h"
class local_search : public search_function {
public:
local_search(function f) : search_function(f) {
};
double search(int permutations, int dimensionality) {
// Set up the initial soution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// Check to see if we found a better solution
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
return func.compute(best_solution);
};
};

@ -0,0 +1,124 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <chrono>
#include <cstring>
#include "twister.c"
#include "util.hpp"
#include "functions.hpp"
#include "random_walk.hpp"
#include "local_search.hpp"
#include "iterative_local_search.hpp"
#include "differential_evolution.hpp"
#include "genetic_algorithm.hpp"
#include "particle_search.hpp"
int main(int argc, char* args[]) {
std::map<int, function> function_lookup;
function_lookup.emplace(std::make_pair(0, function(&schwefel, 512, -512)));
function_lookup.emplace(std::make_pair(1, function(&first_de_jong, 100, -100)));
function_lookup.emplace(std::make_pair(2, function(&rosenbrock, 100, -100)));
function_lookup.emplace(std::make_pair(3, function(&rastrigin, 30, -30)));
function_lookup.emplace(std::make_pair(4, function(&griewangk, 500, -500)));
function_lookup.emplace(std::make_pair(5, function(&sine_envelope_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(6, function(&stretched_v_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(7, function(&ackleys_one, 32, -32)));
function_lookup.emplace(std::make_pair(8, function(&ackleys_two, 32, -32)));
function_lookup.emplace(std::make_pair(9, function(&egg_holder, 500, -500)));
function_lookup.emplace(std::make_pair(10, function(&rana, 500, -500)));
function_lookup.emplace(std::make_pair(11, function(&pathological, 100, -100)));
function_lookup.emplace(std::make_pair(12, function(&michalewicz, M_PI, 0)));
function_lookup.emplace(std::make_pair(13, function(&masters_cosine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(14, function(&shekels_foxholes, 10, 0)));
function f;
int dimensionality = 0;
double seed = 0;
int search_function = 0;
// Get the command line args
if (argc == 1){
char arg_str[200];
std::cin.get(arg_str, 200);
char t = ' ';
f = function_lookup[atoi(strtok(arg_str, &t))];
dimensionality = atoi(strtok(NULL, &t));
seed = atoi(strtok(NULL, &t));
search_function = atoi(strtok(NULL, &t));
} else {
f = function_lookup[atoi(args[1])];
dimensionality = atoi(args[2]);
seed = atoi(args[3]);
search_function = atoi(args[4]);
}
// srand(time(nullptr));
// f = function_lookup[10];
// dimensionality = 20;
// seed = rand();
// search_function = 2;
// Set up the search functions
seedMT(seed);
random_walk r_w(f);
local_search l_s(f);
iterative_local_search it_s(f);
differential_evolution dif_ev(f);
genetic_algorithm gen_alg(f);
particle_search prtcl_src(f);
// return the results of the search
if (search_function == 0)
std::cout << r_w.search(1, dimensionality) << std::endl;
else if (search_function == 1)
std::cout << l_s.search(1, dimensionality) << std::endl;
else if (search_function == 2)
std::cout << it_s.search(1, dimensionality) << std::endl;
else if (search_function == 3)
std::cout << dif_ev.search(1, dimensionality) << std::endl;
else if (search_function == 4)
std::cout << gen_alg.search(1, dimensionality) << std::endl;
else if (search_function == 5)
std::cout << prtcl_src.search(1, dimensionality) << std::endl;
//std::cout << r_w.search(1, dimensionality) << std::endl;
//std::cout << l_s.search(1, dimensionality) << std::endl;
//std::cout << it_s.search(1, dimensionality) << std::endl;
//
// std::cout << "=====================" << std::endl;
//
// dif_ev.set_strategy(1);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(2);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(3);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(4);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(5);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(6);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(7);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(8);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(9);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
// dif_ev.set_strategy(10);
// std::cout << dif_ev.search(1, dimensionality) << std::endl;
//
// std::cout << "=====================" << std::endl;
// std::cout << gen_alg.search(1, dimensionality) << std::endl;
//
// std::cout << "=====================" << std::endl;
// std::cout << prtcl_src.search(1, dimensionality) << std::endl;
return 0;
}

@ -0,0 +1,144 @@
#pragma once
#include "search_function.h"
struct particle {
// Personal best
double pb_fitness = 999999999999999;
std::vector<double> pb_solution;
// Current solution
double fitness = 9999999999;
std::vector<double> solution;
std::vector<double> velocity;
double v_max = 4.0;
double c1 = 0.2;
double c2 = 0.2;
double weight = 0.9;
int dimensionality;
std::vector<double> *gb_solution;
double *gb_fitness;
function *func;
particle(int dimensionality, std::vector<double> *gb_solution, double *gb_fitness, function *func) : dimensionality(dimensionality){
this->gb_solution = gb_solution;
this->gb_fitness = gb_fitness;
this->func = func;
// Blank initial solution and assign it also to pb
pb_solution, solution = std::vector<double>(dimensionality, 0);
// Init the velocity
for (int i = 0; i < dimensionality; i++)
velocity.push_back(rand_between(-v_max/3, v_max/3));
}
void update_fitness(){
fitness = func->compute(solution);
if (fitness < pb_fitness){
pb_solution = solution;
pb_fitness = fitness;
}
if (fitness < *gb_fitness){
*gb_solution = solution;
*gb_fitness = fitness;
}
}
void update_velocity(){
for (int d = 0; d < dimensionality; d++){
velocity.at(d) = weight * velocity.at(d) + c1 * rand_between(0, 1) * (pb_solution.at(d) - solution.at(d)) +
c2 * rand_between(0, 1) * (gb_solution->at(d) - solution.at(d));
if (velocity.at(d) > v_max)
velocity.at(d) = v_max;
else if (velocity.at(d) < -v_max)
velocity.at(d) = -v_max;
solution.at(d) += velocity.at(d);
if (solution.at(d) < func->lower_bound)
solution.at(d) = func->lower_bound;
else if (solution.at(d) > func->upper_bound)
solution.at(d) = func->upper_bound;
}
}
};
class particle_search : public search_function {
public:
particle_search(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
for (int i = 0; i < number_of_particles; i++){
particle p(dimensionality, &gb_solution, &gb_fitness, &func);
p.solution = generate_solution(dimensionality);
p.update_fitness();
particles.push_back(p);
}
for (int i = 0; i < max_iterations; i++){
for (int p = 0; p < particles.size(); p++){
particles.at(p).update_fitness();
particles.at(p).update_velocity();
}
}
return gb_fitness;
};
private:
// The global best solution and fitness
double gb_fitness = 99999999999999;
std::vector<double> gb_solution;
int number_of_particles = 100;
std::vector<particle> particles;
int max_iterations = 100;
};

@ -0,0 +1,41 @@
#pragma once
#include "search_function.h"
#include <algorithm>
class random_walk : public search_function {
public:
random_walk(function f) : search_function(f) {
}
double search(int permutations, int dimensionality) {
timer t;
t.start();
std::vector<double> r;
for (int i = 0; i < permutations; i++){
std::vector<double> dimension_vals;
for (int i = 0; i < dimensionality; i++) {
auto val = fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound;
dimension_vals.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
r.push_back(func.compute(dimension_vals));
}
t.end();
std::sort(r.begin(), r.end(), std::less<double>());
return r[0];
}
};

Binary file not shown.

Binary file not shown.

@ -0,0 +1,6 @@
The optimization functions can be either ran with the python script "run.py"
which will run all 3 search methods with all 15 search functions.
Or you can call the executable directly from the command line. Eg.
./Lab3 <0-14> <dimensionality> <seed> <1-5>

@ -0,0 +1,55 @@
from subprocess import check_output
import subprocess
import random
import matplotlib.pyplot as plt
import time
random.seed()
loc = "../build/Lab3"
f = open('out','w')
f.write("Timer values")
for function in range(3, 5):
print("Method: " + str(function))
for q in range(0, 15):
print("Function: " + str(q))
f.write(str(q) + "\n")
start = time.time()
subprocess.call([
loc,
str(q),
str(20),
str(random.randint(0, 2147483646)),
str(function)
])
end = time.time()
f.write(str(end-start) + "\n")
f.close()

Binary file not shown.

@ -0,0 +1,243 @@
\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage{sectsty}
\usepackage{rotating}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{13.6pt}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{Central Washington University of the Computer Science Department} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge Project 3 \\
\horrule{2pt} \\[0.5cm]
}
\author{\normalsize Mitchell Hansen \\[-6pt]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\section{Introduction}
For this lab we took our 15 optimization functions and ran them through
3 new methods of determining the global minimum. The functions being:
Differential evolution (DE) which uses a population approach with strategies
for computing new solutions, Genetic evolution (GE) which takes a genetic approach
with genes, crossover and mutation, and Particle swarm (PS) which simulates
swarm movement to find the global minimum.
\section{Methods}
Our rewrite in the previous lab allowed us to just extend three more
classes from the search function class we had implemented. These
extended classes were then called with a python script and the output
printed to the console where I was able to analyze the data. Each test
was ran 15 times using the python script and the data stored to a file.
Upon referencing multiple online sources, we also decided to use a different
method of initializing particle velocity vectors and velocity maximums. Settling
with velocityMaxium = 4.0, and the initial velocities being created between
velocityMaxium \textbackslash 3, and -velocityMaximum \textbackslash 3.
These values seemed to produce accurate results.
\section{Analysis}
This lab produced some interesting results regarding the performance of the
new functions. Overall, the three new functions (PS, GE, DE) were more
efficient and accurate than the previous 3 functions (Random Walk, Local Search,
Iterative Local Search), but there were some discrepancies with some
functions. These discrepancies showed themselves as completely inaccurate
results on some functions, while the method would then produce extremely accurate
results on other functions. For example, GE produced a 23185.53 average for DeJong,
the actual minimum being 0. Yet for the Michalewicz function GE produced an average
that was much more competitive to the the other functions.
Another interesting point on the performance of these functions can be seen when comparing
them to the values received from the previous search functions we used. Rosenbrocks saddle
is a great example of the performance difference, where Iterative Local Search's best
value was in the range of 2.51E+10. DE on the other hand was able to produce a minimum
value of 19 and PS a value of 37, massive increases in accuracy. Interestingly enough,
for rosenbrocks saddle GE produced a value similar to Iterative local search, a minimum
of 3.21E+09.
More differences between the three functions can be again found with the Rastrigin function.
ILS was able to produce a value of 83731.6, GE produced 65280, but PS and DE both had
massively more accurate results of: PS -> -6902.05, and DE -> -8000 which we believe is the
actual minimum of the Rastrigin function.
There are other examples of these new functions attaining greater accuracy than the previous
functions did, but that information can easily be seen in the results table in figure 5.1. One last point we
want to cover is the actual time performance of these algorithms. Previously Local Search and
Iterative Local Search both took an excessive amount of time to compute on solutions with
larger dimensions (20 +). Based on previous performance, it was estimated that the Griegwangk
function running with 30 dimensions would run for 8 hours using Iterative Local Search. To contrast
this, the complete computation time taken for the 15 functions, at 15 iterations, using all 3
search functions completed faster than one iteration of 20 dimensional Iterative Local Search
with the Griewagnk function.
\section{Conclusion}
Coming away from this lab we saw that these new functions have the ability to not only
improve the accuracy of our results, but also improve the running time of the search.
With this improved running time we could run more trials and get even more accurate results
than the ones that we are getting currently.
There were some difficulties and issues when running the tests for this lab. The first being
our inability to completely verify our results. We mentioned some discrepancies earlier
where GE produced values that were wildly inaccurate for some functions. It is unknown to
us whether this is simply a product of the strengths and weaknesses of this specific search
method, or if there is something wrong with out implementation. Another issue is that of the
Shekels Foxholes function. For Particle Swarm and Genetic Evolution there was no deviation from
the single value that they returned. Either the algorithm is able to deterministic
produce the apparent global minimum, or there is something wrong with the function.
\begin{figure}
\section{Results}
\caption{Computation comparison of DE, GA and PSO}
\hskip+4.0cm
\rotatebox{90.0}{
\scalebox{0.7}{
\small \centering
\label{Tab1d}
\begin{tabular}{c|lllll|lllll|lllll}
\noalign{\smallskip}\hline\noalign{\smallskip}
Problem & \multicolumn{5}{c}{DE}& \multicolumn{5}{|c|}{GA}
& \multicolumn{5}{c}{PSO} \\
\noalign{\smallskip}\hline\noalign{\smallskip}
& Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) \\ \noalign{\smallskip}\hline\noalign{\smallskip}
$f_1$ & -6112.33 & -6084.59 & 114.26 & 47.83 & 1.14 & -3276.12 & -3292.95 & 943.02 & 245.68 & 2.69 & -2871.98 & -2904.39 & 1194.77 & 322.06 & 0.12 \\
$f_2$ & 129.53 & 25.00 & 900.00 & 251.52 & 0.53 & 23185.53 & 22853.00 & 10310.00 & 3148.43 & 0.72 & 0.17 & 0.15 & 0.25 & 0.08 & 0.09 \\
$f_3$ & 26105.67 & 10019.00 & 168100.00 & 43662.88 & 0.78 & 5291234666.67 & 5017400000.00 & 5739020000.00 & 1539343402.74 & 0.68 & 421.98 & 200.19 & 1657.68 & 497.31 & 0.10 \\
$f_4$ & -7600.00 & -7960.00 & 2560.00 & 728.99 & 1.00 & 79752.00 & 81520.00 & 23240.00 & 8507.40 & 2.12 & -5206.62 & -5324.98 & 3479.78 & 1178.83 & 0.13 \\
$f_5$ & 0.00 & 0.00 & 0.00 & 0.00 & 1.08 & 145.86 & 150.55 & 51.89 & 17.68 & 2.31 & 9.17 & 8.93 & 5.88 & 1.95 & 0.13 \\
$f_6$ & 12.38 & 12.71 & 2.19 & 0.60 & 1.46 & 12.04 & 11.97 & 0.67 & 0.22 & 2.52 & 12.15 & 12.18 & 1.25 & 0.33 & 0.14 \\
$f_7$ & 19.06 & 19.01 & 0.62 & 0.16 & 1.67 & 36.69 & 36.60 & 5.76 & 1.54 & 4.20 & 20.55 & 20.45 & 2.63 & 0.68 & 0.18 \\
$f_8$ & 58.74 & 58.73 & 4.74 & 1.54 & 1.60 & 212.86 & 213.95 & 41.20 & 11.06 & 3.41 & -9.92 & -11.64 & 35.51 & 9.72 & 0.10 \\
$f_9$ & -83.30 & -80.69 & 21.87 & 6.99 & 2.09 & 276.38 & 276.83 & 14.65 & 4.35 & 4.10 & 251.53 & 288.37 & 173.05 & 64.83 & 0.14 \\
$f_{10}$ & -4959.12 & -4579.12 & 2896.23 & 966.10 & 3.02 & -4778.37 & -4822.17 & 978.82 & 327.79 & 4.72 & -4107.05 & -3830.50 & 2663.98 & 711.61 & 0.13 \\
$f_{11}$ & -8478.48 & -8821.20 & 5161.40 & 1330.20 & 3.56 & -3188.30 & -3181.83 & 1334.30 & 339.30 & 8.34 & -2899.33 & -2888.72 & 901.67 & 227.81 & 0.21 \\
$f_{12}$ & 0.00 & 0.00 & 0.00 & 0.00 & 1.48 & 8.00 & 8.01 & 0.69 & 0.17 & 2.70 & 7.02 & 7.08 & 1.30 & 0.37 & 0.15 \\
$f_{13}$ & -4.28 & -4.22 & 2.71 & 0.83 & 3.06 & -4.27 & -4.22 & 2.30 & 0.57 & 5.54 & -10.39 & -9.86 & 4.92 & 1.50 & 0.14 \\
$f_{14}$ & -18.99 & -19.00 & 0.04 & 0.01 & 1.47 & -10.88 & -10.53 & 3.70 & 1.00 & 3.65 & -16.07 & -16.15 & 5.22 & 1.59 & 0.14 \\
$f_{15}$ & -21.91 & -23.03 & 8.39 & 2.95 & 6.05 & -14.64 & -14.64 & 0.00 & 0.00 & 12.55 & -18.70 & -18.70 & 0.00 & 0.00 & 0.27 \\ \noalign{\smallskip}\hline\noalign{\smallskip}
& & & & & & & & & & & & & & & \\
\noalign{\smallskip}\hline\noalign{\smallskip} \multicolumn{16}{l}{\tiny $^1$ ThinkPad, 3.4GHz Intel Core i7 (3rd gen), 16 GB RAM}
\end{tabular}
}}
\end{figure}
\newpage
\section{Previous Results}
\hskip+2.5cm\scalebox{0.5}{
\rotatebox{90}{
\begin{tabular}{l || l | l | l | l | l | l | l | l | l | l | l | l | l | l | l}
\textbf{Iterative Local Search, 20 dimensions} \\
\hline \\
Function & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
\hline \\
& -4549.4 & 0.0605 & 2.51E+10 & 83731.6 & 0.651206 & 14.7944 & 21.9681 & 279.695 & 321.001 & -1566.84 & -5338.46 & 9.21621 & -0.142619 & -17.715 & -11.8869 \\
& -6050.16 & 0.0605 & 4.55E+10 & 80745.8 & 0.268086 & 16.284 & 19.3337 & 343.725 & 313.969 & -1993.75 & -4148.75 & 9.46446 & -0.548652 & -18.1772 & -11.5925 \\
& -5398.23 & 0.0591995 & 5.06E+10 & 82401.3 & 0.032413 & 15.3526 & 23.9768 & 296.889 & 321.956 & -4633.19 & -4848.21 & 9.01646 & 0.218791 & -18.4282 & -11.5925 \\
& -5675.22 & 0.0605 & 4.42E+10 & 82591.3 & 0.00544314 & 14.7622 & 22.6234 & 331.276 & 323.228 & -4014.04 & -5436.05 & 9.26537 & 0.626347 & -18.2969 & -12.1455 \\
& -3976.37 & 0.0588747 & 3.25E+10 & 82036.8 & 0.0128344 & 13.9223 & 25.6647 & 325.015 & 329.982 & -1246.54 & -4823.87 & 9.12409 & -1.33997 & -17.3054 & -11.5925 \\
& -5082.38 & 0.0605 & 2.61E+10 & 87382.5 & 0.0201434 & 14.3422 & 21.3897 & 396.392 & 326.205 & -392.775 & -6280.62 & 9.13477 & -2.26781 & -18.1703 & -11.5925 \\
& -5891.86 & 0.0605 & 3.85E+10 & 89279.1 & 0.684922 & 15.2594 & 23.0754 & 329.302 & 326.381 & -337.14 & -3871.16 & 9.02972 & -0.0242582 & -18.4513 & -11.5925 \\
& -5003.93 & 0.0605 & 3.00E+10 & 85879 & 0.0151074 & 14.8268 & 19.9157 & 325.527 & 314.19 & -1212.15 & -4189.52 & 9.17302 & 0.0681864 & -18.2963 & -11.5925 \\
& -5418.57 & 0.0605 & 4.30E+10 & 82890.7 & 0.00544314 & 15.9129 & 20.2634 & 332.571 & 325.788 & -1548.21 & -5548.41 & 9.39065 & -0.906265 & -18.5396 & -11.5925 \\
& -5516.7 & 0.0599162 & 3.51E+10 & 82665.9 & 0.03008 & 16.1692 & 19.9074 & 388.651 & 327.169 & 923.714 & -563.104 & 9.20288 & -1.59829 & -18.1054 & -11.5925 \\
& -3937.92 & 0.0547374 & 3.35E+10 & 86354.3 & 0.0153078 & 15.3926 & 19.532 & 312.15 & 322.111 & -1598.94 & -4648.01 & 8.87789 & -1.49817 & -17.8506 & -11.5925 \\
& -4588.88 & 0.0605 & 3.51E+10 & 81101.4 & 0.00542657 & 15.7841 & 21.7808 & 357.263 & 330.684 & -1319.67 & -4261.9 & 9.33048 & -1.93719 & -18.2627 & -12.1791 \\
& -5082.97 & 0.0559769 & 2.42E+10 & 76218.4 & 0.00544314 & 15.1429 & 22.4065 & 346.209 & 324.783 & 1500.62 & -6032.9 & 9.18852 & -1.88437 & -18.2285 & -11.5925 \\
& -6070.01 & 0.0594556 & 3.21E+10 & 83486.2 & 0.0201913 & 14.966 & 19.342 & 393.145 & 324.682 & -404.273 & -5094.61 & 8.57302 & 0.126058 & -16.446 & -11.5925 \\
& -5043.31 & 0.0605 & 1.85E+10 & 82935.5 & 0.220955 & 14.0295 & 20.2134 & 316.233 & 325.996 & 2079.2 & -4572.43 & 9.70061 & -1.33897 & -18.2227 & -11.5925 \\
& -5161.34 & 0.0605 & 3.87E+10 & 85337.7 & 0.00541984 & 14.9478 & 19.5923 & 274.232 & 327.758 & -1727.17 & -4684.33 & 9.01989 & 0.290542 & -18.4796 & -12.1791 \\
& -4589.3 & 0.060484 & 3.08E+10 & 83765.5 & 0.01776 & 14.714 & 20.0449 & 314.196 & 325.896 & -1632.08 & -5179.06 & 8.52944 & -0.524841 & -18.3505 & -18.4163 \\
& -4332.6 & 0.0600202 & 6.77E+10 & 81498.7 & 0.0153003 & 16.5447 & 20.0096 & 314.165 & 307.423 & 1567.7 & -4461.73 & 9.43874 & -1.20997 & -18.3268 & -11.5925 \\
& -6267.41 & 0.0605 & 4.65E+10 & 81603.3 & 1.88596 & 16.1234 & 20.2482 & 316.52 & 317.494 & -5550.9 & -3693.39 & 9.4962 & 0.510028 & -18.1621 & -11.5925 \\
& -4588.98 & 0.0605 & 4.06E+10 & 85076.2 & 0.0225431 & 14.0527 & 20.8396 & 325.67 & 324.854 & -2326.43 & -5346.36 & 9.33666 & -1.32004 & -18.555 & -11.5925 \\
& -5477.69 & 0.0604347 & 5.13E+10 & 80799.5 & 0.00535823 & 14.7108 & 20.8015 & 261.241 & 319.17 & 485.619 & -4782.73 & 9.17792 & -1.22079 & -17.7232 & -18.1189 \\
& -6109.42 & 0.0472961 & 2.54E+10 & 83373.9 & 0.177322 & 15.6127 & 22.9987 & 286.368 & 321.812 & -2998.41 & -4456.01 & 8.6997 & -2.29998 & -18.4625 & -11.5925 \\
& -4885.09 & 0.0570039 & 4.39E+10 & 80163.4 & 0.255374 & 15.6927 & 23.8355 & 324.354 & 325.002 & -1578.78 & -4075.51 & 9.10547 & -0.131814 & -17.7901 & -11.5925 \\
& -4035.51 & 0.0600693 & 4.32E+10 & 81415.3 & 0.0152417 & 14.9575 & 19.5572 & 296.019 & 321.434 & 824.034 & -4011.91 & 9.31902 & -1.51993 & -17.8755 & -11.5924 \\
& -3917.22 & 0.0586818 & 4.16E+10 & 87878.4 & 0.0128369 & 14.4221 & 19.8007 & 375.301 & 300.768 & 1043.95 & -5037.25 & 9.57629 & -1.73324 & -18.2571 & -11.5925 \\
& -5754.04 & 0.0575467 & 2.76E+10 & 83622.3 & 0.272711 & 17.8043 & 20.3977 & 370.717 & 317.424 & -1133.68 & -4973.3 & 9.0252 & -1.10353 & -18.3087 & -11.5925 \\
& -4786.87 & 0.0605 & 5.54E+10 & 81190 & 0.0324796 & 14.4401 & 19.8204 & 358.965 & 296.103 & 692.475 & -4121.91 & 8.76355 & -0.860885 & -18.484 & -18.4163 \\
& -4510.47 & 0.0597792 & 3.24E+10 & 83530.5 & 4.0042 & 16.0272 & 20.4454 & 225.399 & 326.39 & -478.625 & -5370.33 & 9.32801 & -1.13941 & -18.4418 & -11.5729 \\
& -5398.26 & 0.0605 & 2.12E+10 & 85510.6 & 0.43707 & 14.8375 & 19.3774 & 332.986 & 327.903 & -985.672 & -316.499 & 8.94067 & 0.336942 & -17.9256 & -11.5925 \\
& -4253.69 & 0.0600716 & 3.11E+10 & 84551 & 0.0128391 & 15.5474 & 21.1043 & 361.928 & 322.473 & -2662.15 & -5159.38 & 7.88002 & -0.784451 & -18.5094 & -11.5924 \\
\hline \\
Avg. & -5045.1266666667 & 0.05921826 & 3.70E+10 & 8.33E+04 & 3.06E-01 & 1.52E+01 & 2.10E+01 & 3.27E+02 & 3.21E+02 & -1.07E+03 & -4.51E+03 & 9.11E+00 & -8.39E-01 & -1.81E+01 & -1.23E+01 \\
Med. & -5062.845 & 0.06045935 & 35130150000 & 83154.7 & 0.02016735 & 15.05445 & 20.33055 & 325.5985 & 323.955 & -1229.345 & -4733.53 & 9.17547 & -1.0048975 & -18.2599 & -11.5925 \\
Std. Dev. & 698.8094252189 & 0.0026900942 & 10975111347.1528 & 2619.8872400694 & 0.791604351 & 0.8539153929 & 1.6317417953 & 39.4394076324 & 8.0216805796 & 1808.4389363295 & 1268.809305736 & 0.3628603461 & 0.8562948838 & 0.4364346365 & 2.0376857083 \\
\hline \\
\end{tabular}
}
}
\small{Iterative Local Search Running Times in Seconds}
\hskip+2.5cm\scalebox{0.5}{
\begin{tabular}{l || l | l | l}
\textbf{Dimensions} & 10 & 20 & 30 \\
\hline \\
Function 1 & 5.355587244 & 21.5247523785 & 47.5882720947 \\
Function 2 & 0.4999251366 & 1.151144743 & 2.4649145603 \\
Function 3 & 0.0042607784 & 0.0112228394 & 0.0144929886 \\
Function 4 & 0.0058951378 & 0.0114533901 & 0.0161828995 \\
Function 5 & 150.1059572697 & 2928.3961615563 & N/A \\
Function 6 & 0.0101454258 & 0.0255510807 & 0.0222308636 \\
Function 7 & 32.4964332581 & 41.5021996498 & 168.8056237698 \\
Function 8 & 0.3526818752 & 1.6770370007 & 3.8826031685 \\
Function 9 & 0.0110986233 & 0.0125215054 & 0.0229070187 \\
Function 10 & 0.0899729729 & 0.2644715309 & 0.7342042923 \\
Function 11 & 30.093629837 & 165.0208876133 & 384.6772966385 \\
Function 12 & 297.458874464 & 25.3617525101 & 21.2174470425 \\
Function 13 & 0.0197796822 & 0.0436241627 & 0.0463643074 \\
Function 14 & 1.5726833344 & 7.7616007328 & 9.7854065895 \\
Function 15 & 6.6486163139 & 23.9164574146 & 32.7224471569 \\
\hline \\
\end{tabular}
} \\[0.5cm]
\end{document}

@ -0,0 +1,46 @@
#pragma once
class search_function {
public:
function func;
search_function(function f) : func(f) {
};
virtual double search(int permutations, int dimensionality) = 0;
protected:
std::vector<double> generate_solution(int dimensionality){
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++) {
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
return tmp;
}
std::vector<std::vector<double>> generate_population(int dimensionality, int population_count){
std::vector<std::vector<double>> tmp;
for (int i = 0; i < dimensionality; i++) {
tmp.push_back(generate_solution(dimensionality));
}
return tmp;
}
double check_bounds(double input){
if (input > func.upper_bound)
return func.upper_bound;
else if (input < func.lower_bound)
return func.lower_bound;
else
return input;
}
};

@ -0,0 +1,181 @@
// http://www.math.keio.ac.jp/~matumoto/ver980409.html
// This is the ``Mersenne Twister'' random number generator MT19937, which
// generates pseudorandom integers uniformly distributed in 0..(2^32 - 1)
// starting from any odd seed in 0..(2^32 - 1). This version is a recode
// by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by
// Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in
// July-August 1997).
//
// Effectiveness of the recoding (on Goedel2.math.washington.edu, a DEC Alpha
// running OSF/1) using GCC -O3 as a compiler: before recoding: 51.6 sec. to
// generate 300 million random numbers; after recoding: 24.0 sec. for the same
// (i.e., 46.5% of original time), so speed is now about 12.5 million random
// number generations per second on this machine.
//
// According to the URL <http://www.math.keio.ac.jp/~matumoto/emt.html>
// (and paraphrasing a bit in places), the Mersenne Twister is ``designed
// with consideration of the flaws of various existing generators,'' has
// a period of 2^19937 - 1, gives a sequence that is 623-dimensionally
// equidistributed, and ``has passed many stringent tests, including the
// die-hard test of G. Marsaglia and the load test of P. Hellekalek and
// S. Wegenkittl.'' It is efficient in memory usage (typically using 2506
// to 5012 bytes of static data, depending on data type sizes, and the code
// is quite short as well). It generates random numbers in batches of 624
// at a time, so the caching and pipelining of modern systems is exploited.
// It is also divide- and mod-free.
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation (either version 2 of the License or, at your
// option, any later version). This library is distributed in the hope that
// it will be useful, but WITHOUT ANY WARRANTY, without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU Library General Public License for more details. You should have
// received a copy of the GNU Library General Public License along with this
// library; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307, USA.
//
// The code as Shawn received it included the following notice:
//
// Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. When
// you use this, send an e-mail to <matumoto@math.keio.ac.jp> with
// an appropriate reference to your work.
//
// It would be nice to CC: <Cokus@math.washington.edu> when you write.
//
#include <stdio.h>
#include <stdlib.h>
//
// uint32 must be an unsigned integer type capable of holding at least 32
// bits; exactly 32 should be fastest, but 64 is better on an Alpha with
// GCC at -O3 optimization so try your options and see what's best for you
//
typedef unsigned long uint32;
#define N (624) // length of state vector
#define M (397) // a period parameter
#define K (0x9908B0DFU) // a magic constant
#define hiBit(u) ((u) & 0x80000000U) // mask all but highest bit of u
#define loBit(u) ((u) & 0x00000001U) // mask all but lowest bit of u
#define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u
#define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v
static uint32 state[N+1]; // state vector + 1 extra to not violate ANSI C
static uint32 *next; // next random value is computed from here
static int left = -1; // can *next++ this many times before reloading
void seedMT(uint32 seed)
{
//
// We initialize state[0..(N-1)] via the generator
//
// x_new = (69069 * x_old) mod 2^32
//
// from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's
// _The Art of Computer Programming_, Volume 2, 3rd ed.
//
// Notes (SJC): I do not know what the initial state requirements
// of the Mersenne Twister are, but it seems this seeding generator
// could be better. It achieves the maximum period for its modulus
// (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if
// x_initial can be even, you have sequences like 0, 0, 0, ...;
// 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,
// 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.
//
// Even if x_initial is odd, if x_initial is 1 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 0,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,
// ...
//
// and if x_initial is 3 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 1,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,
// ...
//
// The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is
// 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It
// also does well in the dimension 2..5 spectral tests, but it could be
// better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).
//
// Note that the random number user does not see the values generated
// here directly since reloadMT() will always munge them first, so maybe
// none of all of this matters. In fact, the seed values made here could
// even be extra-special desirable if the Mersenne Twister theory says
// so-- that's why the only change I made is to restrict to odd seeds.
//
register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = state;
register int j;
for(left=0, *s++=x, j=N; --j;
*s++ = (x*=69069U) & 0xFFFFFFFFU);
}
uint32 reloadMT(void)
{
register uint32 *p0=state, *p2=state+2, *pM=state+M, s0, s1;
register int j;
if(left < -1)
seedMT(4357U);
left=N-1, next=state+1;
for(s0=state[0], s1=state[1], j=N-M+1; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
for(pM=state, j=M; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1=state[0], *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1 ^= (s1 >> 11);
s1 ^= (s1 << 7) & 0x9D2C5680U;
s1 ^= (s1 << 15) & 0xEFC60000U;
return(s1 ^ (s1 >> 18));
}
uint32 randomMT(void)
{
uint32 y;
if(--left < 0)
return(reloadMT());
y = *next++;
y ^= (y >> 11);
y ^= (y << 7) & 0x9D2C5680U;
y ^= (y << 15) & 0xEFC60000U;
return(y ^ (y >> 18));
}
#ifdef NOCOMPILE
int main(void)
{
int j;
// you can seed with any uint32, but the best are odds in 0..(2^32 - 1)
seedMT(4357U);
// print the first 2,002 random numbers seven to a line as an example
for(j=0; j<2002; j++)
printf(" %10lu%s", (unsigned long) randomMT(), (j%7)==6 ? "\n" : "");
return(EXIT_SUCCESS);
}
#endif

@ -0,0 +1,12 @@
struct timer{
std::chrono::high_resolution_clock::time_point t1;
std::chrono::high_resolution_clock::time_point t2;
void start(){t1 = std::chrono::high_resolution_clock::now();}
void end(){t2 = std::chrono::high_resolution_clock::now();}
double duration(){ return std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();}
};
double rand_between(double lower, double upper){
return lower + (randomMT() * 1.0 / UINT32_MAX) * (upper - lower);
}

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.5.1)
project(Lab4)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
file(GLOB SOURCES "*.cpp")
file(GLOB HEADERS "*.h" "*.hpp")
set(SOURCE_FILES ${HEADERS} ${SOURCES} )
add_executable(Lab4 ${SOURCE_FILES})

Binary file not shown.

@ -0,0 +1,169 @@
#pragma once
#include "search_function.h"
class differential_evolution : public search_function {
public:
differential_evolution(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start
std::vector<std::vector<double>> population = generate_population(50, dimensionality);
for (int g = 0; g < maximum_generation_number; g++) {
for (int i = 0; i < population.size(); i++) {
// Create the U, temp vector to hold values
std::vector<double> u(dimensionality, 0);
// select a random dimension
int j_rand = rand() % dimensionality;
for (int j = j_rand; j < dimensionality; j++){
// Accept changes if rng returns < 0.9
if (randomMT() * 1.0 / RAND_MAX < 0.9)
u.at(j) = check_bounds(compute_with_strategy(&population, j, i));
else
u.at(j) = population.at(i).at(j);
}
// If the new population has a better fitness, replace it
if (func.compute(population.at(i)) > func.compute(u))
population.at(i) = u;
}
}
// Generation is done, return the best value from the population
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
return func.compute(population[0]);
};
void set_strategy(int strategy){
this->strategy = strategy;
}
private:
// G
int maximum_generation_number = 30;
// Tuning variable
double tuning_variable_f = 0.8;
double tuning_variable_lambda = 1.0;
int strategy = 0;
// Compute using different strategies
double compute_with_strategy(std::vector<std::vector<double>> *population, int j, int i){
// Setup and find the best solution in the population that was passed in
std::vector<double> best_solution;
double best_fitness = 999999999999;
for (auto p: *population){
double val = func.compute(p);
if (val < best_fitness){
best_fitness = val;
best_solution = p;
}
}
// Depending on the strategy, determine the new solution at J
switch(strategy){
case 1: {
std::vector<int> r = distinct_indices(2, population[0].size());
return best_solution[j] + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 2: {
std::vector<int> r = distinct_indices(3, population[0].size());
return population->at(r[0]).at(j) + tuning_variable_f * (population->at(r[1]).at(j) - population->at(r[2]).at(j));
}
case 3:{
std::vector<int> r = distinct_indices(2, population[0].size());
return population->at(i).at(j) + tuning_variable_lambda * (best_solution.at(j) - population->at(i).at(j)) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 4:{
std::vector<int> r = distinct_indices(4, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 5:{
std::vector<int> r = distinct_indices(5, population[0].size());
return population->at(r[4]).at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 6:{
std::vector<int> r = distinct_indices(2, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 7:{
std::vector<int> r = distinct_indices(3, population[0].size());
return population->at(r[0]).at(j) + tuning_variable_f * (population->at(r[1]).at(j) - population->at(r[2]).at(j));
}
case 8:{
std::vector<int> r = distinct_indices(2, population[0].size());
return population->at(i).at(j) + tuning_variable_lambda * (best_solution.at(j) - population->at(i).at(j)) + tuning_variable_f * (population->at(r[0]).at(j) - population->at(r[1]).at(j));
}
case 9:{
std::vector<int> r = distinct_indices(4, population[0].size());
return best_solution.at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
case 10:{
std::vector<int> r = distinct_indices(5, population[0].size());
return population->at(r[4]).at(j) + tuning_variable_f * (population->at(r[0]).at(j) + population->at(r[1]).at(j) - population->at(r[2]).at(j) - population->at(r[3]).at(j));
}
}
}
std::vector<int> distinct_indices(int count, int max){
std::vector<int> indices;
for (int q = 0; q < count; q++) {
int val = 1 + (rand() % (max - 1));
while (std::count(indices.begin(), indices.end(), val) != 0)
val = randomMT() % max;
indices.push_back(val);
}
return indices;
}
};

@ -0,0 +1,87 @@
#pragma once
#include "search_function.h"
class firefly : public search_function {
public:
firefly(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start population
for (int p = 0; p < population_size; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
for (int t = 0; t < iterations; t++){
// Compare each fly to each other
for (int i = 0; i < population.size(); i++){
for (int j = 0; j < population.size(); j++){
// If it finds one brighter
if (func.compute(population.at(j)) < func.compute(population.at(i))){
// Move towards it for each dimension
for (int d = 0; d < dimensionality; d++){
population.at(i).at(d) =
population.at(i).at(d) +
attractiveness(distance(population.at(i), population.at(j))) *
(population.at(j).at(d) - population.at(i).at(d)) + alpha *
rand_between(-0.5, 0.5);
check_solution_bounds(&population.at(i));
}
}
}
}
}
// Sort the population and return the best fitness
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
return func.compute(population.front());
};
private:
// Distance between two vector points
double distance(std::vector<double> a, std::vector<double> b){
double sum = 0;
for (int i = 0; i < a.size(); i++){
sum += pow(a.at(i) - b.at(i), 2);
}
return sqrt(sum);
}
// Inverse square law basically
double attractiveness(double distance){
return beta * exp(-gamma * distance * distance);
}
// Constants
double gamma = 1.0;
double alpha = 0.5;
double beta = 0.2;
int iterations = 100;
int population_size = 50;
std::vector<std::vector<double>> population;
};

@ -0,0 +1,319 @@
std::vector<double> c = {0.806,0.517,0.1,0.908,0.965,0.669,0.524,0.902,0.351,0.876,0.462,
0.491,0.463,0.741,0.352,0.869,0.813,0.811,0.0828,0.964,0.789,0.360,0.369,
0.992,0.332,0.817,0.632,0.883,0.608,0.326};
double a[][10] =
{
{9.681,0.667,4.783,9.095,3.517,9.325,6.544,0.211,5.122,2.02},
{9.4,2.041,3.788,7.931,2.882,2.672,3.568,1.284,7.033,7.374},
{8.025,9.152,5.114,7.621,4.564,4.711,2.996,6.126,0.734,4.982},
{2.196,0.415,5.649,6.979,9.510,9.166,6.304,6.054,9.377,1.426},
{8.074,8.777,3.467,1.863,6.708,6.349,4.534,0.276,7.633,1.567},
{7.650,5.658,0.720,2.764,3.278,5.283,7.474,6.274,1.409,8.208},
{1.256,3.605,8.623,6.905,4.584,8.133,6.071,6.888,4.187,5.448},
{8.314,2.261,4.24,1.781,4.124,0.932,8.129,8.658,1.208,5.762},
{0.226,8.858,1.42,0.954,1.622,4.698,6.228,9.096,0.972,7.637},
{7.305,2.228,1.242,5.928,9.133,1.826,4.06,5.204,8.713,8.247},
{0.652,7.027,0.508,4.876,8.807,4.632,5.808,6.937,3.291,7.016},
{2.699,3.516,5.847,4.119,4.461,7.496,8.817,0.69,6.593,9.789},
{8.327,3.897,2.017,9.57,9.825,1.15,1.395,3.885,6.354,0.109},
{2.132,7.006,7.136,2.641,1.882,5.943,7.273,7.691,2.88,0.564},
{4.707,5.579,4.08,0.581,9.698,8.542,8.077,8.515,9.231,4.67},
{8.304,7.559,8.567,0.322,7.128,8.392,1.472,8.524,2.277,7.826},
{8.632,4.409,4.832,5.768,7.05,6.715,1.711,4.323,4.405,4.591},
{4.887,9.112,0.17,8.967,9.693,9.867,7.508,7.77,8.382,6.74},
{2.44,6.686,4.299,1.007,7.008,1.427,9.398,8.48,9.95,1.675},
{6.306,8.583,6.084,1.138,4.350,3.134,7.853,6.061,7.457,2.258},
{0.652,2.343,1.37,0.821,1.31,1.063,0.689,8.819,8.833,9.07},
{5.558,1.272,5.756,9.857,2.279,2.764,1.284,1.677,1.244,1.234},
{3.352,7.549,9.817,9.437,8.687,4.167,2.57,6.54,0.228,0.027},
{8.798,0.88,2.37,0.168,1.701,3.68,1.231,2.39,2.499,0.064},
{1.46,8.057,1.337,7.217,7.914,3.615,9.981,9.198,5.292,1.224},
{0.432,8.645,8.774,0.249,8.081,7.461,4.416,0.652,4.002,4.644},
{0.679,2.8,5.523,3.049,2.968,7.225,6.73,4.199,9.614,9.229},
{4.263,1.074,7.286,5.599,8.291,5.2,9.214,8.272,4.398,4.506},
{9.496,4.83,3.15,8.27,5.079,1.231,5.731,9.494,1.883,9.732},
{4.138,2.562,2.532,9.661,5.611,5.5,6.886,2.341,9.699,6.5}
};
double schwefel(std::vector<double> input){
int upper_bound = 512;
int lower_bound = -512;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += (-input[i]) * std::sin(std::sqrt(std::abs(input[i])));
}
return sum;
}
double first_de_jong(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2);
}
return sum;
}
double rosenbrock(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 100 * std::pow((std::pow(input[i], 2) - input[i + 1]), 2) + std::pow((1 - input[i]), 2);
}
return sum;
}
double rastrigin(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) - 10 * std::cos(2 * M_PI * input[i]);
}
sum *= 2 * input.size();
return sum;
}
double griewangk(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size(); i++){
sum += std::pow(input[i], 2) / 4000;
}
double product = 1;
for (int i = 0; i < input.size(); i++){
product *= std::cos(input[i] / sqrt(i + 1));
}
return 1 + sum - product;
}
double sine_envelope_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 0.5 + (std::pow(std::sin(std::pow(input[i], 2) + std::pow(input[i + 1], 2) - 0.5), 2)) /
(1 + 0.001 * (std::pow(input[i], 2) + std::pow(input[i + 1], 2)));
}
return sum;
}
double stretched_v_sine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 4) *
std::pow(std::sin(50 * std::pow(std::pow(input[i], 2) + std::pow(input[i + 1], 2), 1.0 / 10)), 2) + 1;
}
return sum;
}
double ackleys_one(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += (1.0 / pow(M_E, 0.2)) *
std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2)) +
3 * std::cos(2 * input[i]) +
std::sin(2 * input[i + 1]);
}
return sum;
}
double ackleys_two(std::vector<double> input){
int upper_bound = 32;
int lower_bound = -32;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++){
sum += 20 + M_E -
(20 / (std::pow(M_E, 0.2) * std::sqrt(((std::pow(input[i], 2) + std::pow(input[i+1], 2) + 1) / 2)))) -
std::pow(M_E, 0.5 * std::cos(2 * M_PI * input[i]) + cos(2 * M_PI * input[i + 1]));
}
return sum;
}
double egg_holder(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += -input[i] * std::sin(std::sqrt(abs(input[i] - input[i + 1] - 47))) -
(input[i + 1] + 47) * std::sin(std::sqrt(std::abs(input[i + 1] + 47 + input[i] / 2)));
}
return sum;
}
double rana(std::vector<double> input){
int upper_bound = 500;
int lower_bound = -500;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += input[i] * std::sin(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::cos(std::sqrt(std::abs(input[i + 1] + input[i] + 1))) +
(input[i + 1] + 1) *
std::cos(std::sqrt(std::abs(input[i + 1] - input[i] + 1))) *
std::sin(std::sqrt(std::abs(input[i + 1] + input[i] + 1)));
}
return sum;
}
double pathological(std::vector<double> input){
int upper_bound = 100;
int lower_bound = -100;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += 0.5 +
(std::pow(std::sin(std::sqrt(100 * std::pow(input[i], 2) + std::pow(input[i + 1], 2))), 2) - 0.5) /
(1 + 0.001 * std::pow(std::pow(input[i], 2) - 2 * input[i] * input[i + 1] + std::pow(input[i + 1], 2), 2));
}
return sum;
}
double michalewicz(std::vector<double> input){
int upper_bound = M_PI;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::sin(input[i]) * std::pow(std::sin(i * std::pow(input[i], 2) / M_PI), 20);
}
return -sum;
}
double masters_cosine_wave(std::vector<double> input){
int upper_bound = 30;
int lower_bound = -30;
double sum = 0;
for (int i = 0; i < input.size() - 1; i++) {
sum += std::pow(M_E, -(1/8) * (std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i + 1] * input[i])) *
std::cos(4 * std::sqrt(std::pow(input[i], 2) + std::pow(input[i + 1], 2) + 0.5 * input[i] * input[i + 1]));
}
return -sum;
}
double shekels_foxholes(std::vector<double> input){
int upper_bound = 10;
int lower_bound = 0;
double sum = 0;
for (int i = 0; i < c.size() - 1; i++) {
double bottom_sum = 0;
for (int q = 0; q < input.size(); q++){
bottom_sum = std::pow(input.at(q) - a[i][q], 2);
}
sum += 1 / (bottom_sum + c[i]);
}
return -sum;
}
double set_within(double val, double prior_upper, double prior_lower, double after_upper, double after_lower){
return ((after_upper - after_lower) * (val - prior_lower) / (prior_upper - prior_lower)) + after_lower;
}
struct function {
double (*function_pointer)(std::vector<double>);
double range = 0;
double upper_bound = 0;
double lower_bound = 0;
timer t;
function(){};
function(double (*func)(std::vector<double>), double upper_bound, double lower_bound) {
function_pointer = func;
this->upper_bound = upper_bound;
this->lower_bound = lower_bound;
}
double compute(std::vector<double> input) {
for (auto v: input) {
if (v <= lower_bound && v >= upper_bound) {
std::cout << "Function exceeded bounds";
return 0;
}
}
double res = function_pointer(input);
return res;
};
};

@ -0,0 +1,167 @@
#pragma once
#include "search_function.h"
class genetic_algorithm : public search_function {
public:
genetic_algorithm(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
elitism = elitism_rate * number_of_solutions;
// Set up random start population
std::vector<std::vector<double>> population;
for (int p = 0; p < number_of_solutions; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
for (int i = 0; i < max_iterations; i++){
// Setup the random new population
std::vector<std::vector<double>> new_population;
for (int p = 0; p < number_of_solutions; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
new_population.push_back(tmp);
}
for (int s = 0; s < number_of_solutions; s += 2){
auto p1p2 = select(&population);
crossover(&std::get<0>(p1p2), &std::get<1>(p1p2));
mutate(&std::get<0>(p1p2));
mutate(&std::get<1>(p1p2));
}
reduce(&population, &new_population);
for (auto q: population){
double val = func.compute(q);
if (val < best_fitness)
best_fitness = val;
}
}
return best_fitness;
};
private:
double crossover_rate = 0.90;
double elitism_rate = 0.2;
int elitism = 10;
double mutation_rate = 0.008;
double mutation_range = 0.1;
double muration_precision = 3.5;
double best_fitness = 99999999999999999;
int number_of_solutions = 50;
int max_iterations = 100;
double get_fitness(std::vector<std::vector<double>> *population){
double fitness_sum = 0;
for (auto p: *population){
double fitness = func.compute(p);
if (fitness >= 0)
fitness_sum += 1 / (1 + fitness);
else
fitness_sum += 1 + abs(fitness);
}
return fitness_sum;
}
int select_parent(std::vector<std::vector<double>> *population){
double r = fmod(randomMT(), total_fitness(population));
int s = 0;
while (s < population->size()-1 && (r - func.compute(population->at(s)) > 0)) {
r -= func.compute(population->at(s++));
}
return s;
}
std::tuple<std::vector<double>, std::vector<double>> select(std::vector<std::vector<double>> *population){
auto p1 = population->at(select_parent(population));
auto p2 = population->at(select_parent(population));
return std::make_tuple(p1, p2);
};
void mutate(std::vector<double> *solution){
for (auto i: *solution){
if ((randomMT() * 1.0 / UINT32_MAX) < mutation_rate){
i += ((randomMT() * 1.0 / UINT32_MAX) * 2 - 1) * (func.upper_bound - func.lower_bound) *
mutation_range * pow(2, (-1 * (randomMT() * 1.0 / UINT32_MAX) * muration_precision));
}
}
}
void crossover(std::vector<double> *parent1, std::vector<double> *parent2){
if ((randomMT() * 1.0 / UINT32_MAX) < crossover_rate){
int d = randomMT() % (parent1->size() - 1) + 1;
int dim = parent1->size();
std::vector<double> temp;
temp.insert(temp.begin(), parent1->begin(), parent1->begin() + d);
parent1->erase(parent1->begin(), parent1->begin() + d);
parent1->insert(parent1->end(), parent2->begin() + dim - d, parent2->end());
parent2->erase(parent2->begin() + dim - d, parent2->end());
parent2->insert(parent2->end(), temp.begin(), temp.end());
}
}
void reduce(std::vector<std::vector<double>> *population, std::vector<std::vector<double>> *new_population){
std::sort(population->begin(), population->end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
std::sort(new_population->begin(), new_population->end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
for (int s = 0; s < elitism; s++) {
new_population->at(elitism + 1 - s) = population->at(s);
}
*population = *new_population;
}
double total_fitness(std::vector<std::vector<double>> *population){
double val = 0;
for (auto i: *population)
val += func.compute(i);
return val;
}
};

@ -0,0 +1,138 @@
#pragma once
#include "search_function.h"
class harmony : public search_function {
public:
harmony(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
this->dimensionality = dimensionality;
// Set up random start population
for (int p = 0; p < population_size; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
double best_fitness = func.compute(population.at(0));
// Do a thousand iterations
int r = 0;
while (r < 1000){
// The rng to determine which of the 3 we chose
double rng = rand_between(0, 1);
// Accept up the the specified percentage, re init the rest
if (rng > r_accept) {
accept_and_generate();
}
// Harmonize
else if (rng > r_pa) {
for (int p = 0; p < population.size(); p++) {
for (int d = 0; d < dimensionality; d++) {
population.at(p).at(d) = population.at(p).at(d) + rand_between(1, 2) * rand_between(-1, 1);
}
}
}
// Introduce some stochasticity
else{
population.clear();
for (int p = 0; p < population_size; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
}
// Sort the array and find the best fitness, record
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
if (func.compute(population.at(0)) < best_fitness)
best_fitness = func.compute(population.at(0));
r++;
}
return func.compute(population.at(0));
};
private:
double r_accept = 0.8;
double r_pa = 0.1;
int population_size = 50;
int dimensionality = 0;
void accept_and_generate(){
// Resort the population so the best will be at(0)
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
// Keep up to the accept rate
std::vector<std::vector<double>> tmp_pop;
for (int i = 0; (1.0 * i / population.size()) < r_accept; i++){
tmp_pop.push_back(population.at(i));
}
// Repopulate with random values
for (int p = 0; p < population_size - tmp_pop.size(); p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
tmp_pop.push_back(tmp);
}
population = tmp_pop;
}
std::vector<std::vector<double>> population;
};

@ -0,0 +1,65 @@
#pragma once
#include "search_function.h"
class iterative_local : public search_function {
public:
iterative_local(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set up random start
std::vector<double> global_best_solution;
for (int i = 0; i < dimensionality; i++) {
global_best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
// 30 iteration max
int iteration_max = 30;
for (int i = 0; i < iteration_max; i++){
// Random new solution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is still being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
// Set up the new solution
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// test it
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
// Check to see if we found a better global solution
if (func.compute(best_solution) < func.compute(global_best_solution)){
global_best_solution = best_solution;
}
}
};
};

@ -0,0 +1,53 @@
#pragma once
#include "search_function.h"
class local : public search_function {
public:
local(function f) : search_function(f) {
};
double search(int permutations, int dimensionality) {
// Set up the initial soution
std::vector<double> best_solution;
for (int i = 0; i < dimensionality; i++) {
best_solution.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
std::vector<double> temp_solution = best_solution;
// While a better solution is being found
bool better_solution_found = true;
while (better_solution_found) {
better_solution_found = false;
double delta = 0.11;
temp_solution = best_solution;
std::vector<double> new_solution(dimensionality);
for (int i = 0; i < dimensionality; i++) {
temp_solution[i] += delta;
new_solution[i] = best_solution[i] - delta * (func.compute(temp_solution) - func.compute(best_solution));
temp_solution[i] = best_solution[i];
// temp[i] - delta * new with delta, and the old without
}
// Check to see if we found a better solution
if (func.compute(new_solution) < func.compute(best_solution)) {
best_solution = new_solution;
better_solution_found = true;
}
}
return func.compute(best_solution);
};
};

@ -0,0 +1,105 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <chrono>
#include <cstring>
#include "twister.c"
#include "util.hpp"
#include "functions.hpp"
#include "random_walk.hpp"
#include "local.hpp"
#include "iterative_local.hpp"
#include "differential_evolution.hpp"
#include "genetic_algorithm.hpp"
#include "particle_swrm.hpp"
#include "soma.hpp"
#include "harmony.hpp"
#include "firefly.hpp"
int main(int argc, char* args[]) {
std::map<int, function> function_lookup;
function_lookup.emplace(std::make_pair(0, function(&schwefel, 512, -512)));
function_lookup.emplace(std::make_pair(1, function(&first_de_jong, 100, -100)));
function_lookup.emplace(std::make_pair(2, function(&rosenbrock, 100, -100)));
function_lookup.emplace(std::make_pair(3, function(&rastrigin, 30, -30)));
function_lookup.emplace(std::make_pair(4, function(&griewangk, 500, -500)));
function_lookup.emplace(std::make_pair(5, function(&sine_envelope_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(6, function(&stretched_v_sine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(7, function(&ackleys_one, 32, -32)));
function_lookup.emplace(std::make_pair(8, function(&ackleys_two, 32, -32)));
function_lookup.emplace(std::make_pair(9, function(&egg_holder, 500, -500)));
function_lookup.emplace(std::make_pair(10, function(&rana, 500, -500)));
function_lookup.emplace(std::make_pair(11, function(&pathological, 100, -100)));
function_lookup.emplace(std::make_pair(12, function(&michalewicz, M_PI, 0)));
function_lookup.emplace(std::make_pair(13, function(&masters_cosine_wave, 30, -30)));
function_lookup.emplace(std::make_pair(14, function(&shekels_foxholes, 10, 0)));
function f;
int dimensionality = 0;
double seed = 0;
int search_function = 0;
// // Get the command line args
// if (argc == 1){
// char arg_str[200];
// std::cin.get(arg_str, 200);
// char t = ' ';
//
// f = function_lookup[atoi(strtok(arg_str, &t))];
// dimensionality = atoi(strtok(NULL, &t));
// seed = atoi(strtok(NULL, &t));
// search_function = atoi(strtok(NULL, &t));
//
// } else {
//
// f = function_lookup[atoi(args[1])];
// dimensionality = atoi(args[2]);
// seed = atoi(args[3]);
// search_function = atoi(args[4]);
// }
srand(time(nullptr));
f = function_lookup[12];
dimensionality = 20;
seed = rand();
search_function = 7;
// Set up the search functions
seedMT(seed);
random_walk random_walk_search(f);
local local_search(f);
iterative_local iterative_local_search(f);
differential_evolution differential_evolution_search(f);
genetic_algorithm genetic_algorithm_search(f);
particle_swarm particle_swarm_search(f);
soma soma_search(f);
firefly firefly_search(f);
harmony harmony_search(f);
// return the results of the search
if (search_function == 0)
std::cout << random_walk_search.search(1, dimensionality) << std::endl;
else if (search_function == 1)
std::cout << local_search.search(1, dimensionality) << std::endl;
else if (search_function == 2)
std::cout << iterative_local_search.search(1, dimensionality) << std::endl;
else if (search_function == 3)
std::cout << differential_evolution_search.search(1, dimensionality) << std::endl;
else if (search_function == 4)
std::cout << genetic_algorithm_search.search(1, dimensionality) << std::endl;
else if (search_function == 5)
std::cout << particle_swarm_search.search(1, dimensionality) << std::endl;
else if (search_function == 6)
std::cout << soma_search.search(1, dimensionality) << std::endl;
else if (search_function == 7)
std::cout << firefly_search.search(1, dimensionality) << std::endl;
else if (search_function == 8)
std::cout << harmony_search.search(1, dimensionality) << std::endl;
return 0;
}

@ -0,0 +1,145 @@
#pragma once
#include "search_function.h"
struct particle {
// Personal best
double pb_fitness = 999999999999999;
std::vector<double> pb_solution;
// Current solution
double fitness = 9999999999;
std::vector<double> solution;
std::vector<double> velocity;
double v_max = 4.0;
double c1 = 0.2;
double c2 = 0.2;
double weight = 0.9;
int dimensionality;
std::vector<double> *gb_solution;
double *gb_fitness;
function *func;
particle(int dimensionality, std::vector<double> *gb_solution, double *gb_fitness, function *func) : dimensionality(dimensionality){
this->gb_solution = gb_solution;
this->gb_fitness = gb_fitness;
this->func = func;
// Blank initial solution and assign it also to pb
pb_solution, solution = std::vector<double>(dimensionality, 0);
// Init the velocity
for (int i = 0; i < dimensionality; i++)
velocity.push_back(rand_between(-v_max/3, v_max/3));
}
void update_fitness(){
fitness = func->compute(solution);
if (fitness < pb_fitness){
pb_solution = solution;
pb_fitness = fitness;
}
if (fitness < *gb_fitness){
*gb_solution = solution;
*gb_fitness = fitness;
}
}
void update_velocity(){
for (int d = 0; d < dimensionality; d++){
velocity.at(d) = weight * velocity.at(d) + c1 * rand_between(0, 1) * (pb_solution.at(d) - solution.at(d)) +
c2 * rand_between(0, 1) * (gb_solution->at(d) - solution.at(d));
if (velocity.at(d) > v_max)
velocity.at(d) = v_max;
else if (velocity.at(d) < -v_max)
velocity.at(d) = -v_max;
solution.at(d) += velocity.at(d);
if (solution.at(d) < func->lower_bound)
solution.at(d) = func->lower_bound;
else if (solution.at(d) > func->upper_bound)
solution.at(d) = func->upper_bound;
}
}
};
class particle_swarm : public search_function {
public:
particle_swarm(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
for (int i = 0; i < number_of_particles; i++){
particle p(dimensionality, &gb_solution, &gb_fitness, &func);
p.solution = generate_solution(dimensionality);
p.update_fitness();
particles.push_back(p);
}
for (int i = 0; i < max_iterations; i++){
for (int p = 0; p < particles.size(); p++){
particles.at(p).update_fitness();
particles.at(p).update_velocity();
}
}
return gb_fitness;
};
private:
// The global best solution and fitness
double gb_fitness = 99999999999999;
std::vector<double> gb_solution;
int number_of_particles = 100;
std::vector<particle> particles;
int max_iterations = 100;
};

@ -0,0 +1,41 @@
#pragma once
#include "search_function.h"
#include <algorithm>
class random_walk : public search_function {
public:
random_walk(function f) : search_function(f) {
}
double search(int permutations, int dimensionality) {
timer t;
t.start();
std::vector<double> r;
for (int i = 0; i < permutations; i++){
std::vector<double> dimension_vals;
for (int i = 0; i < dimensionality; i++) {
auto val = fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound;
dimension_vals.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
r.push_back(func.compute(dimension_vals));
}
t.end();
std::sort(r.begin(), r.end(), std::less<double>());
return r[0];
}
};

Binary file not shown.

@ -0,0 +1,6 @@
The optimization functions can be either ran with the python script "run.py"
which will run all 3 search methods with all 15 search functions.
Or you can call the executable directly from the command line. Eg.
./Lab4 <0-14> <dimensionality> <seed> <1-8>

@ -0,0 +1,6 @@
Timer values

@ -0,0 +1,55 @@
from subprocess import check_output
import subprocess
import random
import matplotlib.pyplot as plt
import time
random.seed()
loc = "../build/Lab4"
f = open('out','w')
f.write("Timer values")
for function in range(6, 9):
print("Method: " + str(function))
for q in range(0, 15):
print("Function: " + str(q))
f.write(str(q) + "\n")
start = time.time()
subprocess.call([
loc,
str(q),
str(20),
str(random.randint(0, 2147483646)),
str(function)
])
end = time.time()
f.write(str(end-start) + "\n")
f.close()

@ -0,0 +1,39 @@
from subprocess import check_output
import subprocess
import random
import matplotlib.pyplot as plt
import time
random.seed()
loc = "../build/Lab4"
search = 8
for function in range(0, 15):
print("Function: " + str(function))
for q in range(0, 10):
subprocess.call([
loc,
str(function),
str(20),
str(random.randint(0, 2147483646)),
str(search)
])

Binary file not shown.

@ -0,0 +1,193 @@
\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage{sectsty}
\usepackage{rotating}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{13.6pt}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{Central Washington University of the Computer Science Department} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge Project 4 \\
\horrule{2pt} \\[0.5cm]
}
\author{\normalsize Mitchell Hansen \\[-6pt]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\section{Introduction}
For this lab we again took our 15 optimization functions and ran them through
3 new methods of determining the global minimum. The functions being:
The Self Organizing Migrating Algorithm (SOMA) which uses an evolutional approach
, The Firefly Algorithm (FA) which uses an evolutional swarm approach
similar to Particle Swarm, and the Harmony Search Algorithm (HS) which uses
another evolutional style approach.
\section{Methods}
For each of the 3 search methods and all 15 of the search functions we ran
tests for a set amount of iterations using the python scripts we wrote
for the previous lab. These results were then written out to a file from which
we calculated the min, max, range, etc.
We also slightly modified the way FA calculated the step when changin it's direction.
Instead of using a random distribution when calculating the FA random step
we used a suggested regular distribution that we found when researching the
problem online.
\section{Analysis}
This lab produced both surprising and disappointing results when evaluating the search functions.
The most surprising results are that of SOMA, where it regularly equaled or beat the most accurate
search function so far which has been Differential Evolution (DE). Of the 15 functions tested, SOMA
had better results than DE for 6 of the functions. The rest of the 9 functions tested were very close
to the results found by the DE search function.
The disappointing results produced by this lab lay in the other two functions tested. HS and FA produced
very similar results overall, most possibly because they are not all that much better than particle
swarm of which they are in the same class. Between the two search functions, there was very seldom
a difference of more than 20 to 30 percent in their fitnesses. We think it's best to compare these
two functions to their cousin Particle Swarm (PSO) as it is the closest related method.
In relation to PSO the functions did very similarly for the later functions (>4). The lower functions (<4)
all produced results which were much more inaccurate than traditional particle swarm. In regards to the
later functions, HS was only able to beat a PSO search method under function 6 with 11.28 determined as
the minimum, with PSO returning 12.15. FA wasn't able to beat PSO in function 6 but it did come close
with 13.32. Another notable point to look at is function 15 where HS was able to find the minimum at
-18.70, but FA was unable to capture the minimum with 16.40.
\section{Conclusion}
The conclusion for this lab is a pessimistic one, SOMA was a great success and a valuable
addition to our growing library of search functions. But are overshadowed by the poor performance
not only in the accuracy of answers, but also the run times of FA and HS. PSO was able to
outperform HS and FA in almost every aspect, and that is even telling as PSO performs
poorly when compared to other search functions we have used for some specific functions.
Walking away from this lab, I believe that we will add SOMA to our list of highly accurate
and performance search methods, while leaving FA and HS for problem sets which they are most
suited to.
Although we scrutinized our code to an appropriate degree we can't rule out the poor performance
of the FA and HS algorithms being caused by incorrect implementations. We're reasonably
sure that this is not the case though as the comparable performance to PSO was expected.
Additionally SOMA was not entirely without faults either. Function 10 for example shows an almost 250
percent increase in the minimum value over it's DE an PSO counterparts. This is worrisome as
all of the other results produced by SOMA were within 20 to 30 percent of PSO and DE.
\begin{figure}
\section{Results}
\caption{Computation comparison of SOMA, HS and FA}
\hskip+4.0cm
\rotatebox{90.0}{
\scalebox{0.7}{
\small \centering
\label{Tab1d}
\begin{tabular}{c|lllll|lllll|lllll}
\noalign{\smallskip}\hline\noalign{\smallskip}
Problem & \multicolumn{5}{c}{SOMA}
& \multicolumn{5}{|c|}{HS}
& \multicolumn{5}{c}{FA} \\
\noalign{\smallskip}\hline\noalign{\smallskip}
& Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) \\ \noalign{\smallskip}\hline\noalign{\smallskip}
$f_1$ & -7299.02 & -7386.83 & 1503.58 & 452.97 & 0.08 & -1736.64 & -1762.09 & 901.78 & 340.48 & 4.73 & -2078.10 & -2121.93 & 1297.24 & 956.34 & 2.00 \\
$f_2$ & 73.06 & 33.94 & 332.07 & 100.36 & 0.05 & 38678.19 & 39044.00 & 14740.90 & 5545.68 & 3.63 & 39611.35 & 41038.00 & 15876.60 & 8095.76 & 0.87 \\
$f_3$ & 149.76 & 119.57 & 338.84 & 99.33 & 0.10 & 15223266000.00 & 15499350000.00 & 9746940000.00 & 3077498860.01 & 3.87 & 13940456000.00 & 13970750000.00 & 11865890000.00 & 3765178464.71 & 1.06 \\
$f_4$ & -7758.64 & -7737.15 & 362.37 & 131.58 & 0.20 & 132487.90 & 138380.00 & 75080.00 & 22337.69 & 4.71 & 135166.40 & 136884.00 & 22462.00 & 30028.16 & 2.09 \\
$f_5$ & 45.26 & 35.50 & 124.00 & 36.68 & 0.07 & 249.51 & 249.76 & 66.18 & 22.99 & 4.75 & 219.01 & 229.32 & 130.89 & 46.52 & 2.18 \\
$f_6$ & 13.70 & 13.84 & 2.91 & 0.99 & 0.00 & 11.28 & 11.24 & 0.82 & 0.24 & 5.90 & 13.32 & 13.25 & 1.35 & 3.11 & 2.89 \\
$f_7$ & 36.00 & 34.30 & 24.57 & 8.03 & 0.04 & 34.10 & 34.92 & 5.20 & 1.82 & 6.54 & 45.15 & 44.93 & 8.66 & 9.88 & 4.59 \\
$f_8$ & 14.49 & 15.01 & 72.42 & 28.43 & 0.10 & 279.82 & 282.06 & 57.12 & 17.79 & 5.95 & 273.29 & 278.48 & 37.49 & 62.42 & 3.66 \\
$f_9$ & 141.72 & 212.47 & 376.52 & 154.36 & 0.09 & 305.15 & 306.60 & 19.46 & 6.85 & 7.10 & 342.88 & 354.12 & 71.60 & 74.94 & 4.89 \\
$f_{10}$ & -13566.43 & -14173.65 & 3948.20 & 1297.42 & 0.55 & -3194.74 & -2846.66 & 2290.95 & 832.19 & 6.07 & -3332.62 & -3378.12 & 2053.65 & 1555.81 & 3.43 \\
$f_{11}$ & -8428.54 & -8806.80 & 3527.50 & 1076.29 & 0.58 & -2037.88 & -1976.69 & 1404.16 & 421.07 & 8.39 & -2009.29 & -1998.01 & 1467.36 & 1004.39 & 6.10 \\
$f_{12}$ & 8.91 & 8.88 & 0.87 & 0.27 & 0.01 & 7.78 & 7.74 & 0.59 & 0.19 & 5.76 & 8.71 & 8.77 & 0.44 & 2.14 & 3.10 \\
$f_{13}$ & -2.36 & -2.38 & 2.90 & 0.81 & 0.01 & -5.46 & -5.55 & 1.53 & 0.48 & 7.33 & -2.53 & -2.52 & 2.33 & 1.43 & 4.73 \\
$f_{14}$ & -7.39 & -7.74 & 8.78 & 3.13 & 0.01 & -12.86 & -12.81 & 2.15 & 0.67 & 5.41 & -7.47 & -7.21 & 6.35 & 4.04 & 3.20 \\
$f_{15}$ & -17.46 & -18.45 & 6.22 & 2.14 & 0.03 & -18.70 & -18.70 & 0.00 & 0.00 & 11.09 & -16.40 & -17.37 & 6.14 & 6.23 & 9.65 \\ \noalign{\smallskip}\hline\noalign{\smallskip}
& & & & & & & & & & & & & & & \\
\noalign{\smallskip}\hline\noalign{\smallskip} \multicolumn{16}{l}{\tiny $^1$ ThinkPad, 3.4GHz Intel Core i7 (3rd gen), 16 GB RAM}
\end{tabular}
}}
\end{figure}
\newpage
\begin{figure}
\section{Previous Results}
\caption{Computation comparison of DE, GA and PSO}
\hskip+4.0cm
\rotatebox{90.0}{
\scalebox{0.7}{
\small \centering
\label{Tab1d}
\begin{tabular}{c|lllll|lllll|lllll}
\noalign{\smallskip}\hline\noalign{\smallskip}
Problem & \multicolumn{5}{c}{DE}& \multicolumn{5}{|c|}{GA}
& \multicolumn{5}{c}{PSO} \\
\noalign{\smallskip}\hline\noalign{\smallskip}
& Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) & Avg & Median & Range & SD & T(s) \\ \noalign{\smallskip}\hline\noalign{\smallskip}
$f_1$ & -6112.33 & -6084.59 & 114.26 & 47.83 & 1.14 & -3276.12 & -3292.95 & 943.02 & 245.68 & 2.69 & -2871.98 & -2904.39 & 1194.77 & 322.06 & 0.12 \\
$f_2$ & 129.53 & 25.00 & 900.00 & 251.52 & 0.53 & 23185.53 & 22853.00 & 10310.00 & 3148.43 & 0.72 & 0.17 & 0.15 & 0.25 & 0.08 & 0.09 \\
$f_3$ & 26105.67 & 10019.00 & 168100.00 & 43662.88 & 0.78 & 5291234666.67 & 5017400000.00 & 5739020000.00 & 1539343402.74 & 0.68 & 421.98 & 200.19 & 1657.68 & 497.31 & 0.10 \\
$f_4$ & -7600.00 & -7960.00 & 2560.00 & 728.99 & 1.00 & 79752.00 & 81520.00 & 23240.00 & 8507.40 & 2.12 & -5206.62 & -5324.98 & 3479.78 & 1178.83 & 0.13 \\
$f_5$ & 0.00 & 0.00 & 0.00 & 0.00 & 1.08 & 145.86 & 150.55 & 51.89 & 17.68 & 2.31 & 9.17 & 8.93 & 5.88 & 1.95 & 0.13 \\
$f_6$ & 12.38 & 12.71 & 2.19 & 0.60 & 1.46 & 12.04 & 11.97 & 0.67 & 0.22 & 2.52 & 12.15 & 12.18 & 1.25 & 0.33 & 0.14 \\
$f_7$ & 19.06 & 19.01 & 0.62 & 0.16 & 1.67 & 36.69 & 36.60 & 5.76 & 1.54 & 4.20 & 20.55 & 20.45 & 2.63 & 0.68 & 0.18 \\
$f_8$ & 58.74 & 58.73 & 4.74 & 1.54 & 1.60 & 212.86 & 213.95 & 41.20 & 11.06 & 3.41 & -9.92 & -11.64 & 35.51 & 9.72 & 0.10 \\
$f_9$ & -83.30 & -80.69 & 21.87 & 6.99 & 2.09 & 276.38 & 276.83 & 14.65 & 4.35 & 4.10 & 251.53 & 288.37 & 173.05 & 64.83 & 0.14 \\
$f_{10}$ & -4959.12 & -4579.12 & 2896.23 & 966.10 & 3.02 & -4778.37 & -4822.17 & 978.82 & 327.79 & 4.72 & -4107.05 & -3830.50 & 2663.98 & 711.61 & 0.13 \\
$f_{11}$ & -8478.48 & -8821.20 & 5161.40 & 1330.20 & 3.56 & -3188.30 & -3181.83 & 1334.30 & 339.30 & 8.34 & -2899.33 & -2888.72 & 901.67 & 227.81 & 0.21 \\
$f_{12}$ & 0.00 & 0.00 & 0.00 & 0.00 & 1.48 & 8.00 & 8.01 & 0.69 & 0.17 & 2.70 & 7.02 & 7.08 & 1.30 & 0.37 & 0.15 \\
$f_{13}$ & -4.28 & -4.22 & 2.71 & 0.83 & 3.06 & -4.27 & -4.22 & 2.30 & 0.57 & 5.54 & -10.39 & -9.86 & 4.92 & 1.50 & 0.14 \\
$f_{14}$ & -18.99 & -19.00 & 0.04 & 0.01 & 1.47 & -10.88 & -10.53 & 3.70 & 1.00 & 3.65 & -16.07 & -16.15 & 5.22 & 1.59 & 0.14 \\
$f_{15}$ & -21.91 & -23.03 & 8.39 & 2.95 & 6.05 & -14.64 & -14.64 & 0.00 & 0.00 & 12.55 & -18.70 & -18.70 & 0.00 & 0.00 & 0.27 \\ \noalign{\smallskip}\hline\noalign{\smallskip}
& & & & & & & & & & & & & & & \\
\noalign{\smallskip}\hline\noalign{\smallskip} \multicolumn{16}{l}{\tiny $^1$ ThinkPad, 3.4GHz Intel Core i7 (3rd gen), 16 GB RAM}
\end{tabular}
}}
\end{figure}
\end{document}

@ -0,0 +1,56 @@
#pragma once
class search_function {
public:
function func;
search_function(function f) : func(f) {
};
virtual double search(int permutations, int dimensionality) = 0;
protected:
std::vector<double> generate_solution(int dimensionality){
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++) {
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
return tmp;
}
std::vector<std::vector<double>> generate_population(int dimensionality, int population_count){
std::vector<std::vector<double>> tmp;
for (int i = 0; i < dimensionality; i++) {
tmp.push_back(generate_solution(dimensionality));
}
return tmp;
}
double check_bounds(double input){
if (input > func.upper_bound)
return func.upper_bound;
else if (input < func.lower_bound)
return func.lower_bound;
else
return input;
}
void check_solution_bounds(std::vector<double> *input){
for (auto &i: *input){
if (i > func.upper_bound)
i = func.upper_bound;
else if (i < func.lower_bound)
i = func.lower_bound;
}
}
};

@ -0,0 +1,149 @@
#pragma once
#include "search_function.h"
class soma : public search_function {
public:
soma(function f) : search_function(f) {};
double search(int permutations, int dimensionality) {
// Set the parameters defined on page 8
path_length = 3.5;
specimen_step = 0.11;
perturbation = 0.11;
migrations = 1000;
min_div = 0.1;
// Set the population size
population_size = dimensionality * 0.5;
if (population_size < 10)
population_size = 10;
// Set up random start population
for (int p = 0; p < population_size; p++) {
std::vector<double> tmp;
for (int i = 0; i < dimensionality; i++){
tmp.push_back(fmod(randomMT(), (func.upper_bound * 2)) + func.lower_bound);
}
population.push_back(tmp);
}
// Sort the population so the leader is at(0)
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
for (int m = 0; m < migrations; m++){
std::vector<double> leader_solution = population.at(0);
double leader_fitness = func.compute(leader_solution);
for (int i = 1; i < population.size(); i++){
// We need the best fitness and the starting point for each
// individual in the population. start_solution is not mutated,
// while best_* and population.at(i) both are
double best_fitness = func.compute(population.at(i));
std::vector<double> best_solution = population.at(i);
std::vector<double> start_solution = population.at(i);
for (double p = 0; p < path_length; p += specimen_step){
// Generate the perturbation vector for each step,
// seems to give better results than per migration
std::vector<double> perturbation_vector(dimensionality, 0);
for (auto &q: perturbation_vector){
double val = rand_between(0, 1);
if (val < perturbation)
q = 1;
else
q = 0;
}
// Mutate the individual
for (int j = 0; j < dimensionality; j++){
population.at(i).at(j) = start_solution.at(j) + (leader_solution.at(j) - start_solution.at(j)) * p * perturbation_vector.at(j);
}
check_solution_bounds(&population.at(i));
// If this step beat the individuals best, update it
if (func.compute(population.at(i)) < best_fitness){
best_fitness = func.compute(population.at(i));
best_solution = population.at(i);
}
}
// population.at(i) is now at the end of the step.
// set it to the best solution it found along the way
population.at(i) = best_solution;
}
// Early exit if the different between the leader and any others are less than
// a defined constant. 1 is a little to lenient.
for (int r = 1; r < population.size(); r++){
if (std::abs(func.compute(population.at(r)) - leader_fitness) < min_div){
return leader_fitness;
}
}
// Resort the population so the leader will be at(0)
std::sort(population.begin(), population.end(), [this](std::vector<double> a, std::vector<double> b){
return this->func.compute(a) < this->func.compute(b);
});
// Test the front position. If the leader was usurped then replace it.
if (func.compute(population.front()) < leader_fitness) {
leader_solution = population.front();
leader_fitness = func.compute(leader_solution);
}
}
// Return the best solution found
return func.compute(population.front());
};
private:
double specimen_step;
double path_length;
int population_size;
double perturbation;
double min_div;
int migrations;
std::vector<std::vector<double>> population;
};

@ -0,0 +1,181 @@
// http://www.math.keio.ac.jp/~matumoto/ver980409.html
// This is the ``Mersenne Twister'' random number generator MT19937, which
// generates pseudorandom integers uniformly distributed in 0..(2^32 - 1)
// starting from any odd seed in 0..(2^32 - 1). This version is a recode
// by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by
// Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in
// July-August 1997).
//
// Effectiveness of the recoding (on Goedel2.math.washington.edu, a DEC Alpha
// running OSF/1) using GCC -O3 as a compiler: before recoding: 51.6 sec. to
// generate 300 million random numbers; after recoding: 24.0 sec. for the same
// (i.e., 46.5% of original time), so speed is now about 12.5 million random
// number generations per second on this machine.
//
// According to the URL <http://www.math.keio.ac.jp/~matumoto/emt.html>
// (and paraphrasing a bit in places), the Mersenne Twister is ``designed
// with consideration of the flaws of various existing generators,'' has
// a period of 2^19937 - 1, gives a sequence that is 623-dimensionally
// equidistributed, and ``has passed many stringent tests, including the
// die-hard test of G. Marsaglia and the load test of P. Hellekalek and
// S. Wegenkittl.'' It is efficient in memory usage (typically using 2506
// to 5012 bytes of static data, depending on data type sizes, and the code
// is quite short as well). It generates random numbers in batches of 624
// at a time, so the caching and pipelining of modern systems is exploited.
// It is also divide- and mod-free.
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation (either version 2 of the License or, at your
// option, any later version). This library is distributed in the hope that
// it will be useful, but WITHOUT ANY WARRANTY, without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU Library General Public License for more details. You should have
// received a copy of the GNU Library General Public License along with this
// library; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307, USA.
//
// The code as Shawn received it included the following notice:
//
// Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. When
// you use this, send an e-mail to <matumoto@math.keio.ac.jp> with
// an appropriate reference to your work.
//
// It would be nice to CC: <Cokus@math.washington.edu> when you write.
//
#include <stdio.h>
#include <stdlib.h>
//
// uint32 must be an unsigned integer type capable of holding at least 32
// bits; exactly 32 should be fastest, but 64 is better on an Alpha with
// GCC at -O3 optimization so try your options and see what's best for you
//
typedef unsigned long uint32;
#define N (624) // length of state vector
#define M (397) // a period parameter
#define K (0x9908B0DFU) // a magic constant
#define hiBit(u) ((u) & 0x80000000U) // mask all but highest bit of u
#define loBit(u) ((u) & 0x00000001U) // mask all but lowest bit of u
#define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u
#define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v
static uint32 state[N+1]; // state vector + 1 extra to not violate ANSI C
static uint32 *next; // next random value is computed from here
static int left = -1; // can *next++ this many times before reloading
void seedMT(uint32 seed)
{
//
// We initialize state[0..(N-1)] via the generator
//
// x_new = (69069 * x_old) mod 2^32
//
// from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's
// _The Art of Computer Programming_, Volume 2, 3rd ed.
//
// Notes (SJC): I do not know what the initial state requirements
// of the Mersenne Twister are, but it seems this seeding generator
// could be better. It achieves the maximum period for its modulus
// (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if
// x_initial can be even, you have sequences like 0, 0, 0, ...;
// 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,
// 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.
//
// Even if x_initial is odd, if x_initial is 1 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 0,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,
// ...
//
// and if x_initial is 3 mod 4 then
//
// the lowest bit of x is always 1,
// the next-to-lowest bit of x is always 1,
// the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
// the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... ,
// the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,
// ...
//
// The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is
// 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It
// also does well in the dimension 2..5 spectral tests, but it could be
// better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).
//
// Note that the random number user does not see the values generated
// here directly since reloadMT() will always munge them first, so maybe
// none of all of this matters. In fact, the seed values made here could
// even be extra-special desirable if the Mersenne Twister theory says
// so-- that's why the only change I made is to restrict to odd seeds.
//
register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = state;
register int j;
for(left=0, *s++=x, j=N; --j;
*s++ = (x*=69069U) & 0xFFFFFFFFU);
}
uint32 reloadMT(void)
{
register uint32 *p0=state, *p2=state+2, *pM=state+M, s0, s1;
register int j;
if(left < -1)
seedMT(4357U);
left=N-1, next=state+1;
for(s0=state[0], s1=state[1], j=N-M+1; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
for(pM=state, j=M; --j; s0=s1, s1=*p2++)
*p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1=state[0], *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);
s1 ^= (s1 >> 11);
s1 ^= (s1 << 7) & 0x9D2C5680U;
s1 ^= (s1 << 15) & 0xEFC60000U;
return(s1 ^ (s1 >> 18));
}
uint32 randomMT(void)
{
uint32 y;
if(--left < 0)
return(reloadMT());
y = *next++;
y ^= (y >> 11);
y ^= (y << 7) & 0x9D2C5680U;
y ^= (y << 15) & 0xEFC60000U;
return(y ^ (y >> 18));
}
#ifdef NOCOMPILE
int main(void)
{
int j;
// you can seed with any uint32, but the best are odds in 0..(2^32 - 1)
seedMT(4357U);
// print the first 2,002 random numbers seven to a line as an example
for(j=0; j<2002; j++)
printf(" %10lu%s", (unsigned long) randomMT(), (j%7)==6 ? "\n" : "");
return(EXIT_SUCCESS);
}
#endif

@ -0,0 +1,12 @@
struct timer{
std::chrono::high_resolution_clock::time_point t1;
std::chrono::high_resolution_clock::time_point t2;
void start(){t1 = std::chrono::high_resolution_clock::now();}
void end(){t2 = std::chrono::high_resolution_clock::now();}
double duration(){ return std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();}
};
double rand_between(double lower, double upper){
return lower + (randomMT() * 1.0 / UINT32_MAX) * (upper - lower);
}
Loading…
Cancel
Save