Skip to content

Commit b7f0773

Browse files
Merge pull request #6 from gchoinka/gerard/example
Gerard/example
2 parents d36fd94 + 2912287 commit b7f0773

20 files changed

+900
-411
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ build*
66
third_party/gmock
77
third_party/gtest
88
third_party/docbook
9+
.idea

cmake/modules/CreateVersionFile.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
find_package ( Git )
22

33
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/.git/" )
4+
message ( WARNING "coud not find .git repository in ${CMAKE_SOURCE_DIR}/.git/" )
45
return ()
56
endif ()
67

8+
9+
710
set ( GPCXX_VERSION_FILE ${CMAKE_SOURCE_DIR}/include/gpcxx/config_version.hpp )
811
set ( GPCXX_VERSION_FILE_TEMPLATE ${CMAKE_SOURCE_DIR}/include/gpcxx/config_version.hpp.cmake )
912

1013
execute_process ( COMMAND git describe --abbrev=4 --match v*.* HEAD
1114
COMMAND sed -e "s/-/./g"
1215
OUTPUT_VARIABLE GPCXX_GIT_VERSION
13-
OUTPUT_STRIP_TRAILING_WHITESPACE )
16+
OUTPUT_STRIP_TRAILING_WHITESPACE
17+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/" )
1418

1519
execute_process ( COMMAND git status -uno -s
1620
OUTPUT_VARIABLE GPCXX_GIT_STATUS
17-
OUTPUT_STRIP_TRAILING_WHITESPACE )
21+
OUTPUT_STRIP_TRAILING_WHITESPACE
22+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/" )
1823

1924

2025
string ( REGEX REPLACE "^v([0-9]+)\\..*" "\\1" GPCXX_VERSION_MAJOR "${GPCXX_GIT_VERSION}" )

doc/tutorial_artificial_ant.qbk

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[section Artificial ant]
2-
[import ../examples/artificial_ant/ant_simulation_nodes.hpp]
3-
[import ../examples/artificial_ant/ant_simulation.hpp]
4-
[import ../examples/artificial_ant/artificial_ant_main.cpp]
5-
[import ../examples/artificial_ant/ant_simulation_tests_main.cpp]
2+
[import ../examples/artificial_ant/nodes.hpp]
3+
[import ../examples/artificial_ant/simulation.hpp]
4+
[import ../examples/artificial_ant/main.cpp]
5+
[import ../examples/artificial_ant/detail/artificial_ant_tests.cpp]
66
[import ../examples/artificial_ant/board.hpp]
77
[import ../examples/artificial_ant/santa_fe_trail.hpp]
88

@@ -147,14 +147,16 @@ In this part the node_generator is initialized, with a list of `gpcxx::node_gene
147147

148148
[envolve_settings]
149149

150-
* `population_size` how many individual, should be competing. Bigger population increases the resource's usage (run time and memory) but also decreases the time to find a solution.
151-
* `generation_max` at which generation should gpcxx stop if other break up condition are meet (e.g. an optimal solution was found).
152-
* `number_elite` [/ TODO ]
153-
* `mutation_rate` how often a node should be changed randomly
154-
* `crossover_rate` [/ TODO ]
155-
* `reproduction_rate` [/ TODO ]
150+
* `population_size` how many individual should be competing. Bigger population increases the resource's usage (run time and memory) but also decreases the time to find a solution.
151+
* `generation_max` at which generation should gpcxx stop. If no other break up condition are meet (e.g. an optimal solution was found).
152+
* `number_elite` how many of the top individual should directly cloned to the next generation, without changing.
153+
* `mutation_rate` how often a node should be changed randomly.
154+
* `crossover_rate` the rate at which crossover operation should happen
155+
* `crossover_internal_point_rate` while doing crossover operations, which kind of node should be favored. Internal nodes caring more genetic information, in comparison to terminals.
156+
* `reproduction_rate` the rate at which a direct clone of an individual should be made (not rank based in difference to number_elite)
156157
* `min_tree_height` and `max_tree_height` how deep can the tree be, max_tree_height limits the size of the individual. Big individuals are slower to evaluate, but can handle more complex problems. In comparison, `min_tree_height` can be set to 1 up to `max_tree_height`. An individual can stay as small it wants, as long it can compete against other/bigger individuals.
157-
* `tournament_size` [/ TODO ]
158+
* `init_max_tree_height` how big should be the individual at the first generation.
159+
* `tournament_size` how many random individual should be chosen for the competing. The winner is chosen by rank of the fitness. Small values allows week individual also to reproduce. If the size gets bigger, the chance that a high performance individual is chosen gets higher, this leads in a dominating situation.
158160

159161
These settings have direct influence on how fast a solution is found. In some cases it makes sens to adjust these settings, but mostly it will just cut the run time. While optimizing these setting, the program could find a solution by its self, just with a longer run time.
160162
The critical settings for memory usage are `population_size` and `max_tree_height`, if these values are to big for the host PC, the operating system will start to move memory to the swapping area and this will dramatic increase the run time of the application.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Date: 2014-07-18
22
# Author: Gerard Choinka ([email protected])
33

4-
add_executable ( artificial_ant artificial_ant_main.cpp )
5-
add_executable ( artificial_ant_tests ant_simulation_tests_main.cpp )
6-
add_executable ( artificial_ant_plots ant_simulation_plots.cpp )
4+
add_executable ( artificial_ant main.cpp )
5+
add_subdirectory ( detail )

examples/artificial_ant/ant_simulation_plots.cpp

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)