Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V 0.1.0 GPLOOP and CGPA implementations #90

Merged
merged 280 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
ef2e5d2
Clang format
ssitu Oct 6, 2023
704a725
clang format longer lines
ssitu Oct 6, 2023
063e246
clang format longer lines
ssitu Oct 6, 2023
eec18a3
Merge pull request #18 from amantham20/add-gp-unit-tests
ssitu Oct 6, 2023
a42f532
Initialized a new Linear GP Agent
Rajmeet Oct 6, 2023
dbe7f95
Remove input_indices member
ssitu Oct 6, 2023
12bf165
Function pointer constructor for GraphNode
ssitu Oct 6, 2023
3883a45
Replace derived nodes with function pointers
ssitu Oct 6, 2023
a0ddc79
Cartesian graph construction test
ssitu Oct 6, 2023
81d12d5
Refactoring
ssitu Oct 6, 2023
684d30b
Merge branch 'Dev' into GraphPrototype
ssitu Oct 7, 2023
65a4572
Remove duplicate group7 directory
ssitu Oct 7, 2023
8bd01c1
Allow for changing action space
ssitu Oct 7, 2023
56dab0e
Remove action map from GraphBuilder tests
ssitu Oct 8, 2023
31b70b5
Merge branch 'Dev' into Aman's-Workspace
amantham20 Oct 9, 2023
ecb9114
Merge branch 'Aman's-Workspace_Sensors' into Aman's-Workspace_Registars
amantham20 Oct 9, 2023
c95db31
registars
amantham20 Oct 9, 2023
f306cfe
added tests for registers
amantham20 Oct 9, 2023
76b28a2
Merge branch 'LinearGPAgent' into Jason's-workspace
amantham20 Oct 10, 2023
b94a68b
updates to testing with Ctest
amantham20 Oct 10, 2023
dc5d4b8
changed the location for register tests
amantham20 Oct 10, 2023
fd3900d
Update CMakeLists.txt
amantham20 Oct 10, 2023
d7605b2
Update CMakeLists.txt
amantham20 Oct 10, 2023
60e1c35
Delete source/core/Logging.hpp
amantham20 Oct 10, 2023
ec28f89
added sensors for up left down right and added documentation
amantham20 Oct 4, 2023
9adbef9
Merge branch 'Dev' into Aman's-Workspace_Sensors
amantham20 Oct 10, 2023
6654732
updated with tests
amantham20 Oct 10, 2023
9a77522
change the order for check to stop runtime errors
amantham20 Oct 10, 2023
d3a3739
Added genotype for CGP, can be mutated
ssitu Oct 10, 2023
4d5d4a3
Clang format
ssitu Oct 10, 2023
23c1d3a
added n debug
amantham20 Oct 10, 2023
a1b2ec8
Update agent.hpp
amantham20 Oct 10, 2023
7adf339
Merge pull request #15 from amantham20/Aman's-Workspace_Sensors
amantham20 Oct 10, 2023
1cd0903
Select action functionality extended
Oct 10, 2023
be1a6f2
added documentation
amantham20 Oct 10, 2023
d8dcc40
Merge pull request #19 from amantham20/Aman's-Workspace_Registars
amantham20 Oct 10, 2023
28a7a76
Merge branch 'Dev' into Jason's-workspace
amantham20 Oct 10, 2023
155e5dc
Merge branch 'Aman's-Workspace_Sensors' into Dev
amantham20 Oct 10, 2023
3f574e8
Merge branch 'Dev' into Jason's-workspace
amantham20 Oct 10, 2023
8bb39ad
Updated default action result to be 0
Rajmeet Oct 10, 2023
8cc89b0
Added a function to map string to SensorDirection
Rajmeet Oct 10, 2023
b600201
Initialized sensors to LGPAgent
Rajmeet Oct 10, 2023
cc5bb81
Here's a contributor
Rajmeet Oct 10, 2023
4977a9a
Added sensors to actionList
Rajmeet Oct 10, 2023
eeb0515
Merge branch 'Jason's-workspace' of https://github.com/amantham20/CSE…
Rajmeet Oct 10, 2023
f4ad14f
Merge branch 'Dev' of https://github.com/amantham20/CSE491_GP_Group7 …
amantham20 Oct 10, 2023
4ca7744
Merge branch 'Jason's-workspace' into Dev
amantham20 Oct 10, 2023
c534656
compilers gonna be mad! :(
amantham20 Oct 10, 2023
dc4ab7b
Merge branch 'main' into Thrid-Deliverable
amantham20 Oct 10, 2023
7a224e3
Mastering the Art of Clang Fu
amantham20 Oct 10, 2023
3eb9ac4
updates to core and gp ctests working directory
amantham20 Oct 11, 2023
7c2f2f9
added compile header
amantham20 Oct 11, 2023
7ef25a0
Add a vector for the function set
ssitu Oct 11, 2023
40520fc
Add pragma once and getters
ssitu Oct 11, 2023
5075d56
Build cartesian graphs from genotype
ssitu Oct 11, 2023
93ac0ab
Remove print statements
ssitu Oct 11, 2023
49eca51
removed changes in main
amantham20 Oct 11, 2023
234ea31
updated coments
amantham20 Oct 11, 2023
247d12b
Added caching of node outputs
ssitu Oct 11, 2023
dd3dfc1
Reduce computation of default graph
ssitu Oct 11, 2023
a58081b
Only invalidate cache when setting input nodes to a different value
ssitu Oct 11, 2023
d30d199
Include ranges
ssitu Oct 11, 2023
2c17e66
Adjust default random graph
ssitu Oct 11, 2023
6edf61f
Comment out unused functions and variables for now
ssitu Oct 11, 2023
a0dcb1b
Merge branch 'Dev' into GraphPrototype
ssitu Oct 11, 2023
3ce8c74
Add struct for graph parameters, tests for CGPAgent
ssitu Oct 12, 2023
3c4ce53
Forgot to initialize the decision graph
ssitu Oct 12, 2023
2e34fb8
Rename main for cgp for clarity
ssitu Oct 12, 2023
ebcff8c
updated flags for release
amantham20 Oct 13, 2023
cc373bc
updated using the google clang format standard
amantham20 Oct 14, 2023
a8c03ce
Merge branch 'Dev' into Aman's-Workspace
amantham20 Oct 15, 2023
f3c6955
review suggested updates to sensors class
amantham20 Oct 15, 2023
9a20fa5
LGPAgent - Operations implemented
Oct 17, 2023
675aafb
Merge branch 'Dev' into GraphPrototype
ssitu Oct 17, 2023
1c99bc0
Merge branch 'Jason's-workspace' into Dev
amantham20 Oct 18, 2023
21fedb7
Export/import genotypes to/from string
ssitu Oct 18, 2023
81823db
markdown documentation
amantham20 Oct 18, 2023
dcda759
fixes for registers
amantham20 Oct 18, 2023
8cbbf0d
Update Group7_GPA.md
amantham20 Oct 18, 2023
da995a2
Only get output from nodes used in node function
ssitu Oct 18, 2023
c71fbc6
Cleaned up LGPAgent a little bit
Oct 18, 2023
e7c3d8f
Update Group7_GPA.md
amantham20 Oct 18, 2023
31bf368
Merge branch 'Dev' of https://github.com/amantham20/CSE491_GP_Group7 …
amantham20 Oct 18, 2023
881dbd7
Change char to symbol in main
ssitu Oct 18, 2023
aee0fc9
Clang format use default indent level = 2
ssitu Oct 18, 2023
bcc1fb1
base64 support for doubles
ssitu Oct 18, 2023
d334d68
Fixes from core code
amantham20 Oct 19, 2023
99c51fb
print for direct in agent
amantham20 Oct 19, 2023
b95613d
update on notes
amantham20 Oct 19, 2023
7e3f847
printing of generated seq
amantham20 Oct 19, 2023
86e1ac6
Moved attributes from LPGA to CoreObject
amantham20 Oct 19, 2023
1763fd4
Removed GP_Classes requirement
amantham20 Oct 19, 2023
f861d22
renamed GPAgent
amantham20 Oct 19, 2023
423a810
Rename GP agent
amantham20 Oct 19, 2023
c7c9cfc
Update Group7_GPA.md
amantham20 Oct 19, 2023
d3263a0
Code clean up refactor
amantham20 Oct 19, 2023
8f83e28
updated tests for register
amantham20 Oct 19, 2023
09cf19e
Google stand refactor prettify
amantham20 Oct 19, 2023
c2f9e87
updated tests
amantham20 Oct 19, 2023
bc545ba
Added default node output to genotype
ssitu Oct 19, 2023
b85a5dc
Add test for default output in genotype
ssitu Oct 19, 2023
34089c9
Refactor mutations
ssitu Oct 19, 2023
f735135
Use const iterators
ssitu Oct 19, 2023
f7cae40
Forgot to include functional
ssitu Oct 19, 2023
11b40d3
Rename GPAgent to resolve conflict, will unify later
ssitu Oct 19, 2023
9eee35c
Merge branch 'Dev' into GraphPrototype
ssitu Oct 19, 2023
42eb259
Output mutations can be additive
ssitu Oct 20, 2023
1352b6a
Added a default mutate method
ssitu Oct 20, 2023
aa10097
Remove unused GraphNode member
ssitu Oct 25, 2023
c8bdc2f
Remove virtual from GraphNode.GetOutput
ssitu Oct 25, 2023
d60594c
Docs and quick fixes
ssitu Oct 25, 2023
e5005b0
Method chaining, and cleanup of genotype tests
ssitu Oct 25, 2023
b9935b7
Clean up
ssitu Oct 25, 2023
7481a47
Docs
ssitu Oct 26, 2023
a6e3ca3
Remove virtual from graph node destructor
ssitu Oct 26, 2023
399ec59
Use emplace back
ssitu Oct 30, 2023
5f9819b
Use mutate default in test case
ssitu Oct 30, 2023
7cd5313
Simplify code and test cases
ssitu Oct 30, 2023
d7e8b26
Clarify some test cases
ssitu Oct 30, 2023
76155dd
Merge branch 'Dev' into GraphPrototype
ssitu Nov 1, 2023
0f5e823
updated code
amantham20 Nov 1, 2023
654d1ab
MultiThreadingn enabled
amantham20 Nov 3, 2023
04ca5fd
added a simple fitness function
amantham20 Nov 3, 2023
258034f
Merge branch 'GraphPrototype' into GPLoop-amanXsimon-CGPA
amantham20 Nov 3, 2023
32189c4
Remove unused function GraphNode.GetInput
ssitu Nov 3, 2023
e464949
Add a mutate function to GPAgent
ssitu Nov 3, 2023
39a3a59
Update tests
ssitu Nov 3, 2023
039ca96
refactored CGPA
amantham20 Nov 3, 2023
d8a42cf
Added base virtual functions for GP agent
amantham20 Nov 3, 2023
70f7f3f
Fixed Genotype
amantham20 Nov 3, 2023
fdd0364
updated GP runner
amantham20 Nov 3, 2023
9ee5d93
created a new maze
amantham20 Nov 3, 2023
d9a6843
udpated GP loop
amantham20 Nov 3, 2023
e2b3a4c
reformat
amantham20 Nov 4, 2023
850b2c1
updates to list
amantham20 Nov 4, 2023
e0b3f0b
Add method for copying agent behaviors
ssitu Nov 6, 2023
701f344
renameworld
amantham20 Nov 6, 2023
957b038
Remove GPU multi threading
amantham20 Nov 6, 2023
e8fb552
Update .gitmodules
amantham20 Nov 6, 2023
4904ef5
updates
amantham20 Nov 6, 2023
6f392e3
Merge branch 'GraphPrototype' into GPLoop-amanXsimon-CGPA
amantham20 Nov 6, 2023
9347976
Fix Mutate only happening on an empty genotype
ssitu Nov 6, 2023
75cee4b
Move default genotype creation to Initialize
ssitu Nov 6, 2023
7ba4de9
updated working gp loop
amantham20 Nov 6, 2023
a4e2e4a
Update default_maze.grid
amantham20 Nov 6, 2023
2d31d53
Merge branch 'GraphPrototype' into GPLoop-amanXsimon-CGPA
amantham20 Nov 6, 2023
f772fe8
update a lot of things
amantham20 Nov 6, 2023
1c4e945
Fix base64 for doubles < 1; Various fixes
ssitu Nov 7, 2023
69919ba
updated
amantham20 Nov 7, 2023
2524f26
wokring part of XML
amantham20 Nov 7, 2023
683be76
Merge branch 'Jason's-workspace' into GPLoop-amanXsimon-CGPA
amantham20 Nov 7, 2023
5962657
Merge branch 'GraphPrototype' into GPLoop-amanXsimon-CGPA
amantham20 Nov 7, 2023
f49fad5
more and more changes
amantham20 Nov 7, 2023
47a03ea
we good -TMG
amantham20 Nov 8, 2023
861a3f8
updates to a new agent to test
amantham20 Nov 8, 2023
43e30dd
updates of xml serialization
amantham20 Nov 8, 2023
877ac1c
Merge branch 'development' into xml-Serialize-Deserialize
amantham20 Nov 8, 2023
d1cf66d
added memory include
amantham20 Nov 8, 2023
b390927
added another include 'algorithm' 🤞
amantham20 Nov 8, 2023
d6a759e
updated tests :wink:
amantham20 Nov 8, 2023
0e37ac2
Some changes to gp loop
ssitu Nov 10, 2023
a6f4cc0
Merge branch 'upsteam-Dev' into GPLoop-amanXsimon-CGPA
amantham20 Nov 10, 2023
0d9c9ef
more and more changes and merge fixes
amantham20 Nov 10, 2023
1c37b38
Moved files around like a game of musical chairs. Nobody's left stand…
amantham20 Nov 10, 2023
4ffa9da
commented out the reset previous state
amantham20 Nov 10, 2023
60af97f
Merge branch 'xml-Serialize-Deserialize' into GPLoop-amanXsimon-CGPA
amantham20 Nov 10, 2023
60007e2
Saved the XML file from the digital Bermuda Triangle 🌊. We won't lose…
amantham20 Nov 10, 2023
3338486
removed code format for Github actions
amantham20 Nov 10, 2023
885bfef
Add include and override pure virtual method
ssitu Nov 10, 2023
5aa4d5b
More efficient ull to b64
ssitu Nov 10, 2023
47fc52e
working with time set for logfiles
amantham20 Nov 10, 2023
93480ef
updated saving with multi saving data
amantham20 Nov 10, 2023
0c6f232
removed the problamatic files
amantham20 Nov 10, 2023
442c208
added files names
amantham20 Nov 10, 2023
ccb9818
Change back default maze
ssitu Nov 10, 2023
402f73c
Remove sstream
ssitu Nov 10, 2023
bf347ab
Expanded function set
ssitu Nov 11, 2023
3b7a0ce
Improvements to cgp genotype
ssitu Nov 11, 2023
6f4894a
Update test case from genotype change
ssitu Nov 11, 2023
2db90b8
10000 generations test run (Better fitness function)
ssitu Nov 11, 2023
807bfa9
Replace operator[] with at
ssitu Nov 12, 2023
7b0ebba
More efficient B2ToB64
ssitu Nov 13, 2023
ab61eb9
Updated xml init
amantham20 Nov 13, 2023
1e0a34f
updated to ignore the long files
amantham20 Nov 13, 2023
12e3527
Delete savedata/GPAgent/AgentData_2023-11-10__19_02_19_10000_Generati…
amantham20 Nov 13, 2023
f77e720
Merge branch 'Temp2' into GPLoop-amanXSimon-CGPA
amantham20 Nov 13, 2023
2342541
Back to ../../
ssitu Nov 13, 2023
0997325
Merge branch 'GPLoop-amanXSimon-CGPA' of https://github.com/amantham2…
ssitu Nov 13, 2023
07443b5
refactor and working updates
amantham20 Nov 13, 2023
152933c
Merge branch 'GPLoop-amanXSimon-CGPA' of https://github.com/amantham2…
amantham20 Nov 13, 2023
ced1e02
Muti Threaded Spaghetti Code Feista? More like Thread-guetti Code! Mu…
amantham20 Nov 13, 2023
2c5d769
Switch from map to constexpr array
ssitu Nov 13, 2023
e73a4e0
updated to only run GP when required
amantham20 Nov 14, 2023
91c8dfd
Merge branch 'GPLoop-amanXSimon-CGPA' of https://github.com/amantham2…
amantham20 Nov 14, 2023
2b05f12
updated to include p threads
amantham20 Nov 14, 2023
a5f4358
added timing for each generation
amantham20 Nov 14, 2023
ac1d895
more documentation
amantham20 Nov 14, 2023
2cbe210
Implemented Mutate, Copy, and tests for LGPA
Nov 15, 2023
6eeb616
Rename GPAgent_ to GPAgentBase
ssitu Nov 15, 2023
44f1d96
Remove try catch block for GraphNode functions
ssitu Nov 16, 2023
7f310ad
Use random numbers from world
ssitu Nov 16, 2023
ac54a67
Add mock world into Graph tests for mutate
ssitu Nov 16, 2023
6fe17d0
Add missing mock world and remove a redundant test
ssitu Nov 16, 2023
9edf7fe
Add operator<< to genotype for std::ostream
ssitu Nov 16, 2023
a2cb267
Use raw ptr instead of weak_ptr for output ptr
ssitu Nov 17, 2023
b2e57e8
Seed the worlds in GP loop
ssitu Nov 17, 2023
b29a5d3
Removed early save data files
amantham20 Nov 17, 2023
4e7739a
added more docs for GP
amantham20 Nov 17, 2023
a488e28
updated ignore for savedata
amantham20 Nov 17, 2023
6f5f231
added coverage profiling
amantham20 Nov 17, 2023
a3e64ab
reformated code
amantham20 Nov 17, 2023
d0f8b12
added savedata back to for the program to compile properly
amantham20 Nov 17, 2023
71db7b6
updated white spaces in cmake and reformated code
amantham20 Nov 17, 2023
650f60a
updated and commented out par
amantham20 Nov 17, 2023
a123dbe
Merge branch 'GPLoop-amanXSimon-CGPA' into Jason's-workspace
amantham20 Nov 17, 2023
334a61c
changed GPAgent_ to GPAgentBase in LPAgent
amantham20 Nov 17, 2023
f9ac5a1
Aman did not return from non-void function :smile:
ssitu Nov 17, 2023
a895b38
Problems with memory leaks
amantham20 Nov 17, 2023
26e7927
Merge branch 'Jason's-workspace' into GPLoop-amanXSimon-CGPA
amantham20 Nov 17, 2023
f635cf6
more documentation and fixes
amantham20 Nov 20, 2023
0eafe1f
Add macro to opt-in parallel std algorithms
ssitu Nov 21, 2023
6b1f2d3
Add docs to GraphBuilder class
ssitu Nov 21, 2023
4a1002c
Negative values were getting clamped to zero
ssitu Nov 21, 2023
ae4e466
Added sensors to CGPAgent
ssitu Nov 21, 2023
5998c28
Add reciprocal function
ssitu Nov 22, 2023
856a7fc
Reduce size of default CGP graph
ssitu Nov 22, 2023
2dc2483
Each agent has their separate random number generator
ssitu Nov 22, 2023
cedc2c6
Set seed of agents and use random seed if seed is 0
ssitu Nov 22, 2023
58180b3
Delete Makefile
ssitu Nov 22, 2023
cf69087
Cleaned up compiler warnings
ssitu Nov 22, 2023
3fca7ad
Exorcised undefined behaviors and befriended CMake for memory sanitiz…
amantham20 Nov 25, 2023
e47ef23
Added mutation of graph structures
ssitu Nov 25, 2023
7b6d9db
added a progress bar
amantham20 Nov 25, 2023
069d812
Merge branch 'GPLoop-amanXSimon-CGPA' of https://github.com/amantham2…
amantham20 Nov 25, 2023
8f73a0a
updated pushback
amantham20 Nov 25, 2023
13364c9
refactor
amantham20 Nov 25, 2023
2e266e0
Documentation and sanitization
amantham20 Nov 26, 2023
1d2fc8c
Refactored
amantham20 Nov 26, 2023
c094f0e
updated grid numbering
amantham20 Nov 26, 2023
8232a40
Our save data just graduated from the School of Document Agnosticism.…
amantham20 Nov 26, 2023
365f6d7
MultiPostions works
amantham20 Nov 26, 2023
bb4b795
updated to printing
amantham20 Nov 26, 2023
783b3fa
formated the fitness scores
amantham20 Nov 26, 2023
84f28c3
updated and added metatag
amantham20 Nov 26, 2023
77aafae
Merge branch 'development' into GPLoop-amanXSimon-CGPA
amantham20 Nov 27, 2023
93e63a6
updated and added more documentation
amantham20 Nov 27, 2023
9529260
Merge branch 'development' into GPLoop-amanXSimon-CGPA
amantham20 Nov 27, 2023
6b63407
updated the maze back to default
amantham20 Nov 27, 2023
12192f6
removed spacing changed removed to reflect in PR
amantham20 Nov 27, 2023
7f6cd00
last spacing change I promise
amantham20 Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ cmake-build-*/

#mac
.DS_Store

#savedata/ #issues with xml save location

savedata/GPAgent/*.xml
#AgentData_*.xml


site
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "third_party/SFML"]
path = third_party/SFML
url = https://github.com/SFML/SFML.git
[submodule "third_party/tinyxml2"]
path = third_party/tinyxml2
url = https://github.com/leethomason/tinyxml2.git
218 changes: 154 additions & 64 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,182 @@ project(CSE_491)
# For now, default to building both the main app and tests
set(BUILD_MAIN 1)
set(BUILD_TESTS 1)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Test")
set(BUILD_MAIN 0)
set(BUILD_TESTS 1)
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Test")
set(BUILD_MAIN 0)
set(BUILD_TESTS 1)
endif ()

# Create a function to make .cmake files simpler
function(add_source_to_target TARGET_NAME SOURCE_PATH)
message(STATUS "Loading source: ${SOURCE_PATH}")
target_sources(${TARGET_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/${SOURCE_PATH}
)
message(STATUS "Loading source: ${SOURCE_PATH}")
target_sources(${TARGET_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/${SOURCE_PATH}
)
endfunction()

# Set the necessary C++ flags, some of which are configuration-specific
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wcast-align -Winfinite-recursion -Wnon-virtual-dtor -Wnull-dereference -Woverloaded-virtual -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Winfinite-recursion -Wnon-virtual-dtor -Wnull-dereference -Woverloaded-virtual -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")

set(CMAKE_CXX_FLAGS_COVERAGE "-O2 -g -fcoverage-mapping -fprofile-instr-generate -fprofile-arcs")

# Place all executables in the executable directory
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/executable)

# Move assets to build directory
file(COPY ./assets DESTINATION ${CMAKE_CURRENT_BINARY_DIR})


#option(BUILD_CLANG_LLVM "Build with clang for LLVM" OFF)
option(SANITIZE_MEMORY "Build with sanitizers for GP" OFF)
if (SANITIZE_MEMORY)

set(BUILD_MAIN 0)
set(BUILD_TESTS 0)

set(CMAKE_CXX_COMPILER "/opt/homebrew/opt/llvm/bin/clang++")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")

set(XML_SRC_DIR third_party/tinyxml2)
set(XML_BUILD_DIR xml_build)
add_subdirectory(${XML_SRC_DIR} ${XML_BUILD_DIR})

#added the executable
add_executable(gp_train_main source/gp_train_main.cpp)

#linking the targets
target_sources(gp_train_main PRIVATE source/core/Entity.cpp)
target_include_directories(gp_train_main
PRIVATE ${CMAKE_SOURCE_DIR}/source/core
${CMAKE_SOURCE_DIR}/source/Agents
)
target_link_libraries(gp_train_main
PRIVATE tinyxml2
PRIVATE pthread
)


endif ()





# Build the gp_train_main executable, if requested without SFML and Catch2
option(BUILD_GP_ONLY "Build only gp_main.cpp" OFF)
if (BUILD_GP_ONLY)
set(BUILD_MAIN 0)
set(BUILD_TESTS 0)

# Configure all of tinyxml2
set(XML_SRC_DIR third_party/tinyxml2)
set(XML_BUILD_DIR xml_build)
add_subdirectory(${XML_SRC_DIR} ${XML_BUILD_DIR})

#added the executable
add_executable(gp_train_main source/gp_train_main.cpp)

#linking the targets
target_sources(gp_train_main PRIVATE source/core/Entity.cpp)
target_include_directories(gp_train_main
PRIVATE ${CMAKE_SOURCE_DIR}/source/core
${CMAKE_SOURCE_DIR}/source/Agents
)
target_link_libraries(gp_train_main
PRIVATE tinyxml2
PRIVATE pthread
)

endif ()


# Build the main application executables, if requested
if(${BUILD_MAIN})

# Configure all of SFML
set(SFML_SRC_DIR third_party/SFML)
set(SFML_BUILD_DIR sfml_build)
add_subdirectory(${SFML_SRC_DIR} ${SFML_BUILD_DIR})


# Find all the main files for the various applications
# Currently this means any *.cpp file in the root of source
file(GLOB EXE_SOURCES CONFIGURE_DEPENDS RELATIVE ${CMAKE_SOURCE_DIR}/source source/*.cpp)
message(STATUS "List of main files to build: ${EXE_SOURCES}")

# Loop through each executable and build it!
foreach(EXE_SOURCE ${EXE_SOURCES})
# Rip the .cpp off the end of the string
string(REPLACE ".cpp" "" EXE_NAME ${EXE_SOURCE})
# Create list of source files (currently just the one .cpp file)
# Create executable and link to includes / libraries
add_executable(${EXE_NAME} ${CMAKE_SOURCE_DIR}/source/${EXE_SOURCE} ${CMAKE_SOURCE_DIR}/source/core/Entity.cpp)
target_include_directories(${EXE_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/source
)
target_link_libraries(${EXE_NAME}
PRIVATE sfml-window sfml-audio sfml-graphics sfml-system sfml-network
)
if(EXISTS ${CMAKE_SOURCE_DIR}/source/${EXE_NAME}.cmake)
message(STATUS "Loading ${EXE_NAME}.cmake")
include(${CMAKE_SOURCE_DIR}/source/${EXE_NAME}.cmake)
else()
message(WARNING "Cannot find ${EXE_NAME}.cmake")
endif()
endforeach()
endif()
if (${BUILD_MAIN})
# line to set santizers
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=[sanitizer]")
# can be set to address, undefined, thread, memory, or leak

# Build the test executables, if requested
if(${BUILD_TESTS})

# Configure Catch
set(CATCH_SRC_DIR third_party/Catch2)
set(CATCH_BUILD_DIR catch_build)
add_subdirectory(${CATCH_SRC_DIR} ${CATCH_BUILD_DIR})

# Configure only the networking portion of SFML
if(NOT ${BUILD_MAIN})
set(SFML_BUILD_WINDOW FALSE)
set(SFML_BUILD_GRAPHICS FALSE)
set(SFML_BUILD_AUDIO FALSE)
# Configure all of SFML
set(SFML_SRC_DIR third_party/SFML)
set(SFML_BUILD_DIR sfml_build)
add_subdirectory(${SFML_SRC_DIR} ${SFML_BUILD_DIR})
endif()

# Setup CTest
include(CTest)
enable_testing()

# Tunnel into test directory CMake infrastructure
add_subdirectory(tests)
endif()
#configure the xml library
set(XML_SRC_DIR third_party/tinyxml2)
set(XML_BUILD_DIR xml_build)
add_subdirectory(${XML_SRC_DIR} ${XML_BUILD_DIR})


# Find all the main files for the various applications
# Currently this means any *.cpp file in the root of source
file(GLOB EXE_SOURCES CONFIGURE_DEPENDS RELATIVE ${CMAKE_SOURCE_DIR}/source source/*.cpp)
message(STATUS "List of main files to build: ${EXE_SOURCES}")



# Loop through each executable and build it!
foreach (EXE_SOURCE ${EXE_SOURCES})
# Rip the .cpp off the end of the string
string(REPLACE ".cpp" "" EXE_NAME ${EXE_SOURCE})
# Create list of source files (currently just the one .cpp file)
# Create executable and link to includes / libraries
add_executable(${EXE_NAME} ${CMAKE_SOURCE_DIR}/source/${EXE_SOURCE} ${CMAKE_SOURCE_DIR}/source/core/Entity.cpp)
target_include_directories(${EXE_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/source
)
target_link_libraries(${EXE_NAME}
PRIVATE sfml-window sfml-audio sfml-graphics sfml-system sfml-network
)

target_link_libraries(${EXE_NAME}
PRIVATE tinyxml2
)

if (EXISTS ${CMAKE_SOURCE_DIR}/source/${EXE_NAME}.cmake)
message(STATUS "Loading ${EXE_NAME}.cmake")
include(${CMAKE_SOURCE_DIR}/source/${EXE_NAME}.cmake)
else ()
message(WARNING "Cannot find ${EXE_NAME}.cmake")
endif ()
endforeach ()
endif ()

# Build the test executables, if requested
if (${BUILD_TESTS})

# Configure Catch
set(CATCH_SRC_DIR third_party/Catch2)
set(CATCH_BUILD_DIR catch_build)
add_subdirectory(${CATCH_SRC_DIR} ${CATCH_BUILD_DIR})


# Configure only the networking portion of SFML
if (NOT ${BUILD_MAIN})
set(SFML_BUILD_WINDOW FALSE)
set(SFML_BUILD_GRAPHICS FALSE)
set(SFML_BUILD_AUDIO FALSE)
set(SFML_SRC_DIR third_party/SFML)
set(SFML_BUILD_DIR sfml_build)
add_subdirectory(${SFML_SRC_DIR} ${SFML_BUILD_DIR})

set(XML_SRC_DIR third_party/tinyxml2)
set(XML_BUILD_DIR xml_build)
add_subdirectory(${XML_SRC_DIR} ${XML_BUILD_DIR})


endif ()


# Setup CTest
include(CTest)
enable_testing()

# Tunnel into test directory CMake infrastructure
add_subdirectory(tests)
endif ()
29 changes: 29 additions & 0 deletions assets/grids/default_maze2.grid
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# # # #
# ### # ########## # ########## # ######### #
# # # # # # # # # # # #
# # ### ## # ### # ############ ##### ### # #
# # # # # # # # # # #
# ##### # # # ### # ###### ###### ##### ### #
# # # # # # # # # # #
##### # ###### # ###### # ## # ###### ####### # ## #
# # # # ## # # # #
# ############## ##### # # # ###### # ######### #
# # # # # # # # # #
############### # ### ###### # # #### # # ##### # #
# # # # # # # # # # #
# ############### ##### # # ######## ##### # # #
# # # # # # # #
# #################### ########### # ######### #
# # # # #
# # # ################### ############# ########## #
# # # # #
# ################ ############### ####### #
# # # # # # #
# # # # # ##################################### # #
# # # # # # # # #
# # # # # # ################################### # #
# # # # # # # #
# # ################################ # #
# # # # # # # # # #
# # # # # # # ############################### # #
# # # # # # # # # #
9 changes: 9 additions & 0 deletions assets/grids/empty_maze.grid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*
*
*
*
*
*
*
*
*
85 changes: 85 additions & 0 deletions docs/Group_7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Group 7 : Genetic Programming Agents
-- --
authors: Aman, Simon, Rajmeet, Jason



<img src="assets/GP_Group7/Group7Photo.jpeg" style="max-width: 700px">

(Img: Rajmeet, Simon, Jason, Aman)

## Introduction

## GP Agent Base Class

## LGP Agent

## CGP Agent

## GP Loop


## It runs on my machine
we have used cmake to ensure that our code compiles on all platforms. but....
we have tested our code on the following machines/architectures:
- Windows 11
- Windows 10
- Ubuntu 20.04
- HPCC Cluster Centos7
- MacOS Sonoma (ARM)
- mlcollard/linux-dev (Docker Container)

Tested in the following IDEs:
- CLion
- VSCode

Tested on the following compilers:
- gcc 9.3.0
- Apple clang 12.0.0
- LLVM clang 11.0.0

### Profiled with and optimized with:
- clion profiler
<br />/
<img src="assets/GP_Group7/ProfilerGP_Clion.png" style="max-width: 800px; max-width: 300px;">


- Xcode instruments
<br />
<img src="assets/GP_Group7/ProfilerGP_Xcode.png" style="max-width: 800px; max-width: 300px;">

- intel vtune
<br />
<img src="assets/GP_Group7/ProfilerGP_IntelVTune.png" style="max-width: 800px; max-width: 300px;">

- very sleepy
Didnt deserve a screenshot. /s

- code coverage in clion
<img src="assets/GP_Group7/CodeCoverage_Clion.png" style="max-width: 800px; max-width: 300px;">


### Sanitized with:

- clang sanitizer Memory
- valgrind
- gcc sanitizer Memory
- gcc sanitizer address
- Used to find and fix memory UB in the code.
<img src="assets/GP_Group7/UB_Behavior.png" />


## Other Contributions

### EasyLogging
Created a logging class that is can be used to log debug messages in debug mode. Teams can be specified to log with different levels of verbosity. This is useful for debugging and profiling.

### CMake
Initial cmake setup for the project. This is useful for cross platform compilation and testing.

### serializationUsingTinyXML2
Created and tested a serialization class that can be used to serialize and deserialize objects to and from xml files. This is useful for saving and loading the state of the GP agents.
Implemented serialization pattern using tinyxml2 library.

### mkdocs documentation
Created and tested a mkdocs documentation for the project. This is useful for creating a website for the project.
Binary file added docs/assets/GP_Group7/CodeCoverage_Clion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/GP_Group7/Group7Photo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/GP_Group7/ProfilerGP_Clion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/GP_Group7/ProfilerGP_IntelVtune.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/GP_Group7/ProfilerGP_Xcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/GP_Group7/UB_Behavior.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading