Skip to content

Latest commit

 

History

History
385 lines (277 loc) · 15 KB

README.md

File metadata and controls

385 lines (277 loc) · 15 KB

We have two main components in the analytics pipeline: single model analyzer (SMA) and Summarizer.

Single model analyzer (SMA)

The Single Model Analyzer (SMA) is tasked with examining the outcomes of an individual model. It operates by taking the logs of a node's model, analyzing them, and creating a table that contains the results. In this table, the timestamps serve as the key for the entries, while the columns represent various metrics associated with the model.

For instance, in the case of a SMA designed for the power model, the columns in the generated table could include metrics like generated power, battery level, and consumed current. Moreover, the SMA is capable of accepting the output table from another SMA, enabling it to perform further analysis and produce a new table with different metrics in the columns.

SMA interface (ISMA)

Each SMA class should inherit the ISMA. Here goes some core properties and methods.

iName

A string representing the name of the SMA class. Note that the name should exactly match to your class name.

supportedModelNames

It provides a list of model names for which it can process the logs.

supportedSMANames

It provides the names of SMAs whose output can be processed by this particular SMA.

Execute()

This method executes the tasks that needed to be performed by the SMA.

get_Results()

This method returns the results of the SMA in the form of a DataFrame table once it is executed.

We already have several SMA implementations available here. Find a brief description below.

SMALoraRadioDeviceRx

About

This module analyzes the logs generated by the LoraRadioDevice and generates a table that describes the reception of packets in the specified format:

    1. frameID
    2. collision
    3. collisionFrameIDs
    4. plrDrop
    5. perDrop
    6. txBusyDrop
    7. crbwDrop
    8. nodeID
    9. timestamp
It processes both of the following log messages:
"Receiving. frameID: {int}. success: {bool}. collision: {bool}. collisionFrameIDs: {listOfInts}. plrDrop: {bool}. perDrop: {bool}. txBusyDrop: {bool}. crbwDrop: {bool}"
(Note: The brackets in the log message are placeholders to indicate the actual values that will replace them.)

Initialization method and config properties

@desc
    Initializes the SMALoraRadioDeviceRx class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMALoraRadioDevice class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
@return
    An instance of the SMALoraRadioDevice class

SMAPowerBasic

About

This is the implementation of the Single Model Analyzer (SMA) for the time-based Field of View (src file: modelpowerbasic.py).

The SMA generates a dataframe with the following columns:

    1. timestamp
    2. currentCharge
    3. chargeGenerated
    4. outOfPower
    5. tag0
    6. requested0
    7. granted0
    8. consumed0
    9. tag1
    10. requested1
    11. granted1
    12. consumed1
...
This column structure allows easy addition and removal of columns/tags in the future.

The SMA is specifically interested in the following string:
"PowerStats. CurrentCharge: [float] J. ChargeGenerated: [float] J. OutOfPower: [bool]. Tag: [str], Requested: [bool/NA], Granted: [bool/NA], Consumed: [float] J"
(Note: The brackets in the log message are included as part of the string. The last four values - tag, requested, granted, and consumed - are repeated for each tag.)

Initialization method and config properties

@desc
    Initializes the SMAPowerBasic class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMAPowerBasic class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
@return
    An instance of the SMAPowerBasic class

SMAGenericRadio

About

This module analyzes the logs produced by the ModelGenericRadio and creates a table in the specified format:
    1. timestamp
    2. action
    3. objectType
    4. objectID
    5. nodesInChannel
    6. rxQueueSize
    7. txQueueSize
    8. nodeID
The log message to be processed must strictly adhere to the following structure:
"Action: {_action}. ObjectType: {_objectType}. ObjectID: {_objectID}. NodesInChannels: {[listOfNodes]}. RxQueueSize: {_rxQueueSize}. TxQueueSize: {_txQueueSize}"
(Note: The brackets in the log message are placeholders to indicate the actual values that will replace them.)

Initialization method and config properties

@desc
    Initializes the SMAGenericRadio class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMAGenericRadio class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
    @key radioModelName
        Name of the specific radio model which extends the ModelGenericRadio class
@return
    An instance of the SMAGenericRadio class

SMADataGenerator

About

This module analyzes the logs produced by the modelDataGenerator and produces a table in the specified format:
    1. timestamp
    2. action
    3. id
    4. queueSize
    5. sourceNodeID
The expected log message from the modelDataGenerator must precisely match the following format:
[Action] dataID: [id]. queueSize: [size]

The "Action" field currently supports values "Generated" or "Dropped," but it can accommodate any other value as well.

Initialization method and config properties

@desc
    Initializes the SMADataGenerator class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMADataGenerator class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
@return
    An instance of the SMAPowerBasic class

SMADataStore

About

This is the implementation of the Single Model Analyzer (SMA) for the DataStore (source file: modeldatastore.py).
It operates by analyzing the logs generated by the modelDataStore and producing a table in the specified format:

    1. timestamp
    2. action
    3 .id
    4. sourceNodeID
    5. creationTime
    6. timeDelay
    7. queueSize
    8. nodeID
The "action" can take one of the following values: Queuing, Dequeuing, or Dropping.

Initialization method and config properties

@desc
    Initializes the SMADataStore class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMAPowerBasic class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
@return
    An instance of the SMAPowerBasic class

SMALoraRadioDeviceTx

About

This module analyzes the logs generated by the LoraRadioDevice and produces a table describing the transmission of packets in the specified format:

    1. frameID
    2. sourceAddress
    3. frameSize
    4. payloadSize
    5. mtuDrop
    6. busyDrop
    7. noValidChannelDrop
    8. instanceIDs
    9. destinationNodeIDs
    10. destinationRadioIDs
    11. snrs
    12. secondsToTransmits
    13. plrs
    14. pers
    15. timestamp
    16. nodeID
It exclusively processes the "tx" message of the LoraRadioDevice in the following format:
"Transmitting. frameID: {int}. sourceAddress: {addr}. frameSize: {int}. payloadSize: {int}. mtuDrop: {bool}. busyDrop: {bool}. noValidChannelDrop: {bool}.
instanceIDs: {listOfInts}. destinationNodeIDs: {listOfInts}. destinationRadioIDs: {listOfInts}. snrs: {listOfFloats}. secondsToTransmits: {listOfFloats}.
plrs: {listOfFloats}. pers: {listOfFloats}."
(Note: The brackets in the log message are placeholders to indicate the actual values that will replace them.)

Initialization method and config properties

@desc
    Initializes the SMALoraRadioDeviceTx class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMALoraRadioDeviceTx class.
    It should have the following (key, value) pairs:
    @key modelLogPath
        Path to the log file of the model
@return
    An instance of the SMALoraRadioDeviceTx class

Summarizer

The role of the summarizer in the simulator is to derive the final intended results by summarizing the outputs of other analytics jobs. It accomplishes this task by processing the outputs of one or multiple SMAs and/or existing summarizers. The summarizer takes the outputs of SMAs and existing summarizer implementations as inputs, analyzes this data, and presents the results in dictionary format. For instance, a summarizer designed for the power model can provide insights such as the average battery level across all satellites in a constellation or the frequency at which the satellites recharge their batteries.

Summarizer interface (ISummarizer)

Each SMA class should inherit the ISummarizer. Here goes some core properties and methods.

iName

A string representing the name of the summarizer class. Note that the name should exactly match to your class name.

supportedSMANames

It provides the names of SMAs whose output can be processed by this particular summarizer.

supportedSummarizerNames

It provides a list of summarizer names for which it can process the outputs.

Execute()

This method executes the tasks that needed to be performed by the summarizer.

get_Results()

This method returns the results of the summarizer in the form of a dictionary once it is executed.

We already have several summarizer implementations available here. Find a brief description below.

SummarizerPower

About

This module implements the summarizer for summarizing the Power model. For more details, please refer to the smapowerbasic.py module. It provides summaries for the following metrics:

    1. Percent charging: The percentage of time the satellite is able to charge.
    2. Average power generation: The average power generated in one timestep.
    3. Average power consumption: The average power consumed in one timestep.
    4. Number of times when the battery was empty: The count of times the battery was empty.
    5. Average battery level: The average battery level in one timestep.
    6. Average power consumption by component: The average power consumed by each component in one timestep.
    7. Max component: The name of the component that consumed the maximum power.
    8. Number of denials: The number of times a request to consume power was denied.

Initialization method and config properties

@desc
    Initializes the SummarizerPower class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SummarizerPower class
    @key _powerModelSMA 
        The SMA for the power model
@return
    An instance of the SummarizerPower class

SummarizerDataLayer

About

This module is responsible for implementing the summarization at the data layer. It calculates and generates the following metrics:
    1. endToEndPLR: End to end packet loss rate
    2. generatorToSatPLR: Packet loss rate from the generator to the satellite
    3. satToGroundPLR: Packet loss rate from the satellite to the ground
    4. endToEndLatency: End to end latency
    5. generatorToSatLatency: Latency from the generator to the satellite
    6. satToGSLatency: Latency from the satellite to the ground
    7. generationRate: Rate at which the data is generated
    8. satelliteAggregationRate: Rate at which the satellite is aggregating the data
    9. gsAggregationRate: Rate at which the groundstation is aggregating the data

Initialization method and config properties

@desc
    Initializes the SummarizerDataLayer class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SMAPowerBasic class.
    It should have the following (key, value) pairs:
    @key _generatorSMAs
        The list of the generator SMA(s) which are producing the data. See smadatagenerator.py
    @key _gsDataStoreSMAs
        The list of the gsDataStore SMA(s) which are storing the data. See smadatastore.py
    @key _satelliteDataStoreSMAs
        The list of the satelliteDataStore SMA(s) which are storing the data. See smadatastore.py
@return
    An instance of the SMAPowerBasic class

SummarizerLoraRadioDevice

About

This module processes the outputs of the two LoraRadioDevice SMAs and calculates the following metrics:

    1. numFramesDroppedMTU: Number of frames dropped due to MTU
    2. numFramesDroppedTxBusy: Number of frames dropped due to TX busy
    3. numFramesDroppedRX: Number of frames dropped due to RX busy
    4. numFramesCollided: Number of frames collided
    5. average/minimum/maximum PLRTX (Packet Loss Ratio TX) 
    6. average/minimum/maximum PERTX (Packet Error Rate TX) 

Initialization method and config properties

@desc
    Initializes the init_SummarizerLoraRadioDevice class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the init_SummarizerLoraRadioDevice class.
    It should have the following (key, value) pairs:
    @key _rxSMA
        The LoraRadioDeviceRx SMA which are storing the data. See smaloraradiodevicerx.py
    @key _txSMA
        The LoraRadioDeviceTx SMA which are storing the data. See smaloraradiodevicetx.py    
@return
    An instance of the init_SummarizerLoraRadioDevice class

SummarizerMultiplePower

About

SummarizerMultiplePower is a summarizer designed to consolidate the results of multiple power models.
It calculates and presents the following metrics:

    1. percentCharging: The percentage of time when the battery was charging
    2. averagePowerGeneration: The average power generation
    3. averageNumberOfTimesWhenBatteryWasEmpty: The average number of times when the battery was empty
    4. averageBatteryLevel: The average battery level
    5. maximumComponent: The most common component that consumed the maximum power

Initialization method and config properties

@desc
    Initializes the SummarizerMultiplePower class
@param[in] _kwargs
    Keyworded arguments that are passed to the constructor of the SummarizerMultiplePower class
    @key _powerSummarizers
        List of power summarizers
@return
    An instance of the SummarizerMultiplePower class