Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
0a6f0c3
Fixed the mean pesky Bug and things should be working :)
Jun 11, 2026
d58c7ae
Spacial Struct for Testing Purposes
Jun 11, 2026
5e44007
Renae SpatialStructures.h => SpatialStructure.h
amlalejini Jun 16, 2026
dff9228
Add bidirectional connect and disconnect functions, tweak comments/fo…
amlalejini Jun 16, 2026
132e450
Formatting, reorder includes
amlalejini Jun 17, 2026
69e3ec1
Merge branch 'main' into spatial-struct-lalejini
amlalejini Jun 17, 2026
d65596d
Shift to using enum for spatial structure modes. Start breaking up sp…
amlalejini Jun 17, 2026
dc31fab
POP_SIZE => INIT_POP_SIZE config name change
amlalejini Jun 17, 2026
e81ef3f
Draft implementation of SetPopStruct_Load
amlalejini Jun 17, 2026
967b5d7
Add grid2d utilities, cleanup some spacing inconsistencies, continue …
amlalejini Jun 18, 2026
86bec9f
Add spatial structure setup to sgp mode, add set mutation zero functi…
amlalejini Jun 18, 2026
6934e55
Shift phylogeny taxon type and tag metric type to string cfg with enu…
amlalejini Jun 18, 2026
2ece883
Update makefile to include TAG_NUM_BITS compiler argument
amlalejini Jun 18, 2026
3e64c99
Compiler error fixes for default mode
amlalejini Jun 18, 2026
cf45d63
Fix assert for init pop size
amlalejini Jun 18, 2026
4f5cfbc
Mark functions that can be const as const
amlalejini Jun 18, 2026
2429220
Fixing downstream effects of marking base class functions as const, m…
amlalejini Jun 18, 2026
2e50689
Fix warning about type mismatch in comparison
amlalejini Jun 19, 2026
7bbcd0c
Fix warning about type mismatch in comparison
amlalejini Jun 19, 2026
a116fa3
Fix downstream effects of marking base Organism functions as const in…
amlalejini Jun 19, 2026
23d050c
Fix downstream effects of marking Organism functions as const in lysi…
amlalejini Jun 19, 2026
6ad1629
Fix downstream effects of marking Organism functions as const in pgg …
amlalejini Jun 19, 2026
0fd22bc
Remove spatial structure example in root directory now that we have t…
amlalejini Jun 19, 2026
ace91af
Tests compiling, but not passing yet
amlalejini Jun 20, 2026
a9a95b3
Updating spatial structure mode in tests
amlalejini Jun 20, 2026
bf249b0
Add testing utilities, add sym world wrapper for exposing protected f…
amlalejini Jun 20, 2026
df51faf
Continue updating tests to accomodate spatial structure changes
amlalejini Jun 20, 2026
4ea5b4c
Update existing spatial structure and tag matching tests to accomodat…
amlalejini Jun 20, 2026
10d72f7
Reindent for consistency
amlalejini Jun 20, 2026
2abc052
Reindent files for consistency
amlalejini Jun 20, 2026
03ac4dd
In progress updating bacterium phage unit tests to accomodate spatial…
amlalejini Jun 20, 2026
3d662df
Update lysis world tests to accomodate changes to spatial structure, …
amlalejini Jun 20, 2026
9cd572e
Update PGGWorld tests
amlalejini Jun 20, 2026
8354e68
Switch to AddOrgAt function for sgp mode setup hosts function
amlalejini Jun 22, 2026
7e96bc5
Shift SetupHosts, SetupSymbionts to protected in pggmode, use AddOrgA…
amlalejini Jun 23, 2026
b4a1d78
Shift SetupHosts and SetupSymbionts to protected, use AddOrgAt instea…
amlalejini Jun 23, 2026
6d05526
Combine sgp and default utils.h, move into source/ with base classes
amlalejini Jun 23, 2026
7e08479
Expose SetupHosts and SetupSymbionts in test world wrapper utility
amlalejini Jun 23, 2026
f526128
Found and Updated test
Jun 23, 2026
21829d6
Tests compiling again after shifting SetupHosts and SetupSymbionts to…
amlalejini Jun 23, 2026
795c3de
Updated test that used old 'Grid' config Var
Jun 23, 2026
96842dc
Update some tests for changes to setup hosts and setup symbionts
amlalejini Jun 24, 2026
04e881b
Add another testing utility function for configuring a world of a giv…
amlalejini Jun 24, 2026
0c6612a
Adjust asserts to allow for empty population setup
amlalejini Jun 24, 2026
8f9220f
Add GetSymbiont accessors to host for convenience
amlalejini Jun 26, 2026
7b5b67f
STARTING_TAGS_ONE_PROB renamed to HOST_STARTING_TAGS_ONE_PROB
amlalejini Jun 26, 2026
172c3e5
Continue updating tests
amlalejini Jun 26, 2026
b4a1c32
Continue updating tests
amlalejini Jun 26, 2026
d3d388d
InjectHost no longer grows world capacity, update tests accordingly
amlalejini Jun 26, 2026
5ff05e7
Move resize to protected, add additional const getters
amlalejini Jun 26, 2026
edee9f8
Update tests to accomodate changes to Inject functions, AddOrgAt, and…
amlalejini Jun 26, 2026
69a3d08
Update instructions unit tests
amlalejini Jun 26, 2026
2cbe01f
Update sgp health mode tests
amlalejini Jun 26, 2026
367a3c6
Update nutrient functional tests
amlalejini Jun 26, 2026
6f4092c
Update program builder functional test
amlalejini Jun 27, 2026
ad380de
Update sense task test
amlalejini Jun 27, 2026
b75b960
Update sgp symbiont task test
amlalejini Jun 27, 2026
f538915
Update sgp host sgp symbiont test
amlalejini Jun 27, 2026
fa8a160
Update SGPSymbiont_Reproduce tests
amlalejini Jun 27, 2026
7108a3f
Update SGPWorld functional tests
amlalejini Jun 29, 2026
3c0c5cc
Update SGPWorld data functional tests
amlalejini Jun 29, 2026
ef2c21b
Update stress mode functional tests
amlalejini Jun 29, 2026
3fdde17
Update temp changing environments functional tests
amlalejini Jun 29, 2026
10a715a
Deleted commented out redundant config
amlalejini Jun 29, 2026
f3ebe21
Add testing utils for zeroing out mutation rate
amlalejini Jun 29, 2026
24faf29
Update program builder unit tests
amlalejini Jun 29, 2026
8202340
Update cure hosts unit test
amlalejini Jun 29, 2026
db727a4
Update sgp world data unit test
amlalejini Jun 29, 2026
3b8d7ea
Update sgp world setup unit tests
amlalejini Jun 29, 2026
6c77b90
Update sgp world unit tests
amlalejini Jun 29, 2026
7d5b15c
Update sgp host unit tests
amlalejini Jun 29, 2026
4e0f198
Update sgp symbiont unit test
amlalejini Jun 29, 2026
ca24857
Update sgp host tasks functional tests
amlalejini Jun 29, 2026
0427ab4
Update sgp host reproduce functional test
amlalejini Jun 29, 2026
5216a78
Update sgp hardware tasks functional tests
amlalejini Jun 29, 2026
51a92f6
Update cmdline parameters on run symbulation CI action
amlalejini Jun 30, 2026
bf1e94b
Update spatial structure vt integration test, formatting edits for co…
amlalejini Jun 30, 2026
261eed6
Adjust whitespace for consistency
amlalejini Jun 30, 2026
eef19dc
Update lysongeny plr integration test
amlalejini Jun 30, 2026
a6a751d
Adjust whitespace for consistency
amlalejini Jun 30, 2026
cd22128
Updates to dirty transmission integration test
amlalejini Jun 30, 2026
e6ede9c
Update multi-infection integration test
amlalejini Jun 30, 2026
87f2e87
Adjust path to utilities tests
amlalejini Jun 30, 2026
f8caf86
Remove unused type aliases
amlalejini Jun 30, 2026
5f41010
Merged Owen's unit tests
amlalejini Jun 30, 2026
11a97ee
Consolidate Owen's spatial structure tests into existing spatial stru…
amlalejini Jun 30, 2026
0882dec
Merge main, resolve conflicts
amlalejini Jun 30, 2026
00a4905
Update whitespace for consistency
amlalejini Jun 30, 2026
35e5942
Implement tests for SpatialStructure class
amlalejini Jul 2, 2026
43b5552
Move prior spatial structure tests into new file to distinguish from …
amlalejini Jul 2, 2026
398e71e
Tag spatial structure class unit tests with default-mode
amlalejini Jul 2, 2026
ad4778a
Implement tests for custom population structure for SymWorld
amlalejini Jul 2, 2026
ea40c86
Add spatial structure config files for tests
amlalejini Jul 2, 2026
2b162a0
Remove old commented out test
amlalejini Jul 2, 2026
033ec92
Implement sgpmode version of population structure tests, fix bug in S…
amlalejini Jul 2, 2026
ac2815d
Add population structure test files to test main
amlalejini Jul 2, 2026
4cbc4b8
Add asserts to run experiment functions to check spatial structure setup
amlalejini Jul 2, 2026
296be61
Add tag length to run config snapshot
amlalejini Jul 2, 2026
c12bf5b
Merge main, resolve conflicts
amlalejini Jul 2, 2026
623edb0
Resolve missed conflict in program builder test
amlalejini Jul 2, 2026
83ec073
Fixup previous merge conflict resolution in stress mode test
amlalejini Jul 2, 2026
6e50f9e
Fix tags and test names in sgp mode population structure test
amlalejini Jul 2, 2026
0b8bbfe
Update tests to accomodate setup spatial structure assert
amlalejini Jul 2, 2026
fd27b67
Update tests to accomodate spatial structure setup assert
amlalejini Jul 2, 2026
604aea2
Merge branch 'main' into spatial-struct-lalejini
anyaevostinar Jul 8, 2026
afb6682
Add doc strings requested in pull request review
amlalejini Jul 9, 2026
ad0f1a8
Merge branch 'spatial-struct-lalejini' of https://github.com/amlaleji…
amlalejini Jul 9, 2026
bd6180a
Switch if statement / exception throw to emp assert for SetIntVal fun…
amlalejini Jul 9, 2026
64b8b03
Fix comment typo in Symbiont.h
amlalejini Jul 9, 2026
8b55823
Fix docstring formatting in spatial structure class
amlalejini Jul 9, 2026
a0a653b
Implement SGPWorld SetMutationZero function
amlalejini Jul 9, 2026
5a54258
Addressed pull request comments in SymWorld.h
amlalejini Jul 9, 2026
36ed5ca
Remove commented out print statement
amlalejini Jul 9, 2026
5ea1bef
Remove comment addressed in PR dicussion
amlalejini Jul 9, 2026
6f8fea9
Remove inaccurate comment from tag matching test
amlalejini Jul 9, 2026
e6b09ff
Remove comment as discussed in PR
amlalejini Jul 9, 2026
ad7fa5b
Fix typo in comment
amlalejini Jul 9, 2026
cb0478b
Add docstrings to utils functions
amlalejini Jul 9, 2026
8877aba
Get rid of warning about control reaching end of non-void function wi…
amlalejini Jul 9, 2026
a03d668
Remove duplicate function definition
amlalejini Jul 9, 2026
05d8970
Remove throw test for switch to emp_assert
amlalejini Jul 9, 2026
86c88db
Fix asserts in SetIntVal functions
amlalejini Jul 9, 2026
33835f6
Update tests to accomodate switch to emp_assert in SetIntVal functions
amlalejini Jul 9, 2026
d450238
Move grid 2d utility functions to spatial_utils.h, update SymWorld to…
amlalejini Jul 9, 2026
15d2e38
Remove debug output for new host position
anyaevostinar Jul 10, 2026
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: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
submodules: "recursive"

- name: run symbulation
run: cd SymbulationEmp && make debug-default && ./symbulation_default -GRID_X 5 -GRID_Y 5
run: cd SymbulationEmp && make debug-default && ./symbulation_default -WORLD_WIDTH 5 -WORLD_HEIGHT 5

# Runs a single command using the runners shell
- name: Make tests
run: sudo apt-get update && sudo apt-get install gdb && cd SymbulationEmp && make coverage

- name: Generate coverage
run: cd SymbulationEmp && gcov -abcfu symbulation.test-main.cc

- name: Upload coverage
uses: codecov/codecov-action@v5
with:
Expand All @@ -41,7 +41,7 @@ jobs:
exclude: SymbulationEmp/source/catch,SymbulationEmp/stats_scripts,SymbulationEmp/web,SymbulationEmp/Empirical,SymbulationEmp/coverage_source,SymbulationEmp/source/test,SymbulationEmp/signalgp-lite
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

#- name: test web build
# run: cd SymbulationEmp/emsdk && ./emsdk install 3.1.18 && ./emsdk activate 3.1.18 && source ./emsdk_env.sh && cd .. && make web

8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
TEST_DIR := source/catch
EMP_DIR := Empirical/include
SGP_DIR := signalgp-lite/include
TAG_NUM_BITS = 32

# Flags to use regardless of compiler
VENDORIZE_EMP_FLAGS := -DUIT_VENDORIZE_EMP -DUIT_SUPPRESS_MACRO_INSEEP_WARNINGS
CFLAGS_all := -Wall -Wno-unused-function -std=c++20 -I$(EMP_DIR)/ -I$(SGP_DIR)/ ${VENDORIZE_EMP_FLAGS}
COMPILE_TIME_ARGS := -DTAG_NUM_BITS=$(TAG_NUM_BITS)
CFLAGS_all := -Wall -Wno-unused-function -std=c++20 $(COMPILE_TIME_ARGS) -I$(EMP_DIR)/ -I$(SGP_DIR)/ ${VENDORIZE_EMP_FLAGS}

# Native compiler information
CXX_nat := g++
Expand Down Expand Up @@ -158,6 +160,10 @@ test-debug-sgp:
$(CXX_nat) $(CFLAGS_nat_debug) $(TEST_DIR)/main.cc -o symbulation.test
./symbulation.test [sgp] || { gdb ./$@.out --ex="catch throw" --ex="set confirm off" --ex="run" --ex="backtrace" --ex="quit"; exit 1; }

test-debug-events:
$(CXX_nat) $(CFLAGS_nat_debug) $(TEST_DIR)/main.cc -o symbulation.test
./symbulation.test [events] || { gdb ./$@.out --ex="catch throw" --ex="set confirm off" --ex="run" --ex="backtrace" --ex="quit"; exit 1; }

test-executable:
$(CXX_nat) $(CFLAGS_nat) $(TEST_DIR)/main.cc -o symbulation.test

Expand Down
34 changes: 22 additions & 12 deletions source/ConfigSetup.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <limits>

#include "../Empirical/include/emp/config/config.hpp"

const int TAG_LENGTH = 32;
#include <limits>
#include <string>

// Allow for compile-time tag size configuration
#ifndef TAG_NUM_BITS
#define TAG_NUM_BITS 32
#endif
constexpr size_t TAG_LENGTH = TAG_NUM_BITS;

EMP_BUILD_CONFIG(SymConfigBase,
GROUP(MAIN, "Global Settings"),
Expand All @@ -13,9 +20,7 @@ EMP_BUILD_CONFIG(SymConfigBase,
VALUE(VERTICAL_TRANSMISSION, double, 0.7, "Value 0 to 1 of probability of symbiont vertically transmitting when host reproduces"),
VALUE(HOST_INT, double, -2, "Interaction value from -1 to 1 that hosts should have initially, -2 for random"),
VALUE(SYM_INT, double, -2, "Interaction value from -1 to 1 that symbionts should have initially, -2 for random"),
VALUE(GRID_X, int, 100, "Width of the world, just multiplied by the height to get total size"),
VALUE(GRID_Y, int, 100, "Height of world, just multiplied by width to get total size"),
VALUE(POP_SIZE, int, -1, "Starting size of the host population, -1 for full starting population"),
VALUE(INIT_POP_SIZE, int, -1, "Starting size of the host population, -1 for full starting population"),
VALUE(SYM_LIMIT, int, 1, "Number of symbiont allowed to infect a single host"),
VALUE(START_MOI, double, 1, "Ratio of symbionts to hosts that experiment should start with"),
VALUE(UPDATES, int, 1001, "Number of updates to run before quitting"),
Expand All @@ -26,7 +31,6 @@ EMP_BUILD_CONFIG(SymConfigBase,
VALUE(HOST_REPRO_RES, double, 1000, "How many resources required for host reproduction"),
VALUE(SYM_HORIZ_TRANS_RES, double, 100, "How many resources required for symbiont non-lytic horizontal transmission"),
VALUE(SYM_VERT_TRANS_RES, double, 0, "How many resources required for symbiont vertical transmission"),
VALUE(GRID, bool, 0, "Do offspring get placed immediately next to parents on grid, same for symbiont spreading"),
VALUE(SYM_INFECTION_CHANCE, double, 1, "The chance (between 0 and 1) that a sym will infect a parallel host on process"),
VALUE(SYM_INFECTION_FAILURE_RATE, double, 0, "The chance (between 0 and 1) that a sym will be killed by the world while trying to infect a host"),
VALUE(HOST_AGE_MAX, int, -1, "The maximum number of updates hosts are allowed to live, -1 for infinite"),
Expand All @@ -40,18 +44,24 @@ EMP_BUILD_CONFIG(SymConfigBase,
VALUE(FILE_PATH, std::string, "Data", "Output file path"),
VALUE(FILE_NAME, std::string, "_data", "Root output file name"),
VALUE(CURE, bool, 0, "Should all symbionts die (0 for no, 1 for yes)"),
VALUE(CURE_UPDATES, int, 0, "How many updates should run before all symbionts die, will take the next update for effect"),

VALUE(CURE_UPDATES, size_t, 0, "How many updates should run before all symbionts die, will take the next update for effect"),

GROUP(SPATIAL_STRUCTURE, "Spatial structure settings"),
VALUE(SPATIAL_STRUCT_MODE, std::string, "well-mixed", "Options: well-mixed, grid, load (requires filepath in LoadFile param)"),
VALUE(SPATIAL_STRUCT_CFG_PATH, std::string, "spatial-struct.mat", "Path to the file containing the spatial structure"),
VALUE(SPATIAL_STRUCT_LOAD_MODE, std::string, "matrix", "Expected file format for loaded spatial structure. Options: matrix, edges"),
VALUE(WORLD_WIDTH, size_t, 100, "Used for grid and well-mixed modes. Width of the world, just multiplied by the height to get total size"),
VALUE(WORLD_HEIGHT, size_t, 100, "Used for grid and well-mixed modes. Height of world, just multiplied by width to get total size"),

GROUP(PHYLOGENY, "PHYLOGENY"),
VALUE(PHYLOGENY, bool, 0, "Should the world keep track of host and symbiont phylogenies? (0 for no, 1 for yes)"),
VALUE(TRACK_PHYLOGENY_INTERACTIONS, bool, 0, "Should the world keep track of interactions between hosts and symbionts, then write the count of all (including historical) interactions committed by tracked taxa? (0 for no, 1 for yes)?"),
VALUE(WRITE_CURRENT_INTERACTION_COUNTS, bool, 0, "Should the world write the count of only-currently-present interactions? (0 for no, 1 for yes)"),
VALUE(PHYLOGENY_SNAPSHOT_INTERVAL, int, 10001, "How often to output phylogeny snapshots"),
VALUE(NUM_PHYLO_BINS, size_t, 5, "How many bins should organisms be separated into if phylogeny is on?"),
VALUE(PHYLOGENY_TAXON_TYPE, size_t, 0, "What are phylogeny taxa based on? 0 = binned genotypes values, 1 = exact phenotype values, 2 = bitset tag (for tag matching condition), 3 = individual-level"),
VALUE(PHYLOGENY_TAXON_TYPE, std::string, "interaction-value-binned", "What are phylogeny taxa based on? Options: interaction-value-binned, interaction-value-exact, tag, individual"),
VALUE(STORE_EXTINCT, bool, 0, "Should extinct taxa be stored? (0 for no, 1 for yes)"),


GROUP(MUTATION, "Mutation"),
VALUE(MUTATION_SIZE, double, 0.002, "Standard deviation of the distribution to mutate by"),
VALUE(HOST_MUTATION_SIZE, double, -1, "Standard deviation of the distribution to mutate by for hosts, if -1 MUTATION_SIZE used"),
Expand All @@ -76,7 +86,7 @@ EMP_BUILD_CONFIG(SymConfigBase,

GROUP(TAG_MATCHING, "Settings for tag matching"),
VALUE(TAG_MATCHING, bool, 0, "Should organisms have tags that they use to decide whether symbionts can infect hosts?"),
VALUE(TAG_METRIC, int, 0, "Which tag matching metric should be used to compute distances between tags? (0 for hamming [proportion of bits mismatching], 1 for streak [ratio of continuously matching/mismatching bits], or 2 for hash [arbitrary but consistent difference])"),
VALUE(TAG_METRIC, std::string, "hamming", "Which tag matching metric should be used to compute distances between tags? hamming [proportion of bits mismatching], streak [ratio of continuously matching/mismatching bits], or hash [arbitrary but consistent difference]"),
VALUE(NORMALIZE_TAG_DISTANCES, bool, 0, "Should distances between pairs of tags be uniformicated? (0 for no, 1 for yes)"),
VALUE(TAG_PERMISSIVENESS, double, 0.125, "What is the Poisson mean for divergence allowed between tags for a successful infection? (1 = perfect mismatch, 0 = perfect match)"),
VALUE(HOST_TAG_PERMISSIVENESS_EVOLVES, bool, 0, "Should each host have a tag permissiveness that evolves as hosts reproduce? If yes, starting tag permissiveness values will be set to the TAG_PERMISSIVENESS config option. (0 for no, 1 for yes)"),
Expand All @@ -85,6 +95,6 @@ EMP_BUILD_CONFIG(SymConfigBase,
VALUE(TAG_MUTATION_SIZE, double, 0.01, "What is the probability that any given position in the bitstring tag flips during mutation?"),
VALUE(WRITE_TAG_MATRIX, bool, 0, "At the end of the experiment, should a similarity matrix of all persisting tags be generated?"),
VALUE(TAG_MATRIX_SAMPLE_PROPORTION, double, 0.1, "What proportion of positions in the world should be sampled to produce the tag matrix from?"),
VALUE(STARTING_TAGS_ONE_PROB, double, 0, "What probability should initializing bits in tags have of being 1s? Hosted symbionts will be assigned their host's tag. (0 for basic, all-0 only tags)")
VALUE(HOST_STARTING_TAGS_ONE_PROB, double, 0, "What probability should initializing bits in tags have of being 1s? Hosted symbionts will be assigned their host's tag. (0 for basic, all-0 only tags)")
)
#endif
Loading
Loading