<interfaces>

Top  Previous  Next

Separating data structure from data format is one of the key goals of abstract platforms. Therefore, the <interface> objects explicitly link and load external data on the computer memory, whereas the objects within the section <resources> access the respective <interface> objects and store them in the simulation data container (VarMap) to be accessible by further objects (e.g. SimComponents).

 

Modellers can explicitly link external I/O data using the <interface> objects in a ModelSolution. In practice, changing the <interface> source format does not necessarily change the data structure itself, but only how SIMPLACE reads and writes external data sources (SQL-database, CSV, JSON, NetCDF, DBF and XML).

 

Therefore, typical attributes of <interface> objects comprise the filename, format and separator. In the further section of your solution you refer to this data by the id rather than by the filename. So if you want to use another file or another filetype, you have just to change the name/the type once in the interface section and not all over your solution.

 

clip0008

 

 

The filename attribute of an <interface> object also accepts the direct use of JEXL Rule Engine, allowing, for example, to iterate I/O connections using a SimVariable declared in the <variables> section by enclosing the corresponding variable name in the placeholder “${}” (e.g. “${CropFile}” in Fig. below).

 

fig4

 

Fig. Simplified version of a model solution XML file summarizing the information flow and linkage (dashed red arrows) across the five main sections of a model solution (<variables>; <interfaces>; <resources>; <simmodel>; <outputs>) and its objects. The “...” represents parts of the solution that were omitted for simplicity. Solid red arrows indicate where rule-based expressions are used. The variable CropFile is not directly specified as a rule or source, in the case of <interface>, it can be passed by enclosing it in the placeholder “${}” (e.g. “${CropFile}”) (source: https://doi.org/10.1093/insilicoplants/diad006)

 

 

 

Although SIMPLACE can interface different data formats, the CSV is the most commonly used format to write SIMPLACE outputs in a tabular structure. NetCDF is also an efficient format to store multi-dimensional outputs. A special format type namely “MEMORY” makes the corresponding <output> object accessible directly from the computer memory, reducing the computation time of writing files on the hard disk. This is generally used by the SIMPLACE wrappers (e.g. R, Python packages), which can already convert the output into a data frame structure.