Quick start guide:

There are three main types on inputs: 
- Parameters files
- Data files
- Index files

Most of the loading & parsing process is done in lua.


I - Index files 
Index files are lists of other files.
They are located in the .struct/ subfolder.
They must contain the relative path of the indexed files, with one path/name per line.
Comment lines are allowed and start with a # sign.

There are 3 index files: 
 - One for Species
 - One for traits
 - One for data files



II - Parameters files
Parameters are used to describe the properties of the simulation.
They describe the simulation, the landscape, and the species.
Parameter files are lua scripts and accept most of lua syntax.
Each file is executed in a sandbox, and only variables in the global environement 
are used by the program.

As it is a sandbox there is no side effect on the rest of the program and most
functions are disabled.


There are 3 types of parameters files:

- A - simuConf.lua
It describes the size of the landscape, random seeds, simulation length and
other general parameters.
All fields are checked for type & conisistency in paramConfig.lua

- B - Species
Each species is described in separate files.
All files describing a species must be indexed in .struct/ species_index.txt.
All fields are checked for type & consistency in speciesConfig.lua

- C - Traits
Each trait belongs to a species, but has its own file.
This prevent bloating the configuration files with too many things.
Trait files must be indexed in .struct/trait_index.lua
All fields are checked for type & consistency in traitConfig.lua



III - Data files
Data are informations used to feed the simulation. 
To keep this simple, while parameters describe the objects of the simulation, 
data fill them. 
Data are collections of values. If a single value is needed, it usually goes in parameters.

An independant piece of data wille be here called a frame.
A single file can contain multiple frames of different types.
The format used is not lua and follows this pattern:
The fist line of a frame is the header.
The header is marked by # at the beginning of the line.
This sign is followed by a variable number of argument separated by spaces.
The first word is always the type of the frame, and the following arguments depend of this type.

After the header, data must follow separaded by spaces.
Data will be loaded until the next header or the end of file.
White lines are ignored. Comments are allowed and start with -- (like in lua). 
The format is quite permissive with multiple whitespaces.
For data more than bidimensional, multiple frames must be used.

Most of the loading is done in userData.lua and also match.lua. 

It is worth noting that with every data type is provided a way to generate data
accorting to some parameters. Also, at the beginning of each simulation, all 
data used are outputed by the lua part in order to be checked or reused in other 
simulations.  

There are pimary and secondary data.
 - Primary data is used by C++ part of the program.
 - Secondary data are used to generate primary data.

The different types of data are: 

Primary:
- phenotypic optimums of a trait for each cells of the landscape
    Header: # zopt trait time
- environmental effects for each cells of the landscape
    Header: # e trait time
- selection intensity of a trait for each cells of the landscape
    Header: # selection_intensity trait time
- Allelic effects 
    Header: # allelic_effects trait locType
- Flux matrix 
    Header: # flux_matrix species propagule time
- Individuals
    Header: # individuals species
    
    
Secondary:
- Flux pattern
    Header: # flux_pattern
- Initial allelic frequencies 
    Header: # -- TBA
