This repository has been archived by the owner on Nov 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
2,041 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
configuration: | ||
- Release | ||
|
||
build_script: | ||
- msbuild %solution_name% | ||
- msbuild %solution_name% | ||
|
||
test_script: | ||
- C:\projects\jnf-neat\x64\Release\xor_two_bits.exe | ||
- C:\projects\jnf-neat\x64\Release\xor_three_bits.exe | ||
- C:\projects\jnf-neat\x64\Release\EvenNumbers.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -410,3 +410,5 @@ cmake_install.cmake | |
install_manifest.txt | ||
Testing/ | ||
*.cmake | ||
cmake-build-debug/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
file(GLOB SOURCES Sources/Headers/*.h Sources/Implementations/*.cpp) | ||
file(GLOB_RECURSE SOURCES [RELATIVE Sources] *.cpp *.hpp *.c *.h) | ||
add_library(Core SHARED OBJECT ${SOURCES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
Core/Sources/Headers/gene.h → Core/Sources/Headers/gene.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
#pragma once | ||
#include <cstddef> | ||
#include <string> | ||
#include "../Headers/utility.hpp" | ||
#include "../Headers/type.hpp" | ||
|
||
namespace Hippocrates { | ||
|
||
struct Gene { | ||
public: | ||
Gene(); | ||
Gene(const Gene& other) = default; | ||
Gene(Gene&& other) = default; | ||
Gene(std::string json); | ||
~Gene() = default; | ||
|
||
auto operator=(const Gene& other) -> Gene& = default; | ||
auto operator=(Gene&& other) -> Gene& = default; | ||
auto operator==(const Gene& other) const -> bool; | ||
|
||
auto SetRandomWeight() -> void; | ||
auto GetJSON() const->std::string; | ||
|
||
std::size_t from = 0; | ||
std::size_t to = 0; | ||
float weight = 0.0f; | ||
std::size_t historicalMarking = numberOfExistingGenes++; | ||
Type::connection_weight_t weight = 0.0f; | ||
static constexpr auto invalidHistoricalMarking = std::numeric_limits<std::size_t>::max(); | ||
std::size_t historicalMarking = invalidHistoricalMarking; | ||
bool isEnabled = true; | ||
bool isRecursive = false; | ||
|
||
private: | ||
static std::size_t numberOfExistingGenes; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
#include <vector> | ||
#include <type_traits> | ||
#include "genome.hpp" | ||
|
||
namespace Hippocrates { | ||
|
||
class InnovationCacher { | ||
public: | ||
auto AssignAndCacheHistoricalMarkings(Genome& genome) -> void; | ||
auto AssignAndCacheHistoricalMarking(Gene& gene) -> void; | ||
auto Clear() -> void; | ||
|
||
private: | ||
std::vector<Gene> cache; | ||
using cache_iterator = decltype(cache)::iterator; | ||
std::size_t nextHighestHistoricalMarking = 0; | ||
|
||
private: | ||
auto GetAndIncrementNextHighestHistoricalMarking() -> std::size_t; | ||
auto FindGeneInCache(const Gene& gene) -> cache_iterator; | ||
}; | ||
|
||
} |
Oops, something went wrong.