diff --git a/.gitignore b/.gitignore index 9df0b0a4dd67f79820163b21d78bbb182ada440a..08b864ff2aee1974c9e26cc538148ea45f9ad5a9 100644 --- a/.gitignore +++ b/.gitignore @@ -100,29 +100,31 @@ target .classpath .project org.* + +/src/main/java/environment/*.ucls +/src/main/java/environment/TestShape.java +/src/main/java/species/testAlea.java +/src/main/java/species/Essai.java /src/main/java/miscellaneous/Essai.java ->>>>>>> master -/exploration/R/.Rhistory -/exploration/R/.RData + /outcmaesaxlen.dat /outcmaesdisp.dat /outcmaesfit.dat /outcmaesstddev.dat /outcmaesxmean.dat /outcmaesxrecentbest.dat -/exploration/scriptR/BruchPrg.R.orig -.Rproj.user -/exploration/scriptR/.RData -/exploration/scriptR/*.Rproj -/exploration/scriptR/.Rhistory -/exploration/scriptR/scriptR.Rproj -/exploration/scriptR/.Rproj.user/ -/exploration/scriptR/.RData -/src/main/java/environment/*.ucls -/src/main/java/environment/TestShape.java -/src/main/java/species/testAlea.java -/data/input/northeastamerica/shape/*.qix -/src/main/java/species/Essai.java -/exploration/GR3D_Rdescription/.RData -/exploration/GR3D_Rdescription/.Rhistory -/exploration/GR3D_Rdescription/.~lock.* + +# R: files +*.Rproj +*.Rhistory +*.RData +*.Rproj.user +*.~lock.* + +# qgis file +*.qix + + + + + diff --git a/data/input/northeastamerica/RIO_obs_empty.xml b/data/input/northeastamerica/RIO_obs_empty.xml index 8f9e49df048a13acbfb5b651087d5e828b063d6b..3ee9b0dd6e3b5b6acc79d254dceb396d9fc16db3 100644 --- a/data/input/northeastamerica/RIO_obs_empty.xml +++ b/data/input/northeastamerica/RIO_obs_empty.xml @@ -1,150 +1,3 @@ <hashtable> - <entry> - <!-- - - <java-class>fr.cemagref.simaqualife.kernel.AquaticWorld</java-class>--> - <java-class>environment.RIOBasinNetworkWithContinent</java-class> - <fr.cemagref.observation.kernel.ObservablesHandler> - <observers> - <environment.RIOBasinNetworkObserverWithContinent> - <title>North East America</title> - <threshold>1000000</threshold> - <colorScaleEnum>RedsScale</colorScaleEnum> - </environment.RIOBasinNetworkObserverWithContinent> - - <environment.RIOBasinNetworkObserverPresence> - <title>Shad presence in North East America</title> - <presenceFileName>data/input/northeastamerica/nea_presence.csv</presenceFileName> - <period>obs_1900_1950</period> - </environment.RIOBasinNetworkObserverPresence> - </observers> - </fr.cemagref.observation.kernel.ObservablesHandler> - </entry> - <entry> - <java-class>species.DiadromousFishGroup</java-class> - <fr.cemagref.observation.kernel.ObservablesHandler> - <observers> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Number of colonized - basins - </title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>number of basins</yAxisLabel> - <variableName>getNbColonizedBasins</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Total Abundance</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>number of fishes</yAxisLabel> - <variableName>getFishEffective</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Abundance of spawners</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>number - of fishes - </yAxisLabel> - <variableName>getSpawnerEffective</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Abundance of male spawners</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>number of fishes</yAxisLabel> - <variableName>getMaleSpawnerEffective</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Abundance of female spawners</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>number - of fishes - </yAxisLabel> - <variableName>getFemaleSpawnerEffective</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <observer.TemporalRangeSerieChart> - <title>Range distribution</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>latitude</yAxisLabel> - <variableName>getRangeDistributionWithLat</variableName> - </observer.TemporalRangeSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Mean age at first reproduction for female</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>age (year)</yAxisLabel> - <variableName>getMeanAgeOfFirstReprodutionForFemale</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Mean age at first reproduction - for male - </title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>age (year)</yAxisLabel> - <variableName>getMeanAgeOfFirstReprodutionForMale</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Statistic for male spawners age</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel></yAxisLabel> - <variableName>computeMaleSpawnerForFirstTimeSummaryStatistic</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Statistic for female - spawners age - </title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel></yAxisLabel> - <variableName>computeFemaleSpawnerForFirstTimeSummaryStatistic</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Mean length at first reproduction for female</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>length (cm)</yAxisLabel> - <variableName>getMeanLengthOfFirstReprodutionForFemale</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - <graphType>LINE</graphType> - <title>Mean length at first - reproduction for male - </title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>length (cm)</yAxisLabel> - <variableName>getMeanLengthOfFirstReprodutionForMale</variableName> - </fr.cemagref.observation.observers.jfreechart.TemporalSerieChart> - </observers> - </fr.cemagref.observation.kernel.ObservablesHandler> - </entry> - <entry> - <java-class>environment.RiverBasin</java-class> - <fr.cemagref.observation.kernel.ObservablesHandler> - <observers> - <observer.TemporalSerieChartForBasin> - <graphType>LINE</graphType> - <title>Number of juveniles</title> - <xAxisLabel>Time - (season) - </xAxisLabel> - <yAxisLabel>number of juveniles</yAxisLabel> - <variableName>getJuvenileNumber</variableName> - </observer.TemporalSerieChartForBasin> - <observer.TemporalSerieChartForBasin> - <graphType>LINE</graphType> - <title>% Autochtone</title> - <xAxisLabel>Time (season)</xAxisLabel> - <yAxisLabel>% Autochtone</yAxisLabel> - <variableName>getLastPercentageOfAutochtone</variableName> - </observer.TemporalSerieChartForBasin> - </observers> - </fr.cemagref.observation.kernel.ObservablesHandler> - </entry> - </hashtable> \ No newline at end of file diff --git a/exploration/R_AS_GR3D/tryFromRougier.R b/exploration/R_AS_GR3D/tryFromRougier.R index 349ad0160b637ab181a427a07e0fa5187b65ade6..e793ccb627bd3f231484e73bd449734e3a37c152 100644 --- a/exploration/R_AS_GR3D/tryFromRougier.R +++ b/exploration/R_AS_GR3D/tryFromRougier.R @@ -6,22 +6,25 @@ rm(list=ls()) set.seed(1) -# parameters and prios=rs of parameters to be fitted -inputData = yaml.load_file("ABC_seq_2param_3stats_NewAfterSA.yaml") -# load prior -prior = list() -for (i in 1:length(inputData$parameters)) { - p = inputData$parameters[[i]] - prior[[i]] = unlist(p$prior) -} - -parametersNames = list() -for (i in 1:length(inputData$parameters)) { - parametersNames = c(parametersNames, inputData$parameters[[i]]$javapath) -} - - -thetas = c(0.45, 10.5) +# # parameters and prios=rs of parameters to be fitted +# inputData = yaml.load_file("ABC_seq_2param_3stats_NewAfterSA.yaml") +# # load prior +# prior = list() +# for (i in 1:length(inputData$parameters)) { +# p = inputData$parameters[[i]] +# prior[[i]] = unlist(p$prior) +# } +# +# parametersNames = list() +# for (i in 1:length(inputData$parameters)) { +# parametersNames = c(parametersNames, inputData$parameters[[i]]$javapath) +# } +# parametersNames = unlist(parametersNames) + +parametersNames = c("processes.processesEachStep.8.tempMinRep", + "processes.processesEachStep.8.ratioS95_S50", + "processes.processesEachStep.6.pHomingAfterEquil") +thetas = c(10, 2, 0.7) # path to outputs outputDir = "simus/" @@ -33,19 +36,26 @@ timeStepDuration =1 seed = 1 +## to have the same working diretory as GR3D +setwd("../..") - -arguments = c('-d','-simDuration',simDuration, '-simBegin',simBegin, +arguments = c('','-simDuration',simDuration, '-simBegin',simBegin, '-timeStepDuration',timeStepDuration, '-RNGStatusIndex', format(seed,scientific = FALSE), - '-groups',"../../data/input/northeastamerica/fishRIOBasin_Sapidissima_PL.xml", - '-env',"../../data/input/northeastamerica/RIOBNneaBasins.xml", - '-observers',"../../data/input/northeastamerica/RIO_obs_empty.xml") + '-groups',"data/input/northeastamerica/fishRIOBasin_Sapidissima_Rjava.xml", + '-env',"data/input/northeastamerica/RIOBNneaBasins_Rjava.xml", + '-observers',"data/input/northeastamerica/RIO_obs_empty.xml") outputFile = paste0(outputDir,"output",seed) .jinit(classpath = jarfile, force.init = TRUE) -.jcall("miscellaneous.EasyRun","V","runSimulation",arguments, outputFile,.jarray(unlist(parametersNames)),.jarray(thetas)) +.jcall("miscellaneous.EasyRun","V","runSimulation",arguments, outputFile,.jarray(parametersNames),.jarray(thetas)) + + + + + + # return a function to run the model with parameters as arguments salrun <- function(jarfile, simDuration, simBegin, timeStepDuration = 1) {