diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3c21c924..a76f55ade 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,7 +56,6 @@ jobs: docker-build: name: Docker Image Build runs-on: ubuntu-22.04 - needs: tests if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2 diff --git a/.gitmodules b/.gitmodules index c046d2d5e..21bfe1fce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "libs/backward-cpp"] path = libs/backward-cpp url = https://github.com/bombela/backward-cpp.git +[submodule "libs/Empirical"] + path = libs/Empirical + url = https://github.com/devosoft/Empirical.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 878aa9ba8..f6f10c15b 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -5,7 +5,7 @@ "defines": [], "cStandard": "c11", "browse": { - "path": [ "${workspaceFolder}", "${workspaceFolder}/avida-core/include/public", "${workspaceFolder}/avida-core/include/private", "${workspaceFolder}/../Empirical/source", "${workspaceFolder}/avida-core/include/public/avida/core/*" ], + "path": [ "${workspaceFolder}", "${workspaceFolder}/avida-core/include/public", "${workspaceFolder}/avida-core/include/private", "${workspaceFolder}/libs/Empirical/include/emp", "${workspaceFolder}/avida-core/include/public/avida/core/*" ], "limitSymbolsToIncludedHeaders": true }, "includePath": [ @@ -19,7 +19,7 @@ "${workspaceFolder}/avida-core/source/core", "${workspaceFolder}/avida-core/source/actions", "${workspaceFolder}/avida-core/source/script", - "${workspaceFolder}/../Empirical/source" + "${workspaceFolder}/libs/Empirical/include/emp" ] } ], diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da035567..e901a6aff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ SET(LIBRARY_OUTPUT_PATH "Built libraries are placed here before installation." ) -INCLUDE_DIRECTORIES(../Empirical/include/emp) +INCLUDE_DIRECTORIES(libs/Empirical/include/emp) ADD_SUBDIRECTORY(libs/apto) if(NOT WIN32 AND NOT DEFINED ENV{AVIDA_DISABLE_BACKTRACE}) @@ -34,7 +34,7 @@ IF(NOT WIN32) ADD_SUBDIRECTORY(libs/tcmalloc-1.4) ENDIF(NOT WIN32) ADD_SUBDIRECTORY(avida-core) -# ADD_SUBDIRECTORY(../Empirical/include/emp .) +# ADD_SUBDIRECTORY(libs/Empirical/include/emp .) # Default location for installed software/configs/ docs is the build directory. SET(CMAKE_INSTALL_PREFIX diff --git a/README.md b/README.md index afbe6e6f3..3639bf08b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ This is a version of Avida with the systematics tracker and open-ended evolution metrics from [Empirical](https://github.com/devosoft/Empirical). -Specifically, it has been tested and is known to be compatible with [this release](https://github.com/emilydolson/Empirical/tree/OEE_metrics_paper_submission) -of Empirical. The build file expects the directory containing that version of Empirical to be in the same directory as this -repository (i.e. `ls` should show `Empirical` and `avida-empirical`). +Empirical is managed as a submodule in this repository, pinned to a known-compatible commit. Other than that, this is the same as normal Avida. The README for normal Avida follows. diff --git a/avida-core/source/main/cOrgMessagePredicate.h b/avida-core/source/main/cOrgMessagePredicate.h index 2778c1cfe..837754e47 100644 --- a/avida-core/source/main/cOrgMessagePredicate.h +++ b/avida-core/source/main/cOrgMessagePredicate.h @@ -86,8 +86,13 @@ struct cOrgMessagePred_CountDemeMessages : public cOrgMessagePredicate { } virtual void Print(int update, std::ostream& out) { - // out << update << " COUNT " << - // std::accumulate(m_msg_counts.begin(), m_msg_counts.end(), 0, apply2nd >()) << " "; + out << update << " COUNT " << + std::accumulate( + std::begin(m_msg_counts), + std::end(m_msg_counts), + int{}, + [](auto first, auto second) { return first + second.second; } + ) << " "; for(MessageCounts::iterator i=m_msg_counts.begin(); i!=m_msg_counts.end(); ++i) { out << " " << i->second; } diff --git a/build_avida b/build_avida index c203d748d..616f016ae 100755 --- a/build_avida +++ b/build_avida @@ -2,8 +2,7 @@ set -e -git submodule init -git submodule update +git submodule update --init --recursive do_build() { ( diff --git a/libs/Empirical b/libs/Empirical new file mode 160000 index 000000000..908c2653d --- /dev/null +++ b/libs/Empirical @@ -0,0 +1 @@ +Subproject commit 908c2653d6da4eb3a18e0fbb7b1c653daa1ee5b8