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

Add some game initialisation parameters #37

Merged
merged 14 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ jobs:
path: playwright-report/
retention-days: 30


initialise_data_from_script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix develop -c -- nix run .\#initialise-data
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
shinydashboard
shinycssloaders
shinyjs
shinyvalidate
RSQLite
MASS
digest
Expand All @@ -29,6 +30,7 @@
vistime
scrm
GenomicRanges
bsicons

(pkgs.rPackages.buildRPackage {
name = "rutilstimflutre";
Expand Down
2 changes: 2 additions & 0 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ source("src/fun/func_id.R", local = TRUE, encoding = "UTF-8")
source("./src/fun/module_constants.R", local = TRUE, encoding = "UTF-8")
source("./src/fun/module_breederList.R", local = TRUE, encoding = "UTF-8")
source("./src/fun/func_dbRequests.R", local = TRUE, encoding = "UTF-8")
source("./src/fun/module_gameInit_params.R", local = TRUE, encoding = "UTF-8")
source("./src/fun/func_gameInit_validation.R", local = TRUE, encoding = "UTF-8")

## -------------------------------------------------------------------
## parameters
Expand Down
33 changes: 32 additions & 1 deletion initialise_data.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
#! /usr/bin/env Rscript

params = list(
rng_seed = 1993,

cost.pheno.field = 50,
cost.pheno.patho = 0.1,
cost.allof = 0.1,
cost.autof = 0.25,
cost.haplodiplo = 1,
cost.geno.hd = 1,
cost.geno.ld = 0.5,
cost.geno.single = 0.02,
cost.register = 4,
initialBudget = 3900,

t1_mu = 100,
t1_min = 20,
t1_cv_g = 0.1,
t1_h2 = 0.3,

t2_mu = 15,
t2_min = 5,
t2_cv_g = 0.06,
t2_h2 = 0.6,

prop_pleio = 0.4,
cor_pleio = -0.7
)


out_report <- rmarkdown::render("./src/plantbreedgame_setup.Rmd",
output_file = tempfile(),
encoding = "UTF-8"
encoding = "UTF-8",
params = params,
envir = new.env(parent = globalenv()),
)
file.copy(
from = out_report,
Expand Down
3 changes: 1 addition & 2 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ module.exports = defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
// command: "rm -r data; unzip data.zip -d .; nix run",
command: "nix run",
command: "rm -rf data/*; rm data.zip; nix run",
url: "http://127.0.0.1:3000",
reuseExistingServer: true,
},
Expand Down
2 changes: 2 additions & 0 deletions src/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ suppressPackageStartupMessages({
library(shinydashboard)
library(shinycssloaders)
library(shinyjs)
library(shinyvalidate)
library(RSQLite)
library(MASS)
library(digest)
Expand All @@ -36,6 +37,7 @@ suppressPackageStartupMessages({
library(lubridate)
library(vistime)
library(tidyr)
library(bsicons)

## required packages NOT available on the CRAN
## R> devtools::install_github("timflutre/rutilstimflutre")
Expand Down
Loading
Loading