You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specifications of the inputs of a given model (which properties are available, required, their type, etc) cannot be known from the outside of the simulator.
For instance, to know that the SB_VS User class can be provided with "max_tries" or "closest_station_evaluation" properties, one has to go look at the class declaration (and its parent class').
Same goes for the "operation_parameters" property of the SB_VS_R Operator class, which must contain the fields "start_time", "duration", "neighbor" and other ones.
Even the allowed agent types are stored in the Model class.
Today, new scenario inputs are created based on existing scenarios, which limits the use to the same properties.
Proposed solution
The idea is to generate JSON Schemas dynamically for a specific model. Call main.py with an option to get a complete JSON Schema for each agent type.
How to do so ?
Each agent could store the schema for its own properties in class attributes, and inherit from its parent' schema if needed.
The implementation can be fast enough (?). The idea is already present in the Person PROPERTIES class attribute.
Replication of code (enumeration of the parameters, default values...)
The schema could be generated from the class meta information (parameters with default values, description from docstring, etc)
The implementation may be difficult (no sure it is doable)
No replication of code
The text was updated successfully, but these errors were encountered:
Important improvements on this matter have been proposed in #32.
The chosen approach was this one: "Each agent could store the schema for its own properties in class attributes, and inherit from its parent' schema if needed". However, the generation process of the schemas will hopefully be improved in the future, since it's really not clean at the moment. That's why this issue will stay open.
For now, the important is that schemas can be generated dynamically from Starling, which allows parameters specification, documentation, validation, but also form generation, etc.
Problem exposition
The specifications of the inputs of a given model (which properties are available, required, their type, etc) cannot be known from the outside of the simulator.
For instance, to know that the SB_VS User class can be provided with "max_tries" or "closest_station_evaluation" properties, one has to go look at the class declaration (and its parent class').
Same goes for the "operation_parameters" property of the SB_VS_R Operator class, which must contain the fields "start_time", "duration", "neighbor" and other ones.
Even the allowed agent types are stored in the Model class.
Today, new scenario inputs are created based on existing scenarios, which limits the use to the same properties.
Proposed solution
The idea is to generate JSON Schemas dynamically for a specific model. Call main.py with an option to get a complete JSON Schema for each agent type.
How to do so ?
Each agent could store the schema for its own properties in class attributes, and inherit from its parent' schema if needed.
The schema could be generated from the class meta information (parameters with default values, description from docstring, etc)
The text was updated successfully, but these errors were encountered: