Module: simpleStorageUnit

Executive Summary

The SimpleStorageUnit class is a model of storage unit functionality that keeps only one “partition” or buffer that all data is stored in. This module considers:

  1. Integrated net input data of the attached dataNodes in one partition.

  2. The storage unit’s maximum storage capacity as defined by the storageCapacity attribute.

Integration of the net input data is performed with a simple Euler method for each partition.

\(Data_{stored} = (baudRate) (t_{current} - t_{previous})\)

Module Assumptions and Limitations

See Module: dataStorageUnitBase class for inherited assumption and limitations.

Message Connection Descriptions

This module only uses the input and output messages of the Module: dataStorageUnitBase base class.

User Guide

To set up this module users must create a SimpleStorageUnit instance:

storageUnit = simpleStorageUnit.SimpleStorageUnit()
storageUnit.ModelTag = "storageUnit"

In addition to the variables that must be set for the Module: dataStorageUnitBase base class, this module requires the storageCapacity attribute to be specified. The total data stored in the storageUnit will be limited to not exceed this capacity value:

storageUnit.storageCapacity = 1E5 # Given in bits

The next step is to attach one or more DataNodeUsageMsgPayload instances to it using the addDataNodeToModel() method:

storageUnit.addDataNodeToModel(dataMsg)

The method setDataBuffer() can be used to add or remove a specific amount of data from the storage unit:

storageUnit.setDataBuffer(1E4) # Given in bits

For more information on how to set up and use this module, see the simple data system example scenarioDataDemo.


class SimpleStorageUnit : public DataStorageUnitBase
#include <simpleStorageUnit.h>

simple storage unit class

Public Functions

SimpleStorageUnit()

The constructor creates a SimpleStorageUnit instance with zero stored data

Returns

void

~SimpleStorageUnit()

Destructor

Returns

void

void setDataBuffer(int64_t data)

Method to add/remove data from the storage unit once.

Adds a specific amount of data to the storedData vector once

Parameters

data – //Data to be added to the “STORED DATA” partition

Returns

void

Private Functions

void customReset(uint64_t CurrentClock)

Custom Reset method.

Custom reset function

Parameters

currentClock

void integrateDataStatus(double currentTime)

Overwrites the integrateDataStatus method to create a single partition in the storage unit (“STORED DATA”)

Overwrites the integrateDataStatus method to create a single partition in the storage unit (“STORED DATA”)

Parameters

currentTime

Returns

void