Skip to main content

data-structure

Introduction

Assets are individual instances of a blueprint that contain data (from a real asset or a virtual asset). Assets are always referencing to a base blueprint that provides the basic information about the asset. The asset also contains several other attributes that form a complete data structure. They are listed here:

  • id (int, or None): ID of the asset (Altergo-specific)
  • iot_data (dict or None): A dictionary to handle the IoT Data for the asset. If the asset is virtual, the IoT Data is also virtual.
  • serial_number (str, or None): A unique identifier for the asset.
  • model (Model, or None): Base blueprint from which the asset is instantiated.
  • current_state (CurrentState, or None): Current State of the asset.
  • tags (list[Tag], or None): List of tags associated with the asset.
  • df (DataFrame): DataFrame associated for the asset. DataFrame can be placed in the df attribute in preparation for dispatching data to the platform. It is also the place where data is placed when the getAssetDataFrame method is called.
  • dfList (DataFrame): Temporarily stores a list of dataframes when the getAssetDataFrame method is called.

The Model attribute in the asset stores information about the model. The model itself is a datastructure that contains several attributes:

  • id (int, optional): ID of the model (Altergo-specific)
  • name (int, optional): Name of the model.
  • is_configurable (bool, optional): Flag to indicate if the model is configurable.
  • configuration_type (str, optional): Type of configuration associated with the model.
  • view_template (ViewTemplate, optional): ViewTemplate associated with the model.
  • category (Category, optional): Category associated with the model.
  • image (Image, optional): Image associated with the model.
  • configurations (list of Configuration, optional): List of Configurations associated with the model.
  • parameters (list of Paramter, optional): List of Parameters associated with the Model.
  • sensors (list of Sensor, optional): List of Sensors associated with the model.
  • child_component_models (list of ChildComponentModel, optional): List of ChildComponentModels associated with the model.

Assets vs. Blueprints

Often, new users get confused with the difference between blueprints and assets. To make a clear distinction between the two, it is often useful to look at the concepts of Object Oriented Programming (OOP). In OOP, we have classes and objects. One class can have one or many object instantiations. In this analogy, blueprints are analogous to classes, and assets are analogous to objects. A key difference in the analogy is that assets reflect changes made to the blueprints. Thus, if a blueprint is modified, the changes are reflected across all assets instantiated from that blueprint.