Skip to content

Commit

Permalink
Merge pull request #2 from emilydolson/submodule-emp
Browse files Browse the repository at this point in the history
Submodularize Empirical
  • Loading branch information
mmore500 authored Feb 13, 2024
2 parents b53e0c5 + 2e19920 commit eb71349
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
9 changes: 7 additions & 2 deletions avida-core/source/main/cOrgMessagePredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<MessageCounts::iterator, plus<int> >()) << " ";
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;
}
Expand Down
3 changes: 1 addition & 2 deletions build_avida
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

set -e

git submodule init
git submodule update
git submodule update --init --recursive

do_build() {
(
Expand Down
1 change: 1 addition & 0 deletions libs/Empirical
Submodule Empirical added at 908c26

0 comments on commit eb71349

Please sign in to comment.