nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#719 valid data ranges for link API, #2457

Open nikhilgupta10 opened 7 years ago

nikhilgupta10 commented 7 years ago

For links (such as JSON) where the values are directly used in a potentially critical way (such as hardware), it is important to include a specification for the valid range for (simple) data. This would aid in integrity checking and help link participants filter out extraneous, spoofed, or possibly dangerous data values.

The main goal would be to communicate valid ranges when exchanging schema data during connection initialization. This opens up a question as to where such range information should be entered. Perhaps it depends on the data type and the source of the data. Options include:

-- The GLM file
-- The link file
-- possibly others

Some data types might naturally be specified in GLM, such as enum constants. Ranges for numeric data could possibly be included as an additional object property attribute. Alternatively such ranges could be added to the Link file, perhaps using []'s to define the range or values on the same line as the input and output directives.

Here is an example:

integer/double:
input test_0.y y0 [min, max]

Obviously this is only practical to define for certain simple data types including:

double/float
integer
enum
complex (using rectangular ranges?)

and possibly arrays or collections of such objects

An additional consideration is where/how to check these ranges. In the case of a data link, perhaps the most important checks would occur on the remote host (ie not in the gridLAB model) In these cases the only role for GridLAB is to communicate the valid ranges when establishing the link schema.

Depending on the application, it may or may not also be important to provide range checks on incoming data (from a remote host). This might require additional logic within the link module to filter/flag invalid data. And perhaps some options for how to proceed: e.g. IGNORE (and use last data), SIM (use current model results, if possible), QUIT.

,

nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: The user dchassin does not exist anymore. Therefore assigning this to afisher1. "jcfuller": * owner changed from jcfuller to dchassin

Diff: