Open bianrq opened 7 years ago
@bianrq @mckenziej : I have added more parameters to the file inputs/parameters.json
. The names should be self explanatory, if in doubt check the parameters.hpp
source file for documentation. I will add other parameters later today e.g. tag release schedule.
As mentioned previously it is in JSON which has a fairly obvious format. If you do get an error due to wrong syntax you might like to use an online tool like https://jsonlint.com/ to check where the problem is.
Also, I have now added more outputs e.g. tagging data, casal inout files etc. When you run the model i.e. make run
you will get these outputs in the output
folder (NB. these a separate to the outputs done specifically for unit tests which are output in various subdirectories in tests
).
Thanks Nokome.
Jeremy asked me to do a compile and I got an error, please check your email to see a screenshot of the error message. Jeremy wanted to know how to get variable year class strengths and I wanted to know if I choose "e" for fishes_growth_model, how do I specify g-alpha and g-beta for given alpha and beta (hardwired as 20 and 50?).
Hi Richard,
make test-slow
g++ -std=c++11 -Wall -Wno-unused-function -Wno-unused-local-typedefs -Wno-unused-variable -pthread -O3 -I. -Irequires/boost -Irequires/stencila -otests-slow.exe tests/tests-slow.cpp -Lrequires/boost/lib -lboost_system -lboost_filesystem -lboost_unit_test_framework
time ./tests-slow.exe
make run
g++ -std=c++11 -Wall -Wno-unused-function -Wno-unused-local-typedefs -Wno-unused-variable -pthread -O3 -I. -Irequires/boost -Irequires/stencila -osna1.exe sna1.cpp -Lrequires/boost/lib -lboost_system -lboost_filesystem
time ./sna1.exe run
re variable year class strengths: I have not got that in there yet, working on it now.
re choose 'e' for growth and setting the growth parameter models: change the following parameters in input/parameters.json
(linf and k are converted to corresponding alpha and beta):
"fishes_growth_model": "l",
"fishes_k_mean": 0.1,
"fishes_k_sd": 0.02,
"fishes_linf_mean": 60,
"fishes_linf_sd": 10
The commands are helpful, both working.
But when I ran the tests-slow.exe, I got an fatal error and no output files were generated. Please find the screenshot for the run in my email.
Great. Yes, the problem that you see with tests-slow.exe must have been introduced by the recent chages - it is happening on Travis too: https://travis-ci.org/trophia/sna1#L1691 . I will try to fix ASAP.
In any case use ./sna1.exe run
for now on for most of your work doing runs with alternative parameter vlues.
By the way, you can paste a screenshot in one of these comments and it will get display (see the Preview tab)
@mckenziej @bianrq : I've added rec strengths as parameters. Can you please:
make run
with alternative rec strengths set and then maybe plot up output/monitor/casal/biomass.tsv
to check it makes sense@mckenziej @bianrq : I've done a similar thing for catch history (the ability to set the catch history was always there but I've made the file structure more similar to other model inputs and added some instructions to the readme: https://github.com/trophia/sna1#inputharvest_catch_historytsv)
As with rec_strengths could you have a look to see if this makes sense.
Done same for movement: https://github.com/trophia/sna1#inputfishes_movementtsv
@nokome : Thanks for the update. Just did a run and got an error as below.
@bianrq : mmm, looks like it's an error when trying to write the output files at the end of the simulation. Can you confirm that you have write access by trying touch output/temp.txt
and checking that made a file in the output
folder
@mckenziej : I've setup the tagging config: can you have a look at https://github.com/trophia/sna1#tagging and see if that has what you need.
@nokome you are right. I have to add sudo to be able to do it.
@bianrq : if you fix that permissions issue it would be best (something to do with your VM setup?), alternatively you could try sudo make run
to do everything using sudo.
@nokome : it runs if I add sudo in front of the command for a run mode. I still have an error message from a test run.
@bianrq : yes, the test run is still broken - instead I'm focusing on implementing everything you need to do customised runs by changing input parameters. So don't worry about the make test
for now. Instead try setting parameters in the input files, make run
and then look at the output files.
In the latest commits I've implemented, and added parameters for, tagging mortality and tag shedding: see https://github.com/trophia/sna1/blob/master/input/parameters.json#L29
@nokome : am I right if I assume the .tsv files in sna1/output/monitor/casal/ generated from a run mode should be the same as those in sna1/tests/casal/ibm-outputs/ generated from a test run? The age.tsv files in the two folder look different from each other, so I was trying to get a new test run and see if they are the same or not.
They should be the same. I'll look into it
Hi @bianrq : the file in output/monitor/casal/
have the same structure as those in tests/casal/ibm-outputs
but they will have different values. That is because the during the test we set some parameters to ensure they match CASAL assumptions e.g.
// Ensure parameters are set to match the assumptions of CASAL
// Only temporal variation in growth
parameters.fishes_growth_variation = 't';
// No movement
parameters.fishes_movement_type = 'n';
// No MLS
parameters.harvest_mls = 0;
You could set those parameters to be the same in input/parameters.json
but even then the values in the output files would be different because of the stochastic nature of the model.
@nokome : attached is the age.tsv file I got from a 'run' mode run. there are many count are 0s for many years. I don't know why they are 0s and how to change them. I change tsv to txt to be able to attach. age.txt
Actually, I'm working on the specification and output of alternative monitoring now (so you don't gt all those zero). Should be one in the next half hour - I'll let you know when it is done.
@nokome : I've done a few runs and with the catch at age (age.tsv), casal doesn't fit well. It looks to me that the current code tends to catch younger fish than before. Attached please find three catch at age files, the two from normal runs are from the current code for mls = 0 and mls 25. the third one was created from test run of the early version code. age run mls 0.txt age run mls 25.txt age test-slow.txt