1. i-SAS_SensorSimulator-template¶
1.1. interface¶
-
class
sensor_simulator.interface.Interface(instance_name, input_data_names, output_data_names, sensor_name, structural_model_name=None, **kwargs)¶ Bases:
objectinterface class
-
package_name= 'sensor_simulator'¶
-
input_data_num= 1¶
-
output_data_num= 1¶
-
__init__(instance_name, input_data_names, output_data_names, sensor_name, structural_model_name=None, **kwargs)¶ initialization of Interface class
- Parameters
instance_name (str) – name of instance.
input_data_names (list[str]) – names of input data.
output_data_names (list[str]) – names of output data.
sensor_name (str) – sensor name.
structural_model_name (str, optional) – structural model name.
**kwargs – Arbitrary keyword arguments.
-
set_project(project_name)¶ set project
- Parameters
project_name (str) – project name.
-
set_model(output_metadata, sensors, structural_models, structural_model_connections, sensor_structural_model_connections)¶ set model
- Parameters
output_metadata (pd.DataFrame) – output metadata.
sensors (dict) – sensors.
structural_models (dict) – structural models.
structural_model_connections (dict) – connections between data and structural model.
sensor_structural_model_connections (dict) – connections between sensor and structural model.
- Returns
containing followings
dict: information on instance of this model. pandas.DataFrame: output metadata of this model. dict: connections between output data of this model and structural model.
- Return type
tuple
-
__call__(input_data)¶ simulate measurement data
- Parameters
input_data (dict) – input data to simulator.
- Returns
containing followings,
dict: measurement data simulated. pandas.DataFrame: used timestamp. The length is the same as measurement data.
- Return type
tuple
-
exit()¶ exit simulator
-
1.2. model¶
-
class
sensor_simulator.model.Model(input_data_names, output_data_names, cfg)¶ Bases:
objectmodel class
-
__init__(input_data_names, output_data_names, cfg)¶ constructor
- Parameters
input_data_names (list[str]) – names of input data.
output_data_names (list[str]) – names of output data.
cfg (dict) – config.
-
set_model(output_metadata, sensors, structural_models, structural_model_connections)¶ set model and calculate intermediate values
- Parameters
output_metadata (pd.DataFrame) – output metadata.
sensors (dict) – sensors.
structural_models (dict) – structural models.
structural_model_connection (dict) – connections between data and structural model.
-
__call__(input_data)¶ simulate measurement data
- Parameters
input_data (list[pandas.DataFrame]) – time series data as input.
- Returns
- containing followings,
list[pandas.DataFrame]: measurement data. list[dict]: used timestamp for each input data. Dict has two keys, ‘s’ as strating timestamp and
’e’ as end time stamp, and the value is 1d-array of the timestamp used to caclulate output, whose length is the same as the length of output.
- Return type
tuple
-