Note: This document is Appendix A of this paper: N.C. Cruz, S. Salhi, J.L. Redondo, J.D. Álvarez, M. Berenguel and P.M. Ortigosa. Design of a parallel genetic algorithm for continuous and pattern-free heliostat field optimization. Preprint submitted to The Journal of Supercomputing, September, 2017.

A.- EnGA library

A.1 - Overview

The genetic algorithm proposed in this work, EnGA, has been also implemented as a general-purpose C++ library for global optimization. While the parallel structure which relies on elitism and tournament-based selection is maintained, reproduction and evaluation methods must be defined by the user according to his/her particular problem. Two operating modes are available featuring static and dynamic load-balancing, respectively. Besides, as OpenMP has been used for threading, it can be compiled either as a sequential or parallel code depending on final requirements. In this appendix, a general overview of its structure and use is given. The tool can be downloaded from http://gitlab.hpca.ual.es/ncc911/EnGA.

A.2 - Structure

The source code is divided into four core files. Next, they are commented in logical order. For the sake of simplicity, the complete signature of functions is not included. In any case, their names and code are quite descriptive and there should be no problem in understanding their purpose and usage:

Finally, it must be highlighted that every thread creates its own local random number generator when it is started. The object-oriented MersenneTwister generator implemented by Stephan Brumme (http://create.stephan-brumme.com/mersenne-twister/) has been used. Our gratitude to him for sharing his work is hereby expressed.

A.3 - Usage

Applying the previous tool to solve any optimization problem only requires the design of a class to be used as candidate solution. Due to its template-based design, the tool is ultimately adapted to the target problem at compilation time. A candidate solution class is responsible for controlling from random initialization to reproduction and mutation according to the target problem. Its requirements are listed next:

It is also important to mention that if the created class uses instance-linked dynamic memory, appropriate copy and assignment operators should be also provided. Besides, as a class, it can include any other code required by the user. Finally, in file Tester.cpp, a usage example is shown. It relies on the files SampleProblem.h/cpp, which are a direct sample of the type of class that any user should write and contains useful comments. Specifically, the target optimization problem consists in obtaining the global minimum of function f(x) = (x + 47)2 + 8.

A.4 - License

This software has been developed by N.C. Cruz, S. Salhi, J.L. Redondo, J.D. Álvarez, M. Berenguel and P.M. Ortigosa. It is distributed `as is', with the best intentions, but without any kind of warranty and/or responsibility of the authors. It can be freely used, modified and distributed by anyone interested at but it is compulsory to reference the original version included herein.