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

Make the reading of input in scenario file independent from the order? #75

Open
frabas opened this issue Mar 1, 2016 · 4 comments
Open

Comments

@frabas
Copy link
Owner

frabas commented Mar 1, 2016

change read_scenario_config_file() so that
For example, currently we have:

dyn_alloc_sce

baseline TACs LTMP

dyn_pop_sce

baseline

biolsce

1
etc.

The idea would be to replace by

dyn_alloc_sce

dyn_alloc_sce baseline TACs LTMP

dyn_pop_sce

dyn_pop_sce baseline

biolsce

biolsce 1
with a keyword in first position

then read_scenario_config_file() could detect the keywords line by line and redirected the reading in the right variable. While the comments are just ignored...

then make possible different orders to limit mistakes in input e.g.

biolsce

biolsce 1

dyn_pop_sce

dyn_pop_sce baseline

dyn_alloc_sce

dyn_alloc_sce baseline TACs LTMP

@studiofuga
Copy link
Collaborator

I suggest to include some more information on the config files, including the Configuration file version and compatibility string.
The general structure may be something like:

# Compatibility xxxx
# File Version yyyy
key = value
key2 = value, value, value etc...
key3 values...

So each line must be in the form KEY [=] VALUES
Key is an alfanumeric string, key sensitive (or non key sensitive?), followed by an optional separator "=". Value is a string starting with a nonspace and ending at the end of the line, spaces are stripped at the end of the string, can include spaces and any other character.
The main code interface will not perform any type checking, so internally the file will be a dictionary std::map<std::string,std::string> . We'll provide conversion functions to transform Values to numerical types (int, double or float), and list(comma separated).
Comment will start with "#" and will be ignored, except for the first few lines that will include the file version (to track changes) and the compatibilty integer or string value, to track the compatibility with the simulator/gui.

What do you think?

@frabas
Copy link
Owner Author

frabas commented Mar 1, 2016

This fits exactly what I had in mind, thanks!

@studiofuga
Copy link
Collaborator

What is the priority, and on which version should we implement this task?

@frabas
Copy link
Owner Author

frabas commented Mar 1, 2016

This is low priority but could be fixed as soon as input files related code is touched upon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants