Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
489 commits
Select commit Hold shift + click to select a range
8e4da51
fix variable name mismatch
TheoPannetier Aug 16, 2024
f26e0ec
Merge pull request #67 from RangeShifter/unit_test
TheoPannetier Aug 16, 2024
1a740e2
fix merge conflict with rscore
TheoPannetier Aug 16, 2024
4ba52c5
fix iteration bug
TheoPannetier Aug 16, 2024
3cc291e
readGenetics, readTraitsFile now reads the correct nb of lines for ea…
TheoPannetier Aug 17, 2024
23cda73
output dominance coefficients, solve #60
TheoPannetier Aug 20, 2024
da35269
enable selecting which traits are output, solve #53
TheoPannetier Aug 20, 2024
2c20025
better placement for closing macro
TheoPannetier Aug 26, 2024
3c4fa34
default switch case to avoid gcc warning
TheoPannetier Aug 26, 2024
13f1878
fix bug with reading carriage returns as part of TraitsFIle
TheoPannetier Aug 26, 2024
e9a4327
progress on #44
TheoPannetier Aug 26, 2024
5d5da87
fix incorrect initiation of rows and columns in PatchMatrix
TheoPannetier Aug 27, 2024
ae5ae91
Fst for monomorphic pops is correct, fix #44
TheoPannetier Aug 27, 2024
1490006
fst is zero when it cannot be computed, fix #46
TheoPannetier Aug 27, 2024
c98221b
fix incorrect sample size
TheoPannetier Aug 27, 2024
2b6263a
calculation fits weir and cockerham expectation, fix #41
TheoPannetier Aug 27, 2024
0d6a0dc
solution for test var within vs between, fix #68 #69
TheoPannetier Aug 27, 2024
54c2330
test all heterozygotes case, fix #71 #68
TheoPannetier Aug 27, 2024
e9dbab2
assert correct nb of individuals is sampled, fix #53
TheoPannetier Aug 27, 2024
7ee8cfa
unlucky draw
TheoPannetier Aug 28, 2024
b147de3
fix bugged haploid GeneticFitness trait
TheoPannetier Aug 28, 2024
cc68505
Offspring survival scales with mutation rate, fix #54
TheoPannetier Aug 28, 2024
95d4763
number of emigrants scale with emig_0 mutation rate, fix #55
TheoPannetier Aug 28, 2024
edc34af
move testPopulation to its own file
TheoPannetier Aug 28, 2024
c497680
traitsFile is indicated in ControlFile instead of GeneticsFile
TheoPannetier Aug 29, 2024
b394cd1
a large populations confroms to hardy-weinberg expectations, fix #57
TheoPannetier Aug 30, 2024
3409068
haploid fst matches equivalent diploid fst, fix #75
TheoPannetier Sep 2, 2024
43da58f
weir and cockerham, weir & hill converge, fix #73
TheoPannetier Sep 2, 2024
6eb36c0
Weir & Cockerham > Weir&Hill if heterozygotes present
TheoPannetier Sep 2, 2024
739beeb
population-specific estimates average to weri & hill, fix #76
TheoPannetier Sep 2, 2024
f76c10e
nb of offspring dying matches HW expectations, fix #56
TheoPannetier Sep 2, 2024
b306fb1
higher tolerance
TheoPannetier Sep 2, 2024
04484af
merge rscore tests
TheoPannetier Sep 2, 2024
1cfb768
reorganise neutral genetics output
TheoPannetier Sep 2, 2024
62a7d5c
rm unused function
TheoPannetier Sep 2, 2024
e6c977f
doc update
TheoPannetier Sep 3, 2024
9fabc91
per locus fst are computed separately, fix #72
TheoPannetier Sep 3, 2024
b29bee6
Merge remote-tracking branch 'origin/new_genetics' into transloc_new_…
JetteReeg Sep 4, 2024
1317d2f
bugfix for github check renamed trfrRules to transferRules
JetteReeg Sep 4, 2024
4ec1690
added unit_tests in CMakeLists.txt
JetteReeg Sep 4, 2024
52cf90b
bring last changes from RScore to batch
TheoPannetier Sep 4, 2024
3dcd269
fix list reading
TheoPannetier Sep 4, 2024
1710790
fix patch headers for perLocusNeutralGenetics
TheoPannetier Sep 4, 2024
f431f71
fix output for only weir&hill case
TheoPannetier Sep 5, 2024
505a3ad
scrap empty initialise
TheoPannetier Sep 5, 2024
5627cd3
fix issue if init max is larger than mutation max
TheoPannetier Sep 5, 2024
3e9ee12
dodge infinite loop is mutation max is zero
TheoPannetier Sep 5, 2024
adf77af
add a bit more info if total extinction happens
TheoPannetier Sep 5, 2024
bdab3ff
why force setting move process to true??
TheoPannetier Sep 6, 2024
9035771
only set goal bias if enabled
TheoPannetier Sep 6, 2024
6312d4a
unnecessary arrays
TheoPannetier Sep 10, 2024
fe428f1
trying out smart pointers
TheoPannetier Sep 10, 2024
807eff0
replace RSDEBUG with standard NDEBUG
TheoPannetier Sep 10, 2024
05e8a42
fix missed renaming in release mode
TheoPannetier Sep 10, 2024
390765d
rm last mentions of RSDEBUG
TheoPannetier Sep 10, 2024
d7306c0
don't output gene values if genetics disabled
TheoPannetier Sep 11, 2024
5b60607
are these macro conditions necessary?
TheoPannetier Sep 11, 2024
6305931
drop RSWIN64, except inside RCPP
TheoPannetier Sep 11, 2024
209ad5e
wrong default value
TheoPannetier Sep 12, 2024
3e2e6e2
Merge pull request #72 from RangeShifter/release
TheoPannetier Sep 18, 2024
84fa7c6
fix possible division by zero
TheoPannetier Sep 19, 2024
64177e2
fix misleading variable names
TheoPannetier Sep 23, 2024
e50907c
output the right number of sexes for genetic load
TheoPannetier Sep 23, 2024
0742a3b
why
TheoPannetier Sep 25, 2024
f72765a
if default repro is asexual then propmales should be zero
TheoPannetier Sep 25, 2024
affc4da
merge batch and R versions of RSrandom
TheoPannetier Sep 26, 2024
849c78f
seed goes in parameter output
TheoPannetier Sep 26, 2024
71ca3a6
cleaning up
TheoPannetier Sep 26, 2024
f41a521
Merge branch 'new_genetics' into multispecies
TheoPannetier Sep 26, 2024
17f9281
by DEBUGLOG
TheoPannetier Sep 26, 2024
bc7ab3b
pass some params as species args (w defaults) to de-clutter main
TheoPannetier Sep 26, 2024
cd4d91f
rm empty filestreams
TheoPannetier Sep 27, 2024
bd59315
more concise main
TheoPannetier Sep 27, 2024
dce4836
check dir hidden from main
TheoPannetier Sep 27, 2024
f1f6d98
set batchnum out of main
TheoPannetier Sep 27, 2024
97f09b2
clean readParameters
TheoPannetier Sep 27, 2024
df1233e
default arg to let rscore run
TheoPannetier Sep 29, 2024
5da938b
only clear if closing file
TheoPannetier Oct 3, 2024
43727fb
resolve merge conflict
TheoPannetier Oct 3, 2024
cfd8f86
Updated variable names, which changed in new_genetics but haven't bee…
JetteReeg Oct 8, 2024
902f089
drop useless allele ID to save memory
TheoPannetier Oct 8, 2024
73a674b
allow negative values for settlement and emigration alphas
TheoPannetier Oct 18, 2024
03681a8
small cleanup
TheoPannetier Oct 18, 2024
0c450bc
expression should be half both allele if all dom coeffs are 0
TheoPannetier Oct 23, 2024
3c63422
Merge remote-tracking branch 'origin/new_genetics' into transloc_new_…
JetteReeg Oct 24, 2024
70ec1f6
fixed compiling bug in Management.h
JetteReeg Oct 24, 2024
7509111
fixed bug due to merging in Model.cpp
JetteReeg Oct 24, 2024
3b81ba1
fix scaled sd parameter not being passed from parent to offspring
TheoPannetier Oct 24, 2024
02adc82
bit of cleaning of survival
TheoPannetier Nov 4, 2024
e31c278
Merge remote-tracking branch 'origin/new_genetics' into transloc_new_…
JetteReeg Nov 14, 2024
e5a314b
For now only commented out code for file reads that are not necessary…
JetteReeg Nov 14, 2024
6d08f65
changed gNameCostfile to name_costfile
JetteReeg Nov 15, 2024
139387b
initialise genetic load with non-zero sel + dom coeffs #75
TheoPannetier Nov 19, 2024
edf9cf8
oops bugs in #75
TheoPannetier Nov 20, 2024
e2834e7
update tests to non-zero initial dominance coeffs
TheoPannetier Nov 20, 2024
52becba
improve readability of readDynLand
TheoPannetier Jan 30, 2025
187d9bd
drop unused map and views features
TheoPannetier Feb 4, 2025
3c94049
integrated spatial_demography branch
JetteReeg Feb 12, 2025
f93b1b2
Merge remote-tracking branch 'origin/new_genetics' into transloc_new_…
JetteReeg Mar 18, 2025
b62d941
"Error" should be printed only once
TheoPannetier Mar 18, 2025
cbda46d
Merge commit 'e2834e771621f6fc86b3c9ceb22f150ad40e01aa' into new_gene…
TheoPannetier Mar 18, 2025
b45c3c7
Merge branch 'new_genetics' of https://github.com/RangeShifter/RScore…
TheoPannetier Mar 18, 2025
7386236
fix incorrect dominance distribution value in genetic load tests
TheoPannetier Mar 18, 2025
a83a011
merge with SMS_bugfix
TheoPannetier Mar 18, 2025
cc90e82
resolved conflicts after merging
JetteReeg Mar 19, 2025
4f8dc87
Merge branch 'new_genetics' into transloc_new_genetics_spatial_demog_…
JetteReeg Mar 19, 2025
ff399f6
Rewrite the Population::clean() method to avoid unnecessary memory co…
nboullis Jan 30, 2025
c41a13e
Modify the Population::fledge() method to avoid unnecessary memory co…
nboullis Mar 10, 2025
dcd4615
Merge branch 'develop' into avoid_memory_copies
nboullis Mar 19, 2025
2d85f0b
Replace the std:queue memory used for SMS with an ad hoc implementati…
nboullis Mar 4, 2025
08299da
Prepare CMakeLists for (optional) compilation with OpenMP.
nboullis Mar 19, 2025
bf9d7e2
Set up per-thread pseudo-random number generators to improve efficien…
nboullis Jan 10, 2025
0da6eea
Run the first stage of Population::transfer in an OpenMP parallel loop.
nboullis Mar 19, 2025
5409239
Run in parallel the loop that resets the possible settlers.
nboullis Jan 22, 2025
2a017f5
Run the reproduction stage in an OpenMP parallel loop while preventin…
nboullis Jan 29, 2025
846ee8b
Run the “complete dispersal” stage in an OpenMP parallel loop.
nboullis Jan 30, 2025
be1720a
Run the second stage of the Population::transfer method in an OpenMP …
nboullis Jan 30, 2025
794172f
Run the “emigration” stage in an OpenMP parallel loop.
nboullis Feb 4, 2025
d8b93d7
Run the “survival” stages in an OpenMP parallel loop.
nboullis Mar 4, 2025
cba60ae
Run the “initiateDispersal” stage in an OpenMP parallel loop while ba…
nboullis Mar 4, 2025
a81e67c
Run the populations reset in an OpenMP parallel loop.
nboullis Mar 7, 2025
ef5cd1f
Fixing compilation errors for R package
JetteReeg Mar 20, 2025
baefdac
Merge pull request #82 from RangeShifter/avoid_memory_copies
TheoPannetier Mar 24, 2025
8218cf3
Merge branch 'develop' into memory_usage
nboullis Mar 24, 2025
6e2aefe
Add a full() method to the new MemoryQueue class for a cleaner design.
nboullis Mar 27, 2025
870ad76
Merge pull request #83 from RangeShifter/memory_usage
TheoPannetier Mar 28, 2025
835e9ff
Merge branch 'develop' into openmp_parallelization
nboullis Mar 31, 2025
64db26a
Forward-declare the Patch class and replace the corresponding intptr …
nboullis Mar 27, 2025
fc38888
Forward-declare the Population class and replace the corresponding in…
nboullis Mar 27, 2025
ef287d5
Forward-declare the SubCommunity class and replace the corresponding …
nboullis Mar 27, 2025
4e337ae
Make the subcommunity number a standard int rather than an intptr as …
nboullis Mar 27, 2025
47e06af
added RS_RCPP macro for R specific landscape inputs
JetteReeg Apr 8, 2025
ced9044
compared to RangeShifter_batch/new_genetics; now in line
JetteReeg Apr 8, 2025
365d736
rm duplicated batch name
TheoPannetier Apr 22, 2025
b0df20d
refactor trait summaries
TheoPannetier Apr 25, 2025
3b010f7
settlement and genetic load per cell trait refactor
TheoPannetier Apr 25, 2025
ea64bb5
refactor transfer
TheoPannetier Apr 25, 2025
5f014ac
initial individuals suffer genetic load
TheoPannetier Apr 28, 2025
96a47b2
Merge commit '7386236efd7e2ac31ef0da1f5b1ecda7274347ff' into new_gene…
TheoPannetier Apr 28, 2025
d6af7fa
Merge branch 'new_genetics' of https://github.com/RangeShifter/RScore…
TheoPannetier Apr 28, 2025
d5cf8c0
restore accidentally removed genetic load ofr asexual species. thanks…
TheoPannetier Apr 28, 2025
0544fc1
individuals initialised from files also suffer genetic load
TheoPannetier Apr 28, 2025
34b3414
can initialise only a subset of positions
TheoPannetier Apr 29, 2025
e816843
initial individuals do not suffer genetic load
TheoPannetier Apr 29, 2025
a1a4d7c
Merge pull request #85 from RangeShifter/no_intptr
TheoPannetier Apr 29, 2025
6673cda
Merge branch 'develop' into openmp_parallelization
nboullis Apr 30, 2025
2d000dd
typos
TheoPannetier Apr 30, 2025
dc8df2f
indentation and style
TheoPannetier Apr 30, 2025
06175a9
Merge branch 'openmp_parallelization' of https://github.com/RangeShif…
TheoPannetier Apr 30, 2025
77d744b
fetch eps only once per year
TheoPannetier Apr 30, 2025
195d038
turn openmp parallelisation on/off via config
TheoPannetier May 1, 2025
a02fcbd
Merge pull request #84 from RangeShifter/openmp_parallelization
TheoPannetier May 1, 2025
9c81dac
Split the Individual::getLocn() function in 2 distinct functions Indi…
nboullis May 5, 2025
5854c4e
Split functions to open/write to/close the individuals and population…
nboullis May 5, 2025
e0cd7dd
Split the survival functions.
nboullis May 6, 2025
b7f2d60
added debug output for translocations
JetteReeg May 7, 2025
092e852
Split the functions to open/close the range files.
nboullis May 9, 2025
f402c98
Split the functions to open/close the traits and traits rows files.
nboullis May 9, 2025
7c72197
Split the functions to open/close the genetics files.
nboullis May 12, 2025
f3b71b7
Split the functions to open/close the occupancy files.
nboullis May 12, 2025
0dac7fb
Split the functions to open/close the connect and paths files.
nboullis May 12, 2025
6b7f4d3
Split the Population::transfer method.
nboullis May 13, 2025
0d2460f
Cleanup unused parameters and variables in the new Population::transf…
nboullis May 13, 2025
a8a0ed2
Remove the compatibility Population::transfer function.
nboullis May 13, 2025
0620837
Split the SubCommunity::transfer method.
nboullis May 13, 2025
0c02670
Remove the compatibility SubCommunity::transfer function.
nboullis May 13, 2025
e65d989
Add new static methods Population::transfer_move, Population::transfe…
nboullis May 14, 2025
4037ecb
Add new static methods SubCommunity::transfer_move, SubCommunity::tra…
nboullis May 14, 2025
713fc05
Add a new SubCommunity::initiateMatrixDispersal method to move all in…
nboullis May 14, 2025
b92b543
Refactor the parallelization of the Community::dispersal method to en…
nboullis May 14, 2025
5936f4c
Remove old (now unused) methods.
nboullis May 14, 2025
6655955
Relax the thread synchronization in the Community::transfer method.
nboullis May 15, 2025
2275c4a
Replace the custom split_barrier class by standard std::barrier (and …
nboullis May 26, 2025
fa61fa6
Merge branch 'new_genetics' into transloc_new_genetics_spatial_demog_…
JetteReeg May 28, 2025
2dfe022
Merge pull request #86 from RangeShifter/split_functions
TheoPannetier Jun 1, 2025
a4b3e85
Merge branch 'develop' into refactor_transfer_parallelization
nboullis Jun 2, 2025
d8e5256
patchnums not used anywhere so dropped them
TheoPannetier Jun 12, 2025
e0e40bc
ensure patch heterogeneity is written in the correct order
TheoPannetier Jun 12, 2025
dc2d350
cleanup readLandscape
TheoPannetier Jun 19, 2025
114c909
bug in calculation of Ho: heterogeneity shouldn't be an integer
TheoPannetier Jul 17, 2025
c142585
merge conflict develop - new_genetics first attempt
TheoPannetier Jul 21, 2025
f350ce7
fixing git merge mistakes
TheoPannetier Jul 22, 2025
091ebe4
resolving more merge mistakes
TheoPannetier Jul 22, 2025
5f25433
solved linker issues raised by develop merge
TheoPannetier Jul 22, 2025
68c87ef
bring omp generalisation of the RNG to the RCPP version
TheoPannetier Jul 23, 2025
57c20b8
merge conflict
TheoPannetier Jul 23, 2025
5aea418
Integrated option for file inputs for spatial demographic scaling
JetteReeg Jul 25, 2025
39e5402
Apply suggestions from code review
TheoPannetier Sep 8, 2025
24b6708
light refactor to increase readability
TheoPannetier Sep 8, 2025
f9c7197
incorporate edits from pr review
TheoPannetier Sep 8, 2025
e59a31c
transfer and settlement moved outside of population class
TheoPannetier Sep 8, 2025
48b74aa
make conditional barrier calls a wee bit more succinct
TheoPannetier Sep 8, 2025
b241646
fix mismatched definition
TheoPannetier Sep 9, 2025
3b0d19a
move matePresent out of population + better pop size getter
TheoPannetier Sep 9, 2025
6559fc3
Merge branch 'develop' into refactor_transfer_parallelization
TheoPannetier Sep 9, 2025
9b3f02c
Merge pull request #88 from RangeShifter/refactor_transfer_paralleliz…
TheoPannetier Sep 9, 2025
310d2c6
Merge remote-tracking branch 'origin/new_genetics' into transloc_new_…
JetteReeg Sep 12, 2025
8f40ab4
BUGFIX in moveStep:
JetteReeg Sep 12, 2025
4c70c77
Unit_test:
JetteReeg Sep 15, 2025
a7cf75e
updated Individual() constructor in unit_tests/testIndividual.cpp
JetteReeg Sep 15, 2025
fc73cc5
fix argument errors in unit tests
TheoPannetier Sep 17, 2025
0b9b20e
bugfix missing increment of total steps
TheoPannetier Sep 18, 2025
f01ac87
updated unit tests according to RScore/new_genetics
JetteReeg Sep 23, 2025
f19dbdd
adapted unit tests
JetteReeg Sep 23, 2025
371e891
fix test by shuffling individuals
TheoPannetier Sep 26, 2025
e120416
shuffle individuals before reproduction
TheoPannetier Sep 26, 2025
39d5a68
fix unreliable kernel tests
TheoPannetier Sep 29, 2025
d996e37
separate unit tests from NDEBUG macro
TheoPannetier Sep 29, 2025
f393706
higher tolerance
TheoPannetier Sep 30, 2025
6d2b2da
small merge conflict
TheoPannetier Sep 30, 2025
24626b2
resolve merge conflict develop into new_genetics
TheoPannetier Sep 30, 2025
7a35d62
boundary test less likely to fail with higher dispersal distance
TheoPannetier Oct 1, 2025
a77d33f
Merge branch 'new_genetics' of https://github.com/RangeShifter/RScore…
TheoPannetier Oct 1, 2025
a8467b2
inconsistent names after merge conflict
TheoPannetier Oct 1, 2025
86bd62f
fix missing decrement of population size
TheoPannetier Oct 1, 2025
4584169
bug fix on single-locus genes?
TheoPannetier Oct 2, 2025
de3ed49
doc bottom left corner
TheoPannetier Oct 20, 2025
a63e779
fix tests - hardy weinberg expectation is not met because finite size…
TheoPannetier Oct 20, 2025
bbceed4
Merge commit 'a63e779df7fc0a27d80b413db2b419ff8cfb0f4d' into new_gene…
TheoPannetier Oct 20, 2025
cd4b984
Merge branch 'new_genetics' into transloc_new_genetics_spatial_demog_…
JetteReeg Nov 13, 2025
d256e68
reverted one change to see if unit tests are now successful
JetteReeg Nov 13, 2025
81212f0
Manually merged changes from new_genetics
JetteReeg Nov 14, 2025
9516aa1
fixing minor bugs for RCPP flag
JetteReeg Nov 17, 2025
8c990d2
bugfix for dynamic landscapes:
JetteReeg Nov 21, 2025
c142584
Minor Updates:
JetteReeg Nov 27, 2025
0904483
Merge branch 'transloc_new_genetics_spatial_demog_merge' of https://g…
JetteReeg Nov 27, 2025
f751f01
Potential fix for pairwise fst calculation. Charlotte to test.
RoslynHenry Dec 3, 2025
c52063c
Corrected pairwise fst calculation using weir and cockerham
RoslynHenry Dec 11, 2025
dbc2a1a
Merge remote-tracking branch 'origin/transloc_new_genetics_spatial_de…
JetteReeg Dec 16, 2025
e2a2a46
Changes to outputPairwiseFst rather than outputWeirHill
RoslynHenry Jan 12, 2026
a441d33
Updating based on changes done in RangeShifter_batch/new_genetics/src…
JetteReeg Jan 13, 2026
cb435ea
adapted unit_test for NeutralStats so it will compile
JetteReeg Jan 13, 2026
28b067a
Merge commit 'cb435ea8b8be33aefef2c787fa91c9f5618dd887' into new_gene…
JetteReeg Jan 13, 2026
9e41f78
Bring RScore/new_genetics up-to-date with src/RScore RangeShifter_ba…
JetteReeg Jan 13, 2026
f889a56
Merge commit '9e41f786f701b5dd9a03d167becb8e19c10f85c7' into new_gene…
JetteReeg Jan 13, 2026
8d3d7fd
Updating based on changes done in RangeShifter_batch/new_genetics/src…
JetteReeg Jan 13, 2026
ec37a62
adapted unit_test for NeutralStats so it will compile
JetteReeg Jan 13, 2026
e2014f6
Bring RScore/new_genetics up-to-date with src/RScore RangeShifter_ba…
JetteReeg Jan 13, 2026
3ac67a5
removed duplicated #include header
JetteReeg Jan 13, 2026
404b2b6
Replacement of outWeirHill with outPairwiseFst in writeNeutralOutputF…
JetteReeg Jan 13, 2026
a64666d
Changes to decouple genetic output
RoslynHenry Jan 22, 2026
097599d
bug fixes for outputting genetics interval
RoslynHenry Jan 26, 2026
1d82072
Bug fix for genetic output
RoslynHenry Feb 5, 2026
ce62662
Merge remote-tracking branch 'origin/new_genetics' into develop
JetteReeg Feb 19, 2026
cfceeb4
Changed output for R interface:
JetteReeg Feb 20, 2026
957e2ce
Minor changes for R output option of the R package interface
JetteReeg Mar 19, 2026
09e171e
Updated README.md
JetteReeg Mar 20, 2026
1d1532d
Updated Copyright section on each file
JetteReeg Mar 20, 2026
4c7364f
theo is no longer a maintainer 🥲
TheoPannetier Mar 22, 2026
072d3af
Clean-up
JetteReeg Mar 24, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ build-Release/
*.workspace
*.mk
*.tags
/build/

# Hidden source
/RangeShiftR/src/.*
Expand Down
44 changes: 20 additions & 24 deletions RandomCheck.h → Allele.h
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
#ifndef ALLELEH
#define ALLELEH

/*----------------------------------------------------------------------------
*
* Copyright (C) 2020 Greta Bocedi, Stephen C.F. Palmer, Justin M.J. Travis, Anne-Kathleen Malchow, Damaris Zurell
*
*
* Copyright (C) 2026 Greta Bocedi, Stephen C.F. Palmer, Justin M.J. Travis, Anne-Kathleen Malchow, Roslyn Henry, Théo Pannetier, Jette Wolff, Damaris Zurell
*
* This file is part of RangeShifter.
*
*
* RangeShifter is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* RangeShifter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with RangeShifter. If not, see <https://www.gnu.org/licenses/>.
*
*
* File Created by Roslyn Henry March 2023. Code adapted from NEMO (https://nemo2.sourceforge.io/)
--------------------------------------------------------------------------*/


//---------------------------------------------------------------------------

#ifndef RandomCheckH
#define RandomCheckH

#include <fstream>
using namespace std;

#include "Parameters.h"
#include "RSrandom.h"

void randomCheck(void);

extern paramSim *paramsSim;
extern RSrandom *pRandom;

//---------------------------------------------------------------------------
class Allele {
const float value;
const float dominance;
public:
Allele(float alleleValue, float alleleDominance) : value(alleleValue), dominance(alleleDominance) { }
~Allele() {}
float getAlleleValue() const { return value; };
float getDominanceCoef() const { return dominance; };
};
#endif
29 changes: 17 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
# Config file for compilation with CMake

if (NOT batchmode) # that is, RScore as a standalone
if(NOT batchmode) # that is, RScore as a standalone
cmake_minimum_required(VERSION 3.10)
# set the project name and version
project(RScore VERSION 2.1.0)
project(RScore VERSION 3.0.0)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_executable(RScore Main.cpp Species.cpp Cell.cpp Community.cpp FractalGenerator.cpp Genome.cpp Individual.cpp Landscape.cpp Model.cpp Parameters.cpp Patch.cpp Population.cpp RandomCheck.cpp RSrandom.cpp SubCommunity.cpp Utils.cpp)

add_executable(RScore Main.cpp Species.cpp Cell.cpp Community.cpp FractalGenerator.cpp GeneticFitnessTrait.cpp Individual.cpp Landscape.cpp Management.cpp Model.cpp NeutralStatsManager.cpp Parameters.cpp Patch.cpp Population.cpp DispersalTrait.cpp RSrandom.cpp NeutralTrait.cpp SpeciesTrait.cpp SubCommunity.cpp Utils.cpp "unit_tests/testIndividual.cpp" "unit_tests/testNeutralStats.cpp" "unit_tests/testPopulation.cpp")

# turn on unit tests
add_compile_definitions("UNIT_TESTS")
else() # that is, RScore compiled as library within RangeShifter_batch
add_library(RScore Species.cpp Cell.cpp Community.cpp FractalGenerator.cpp Genome.cpp Individual.cpp Landscape.cpp Model.cpp Parameters.cpp Patch.cpp Population.cpp RandomCheck.cpp RSrandom.cpp SubCommunity.cpp Utils.cpp)

add_library(RScore Species.cpp Cell.cpp Community.cpp FractalGenerator.cpp GeneticFitnessTrait.cpp Individual.cpp Landscape.cpp Management.cpp Model.cpp NeutralStatsManager.cpp Parameters.cpp Patch.cpp Population.cpp DispersalTrait.cpp RSrandom.cpp NeutralTrait.cpp SpeciesTrait.cpp SubCommunity.cpp Utils.cpp)
endif()

# pass config definitions to compiler
target_compile_definitions(RScore PRIVATE RSWIN64)
if(OMP)
find_package(OpenMP COMPONENTS CXX)
if(OpenMP_CXX_FOUND)
target_link_libraries(RScore PUBLIC OpenMP::OpenMP_CXX)
endif()
endif()

# enable LINUX_CLUSTER macro on Linux + macOS
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_compile_definitions("LINUX_CLUSTER")
endif()

# Debug Mode by default, unless "release" is passed
if(NOT DEFINED release)
add_compile_definitions(RSDEBUG)
endif()

if(NOT batchmode)
target_include_directories(RScore PUBLIC "${PROJECT_BINARY_DIR}")
endif()
endif()
13 changes: 9 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RangeShifter is distributed with three user interfaces, each living in their own

All three share the same source code for the core simulation (i.e., the actual model), which lives in this repo (RScore). Each of the interfaces keeps a copy of this core code in a subfolder called RScore, kept in sync with the RScore repo via a git subtree (see Git subtree usage section).

If you wish to propose a change to one of the interfaces, please do so in the corresponding repo: [RangeShifter batch mode](https://github.com/RangeShifter/RangeShifter_batch_dev), [RangeShiftR package](https://github.com/RangeShifter/RangeShiftR-package-dev).
⚠ If you wish to propose a change to one of the interfaces, please do so in the corresponding repo: [RangeShifter batch mode](https://github.com/RangeShifter/RangeShifter_batch_dev), [RangeShiftR package](https://github.com/RangeShifter/RangeShiftR-package-dev).

*The RangeShifter GUI is currently being rewritten, and is not open source yet.

Expand All @@ -26,7 +26,7 @@ All three share the same source code for the core simulation (i.e., the actual m
#### Maintainers

- [@JetteReeg](https://github.com/JetteReeg): RScore repo and lead in R package
- [@TheoPannetier](https://github.com/TheoPannetier): RScore repo and lead in batch mode


Maintainers are responsible for coordinating development efforts and ensuring that RangeShifter keeps building continuously.

Expand Down Expand Up @@ -61,12 +61,17 @@ In the meantime, we encourage contributors to work in small and frequent commits

Any changes regarding the RangeShifter core code should be done in this repository and can afterwards be synced with all interfaces using the git subtree feature (see [Git subtree](https://github.com/RangeShifter/RScore/tree/main?tab=readme-ov-file#usage-git-subtree) section in the README).


#### Bugs

To report a bug, please [open an issue](https://github.com/RangeShifter/RangeShiftR-package-dev/issues/new), using the Bug Report template.
Please do check if a related issue has already open on one of the other interfaces ([here](https://github.com/RangeShifter/RangeShifter_batch-dev/issues) for the batch interface or [here](https://github.com/RangeShifter/RangeShiftR-package-dev) for the R package interface).
To report a bug, please [open an issue](https://github.com/RangeShifter/RangeShiftR-package/issues/new), using the Bug Report template.
Please do check if a related issue has already open on one of the other interfaces ([here](https://github.com/RangeShifter/RangeShifter_batch/issues) for the batch interface or [here](https://github.com/RangeShifter/RangeShiftR-package) for the R package interface).

To propose a bug fix (thank you!!), please create and work on your own branch or fork, from either `main` or `develop` (preferred), and open a pull request when your fix is ready to be merged into the original branch.

As a prerequisite for merging, please ensure that your version passes status check (that is, RScore can still build, and all unit tests are still satisfied).
This can be seen in the Actions panel for every commit and at the bottom of the pull request.

Maintainers will review the pull request, possibly request changes, and eventually integrate the bug fix into RScore, and update the subtrees to bring the fix to all interfaces.

#### New features
Expand Down
Loading
Loading