The optimization tool contains a collection of algorithms coded in C++ that take input data as above-ground biomass and friction maps to calculate an optimal position for a biomass power plant.
- Minimum: Dual-core processor, 1 GHz Recommended: Quad-core processor 3 GHz
- Minimum: RAM Memory de 4 GB, Recomended:16 GB
- Minimum: 1 GB of free disk space, Recommended: 4 GB of free disk space
The optimization tool was successfully tested using the CentOS Linux distribution on its version 7. In addition, it is mandatory to install the following libraries:
- GDAL at least versión 2.0
- OpenCV at least version 3.0
- Tclap at leas version 1.0
Open the command line and execute the following commands:
- Acquire sudo privileges:
su- Update packages:
# yum -y update- Install Development Tools
# yum group install "Development Tools"
# yum install cmake gcc gtk2-devel pkgconfig libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel- Download and install OpenCV library:
# wget https://github.com/opencv/opencv/archive/3.1.0.zip -O opencv-3.1.0.zip- Unzip the file:
# unzip opencv-3.1.0.zip- Compilation process:
# cd opencv-3.1.0
# mkdir build
# cd build
# cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local
..
# make
# make install- Additional configuration:
# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig/
# echo '/usr/local/lib/' >> /etc/ld.so.conf.d/opencv.conf
# ldconfigDesde una terminal, hacer lo siguiente:
- Install EPEL repository:
$ yum install epel-release.noarch- Update repolist:
$ yum repolist- Install gdal library:
$ yum install gdal-devel.x86_64-
Download templatized C++ version 1.2.2 from https://sourceforge.net/projects/tclap/files/tclap-1.2.2.tar.gz/download
-
TCLAP is implemted entirely in header files which means that it is necessary only to include the CmdLine.h fie to use the library
#include <tclap/CmdLine.h>http://www.mofuss.unam.mx/optimization
Install docker according to your platform (windows, Linux, or Mac) following the instructions in the URL. https://docs.docker.com/install/
The Dockerfile is available in the following URL: https://raw.githubusercontent.com/ulises1229/PowerPlantOptimization/master/Dockerfile
-
Open a docker terminal and go to the directory where the Dockerfile was downloaded (use the cd command)
-
Cambiarse a la capeta donde se descargo el Dockerfile con el comando change directory cd .
cd /path/to/dockerfile- Use the following command to build the docker container.
docker build -t optimization .- Once the installation is finished, it would be possible to identify the container ID using the following command.
docker images docker run -it --name optimization -v optimization:/storage optimization-tool:latest
Ubicar las capas de ficción y biomasa en un directorio y utilizar el comando de docker cp para copiar las capas dentro del contenedor.
docker cp C:\Users\Ulises\Desktop\Docker\capas\Honduras_biomass.tif 622bdc51d747:\storage
docker cp C:\Users\Ulises\Desktop\Docker\capas\Honduras_fricc.tif 622bdc51d747:\storage Crear un volumen en docker
docker volume create optimization
Mostrar el volúmen
docker volume ls Ver detalles del volúmen
docker volume inspect optimization
Uso:
{-s <float>|-w <float>} [-p <float>]
[-l <float>] [-i <float>]
[-g <int>] -v <int> [-r <string>]
[-u <char>] -a <char> -f <string>
-b <string> [--] [--version] [-h]Donde:
-s <float>, --demand <float>
(required) Demanda de biomasa.
-- OR --
-w <float>, --watts <float>
(required) Demanda en watts.
-p <float>, --production <float>
Porcentaje anual de producción/operación de la planta (%).
-l <float>, --loss <float>
Porcentaje de pérdida esperada en planta (%).
-i <float>, --humidity <float>
Contenido de humedad (%).
-g <int>, --grids_to_validate <int>
Número de grids a validar (solo para validación personalizada).
-v <int>, --validation <int>
(requerido) Opción de validación
* 1 = Elige el mejor punto de la lista.
* 2 = Valida todos los puntos cuya biomasa total de su grid sea mayor al promedio de todo el mapa.
* 3 = Validación personalizada.
-r <string>, --region <string>
Nombre de la región/país.
-u <char>, --heuristic <char>
Heurística a utilizar en búsqueda.
* d = Heurísitca diagonal
* e = Heurísitica euclideana
* m = Heurísitca manhattan
* a = Mayores o iguales a la media (solo búsqueda en profundidad)
* b = Mejores dos nodos (solo búsqueda en profundidad)
-a <char>, --algorithm <char>
(requerido) Algoritmo de búsqueda.
* A, a = Algoritmo A*
* B, b = Búsqueda en profundidad
-f <string>, --friction <string>
(requerido) Ruta absoluta a mapa de fricción friction_map.tif
-b <string>, --biomass <string>
(requerido) Ruta absoluta a mapa de biomasa biomass_map.tif
-e <string>, --usable <string>
(requerido) Indica si la biomasa del mapa es usable en su totalidad o no (ANPs, Waterbodies).
* y = Sí
* n = No
--version
Displays version information and exits.
-h, --help
Despliega información de uso. Ejecución del programa con un mapa de Haití, algoritmo: A*, validación: 1, heurística: Diagonal, demanda en watts: 30, eficiencia de planta: 40, producción de planta: 80, porcentaje de pérdida en planta: 30.
./optimization -b ./Haiti_biomass.tif -f ./Haiti_fricc.tif -a a -r Haiti -v 1 -u d -w 30 -i 40 -p 80 -l 30 -e y
TIFF to matrix = 0.22 secs.
Relation: 1167.22
No. 1 / 1
Source = 1943, 1479
Cost Distance time = 0.46 secs.
Size: 1775
Sum: 100168.125000
Total Cost: 434142.562500
A* Search time = 0.120000 secs.
Creating the final route image took 0.200000 seconds.


