mmCEsim 0.3.0
mmWave Channel Estimation Simulation
Export Class Reference

#include <export.h>

Collaboration diagram for Export:
[legend]

Classes

struct  DataParams
 

Public Types

enum  DType : unsigned {
  INT = 1 , DOUBLE = 2 , STRING = 4 , BOOL = 8 ,
  CHAR = 16 , SEQ = 32 , MAP = 64 , NUL = 1024 ,
  UNDEF = 2048
}
 
enum class  NodeRole { Tx , Rx , RIS }
 Role of each node. More...
 

Public Member Functions

 Export (CLI_Options &opt, Shared_Info *const info=nullptr)
 
 Export (CLI_Options &opt, const YAML::Node &config, const YAML_Errors &errors, Shared_Info *const info=nullptr)
 
 ~Export ()
 
YAML_Errors exportCode ()
 

Static Public Member Functions

static YAML_Errors exportCode (CLI_Options &opt, Shared_Info *const info=nullptr)
 
static YAML_Errors exportCode (CLI_Options &opt, const YAML::Node &config, const YAML_Errors &errors, Shared_Info *const info=nullptr)
 

Private Member Functions

std::ofstream & _f ()
 
std::string _langStr () const
 
std::string _langName () const
 
std::string _langExtension () const
 
std::string _langHeaderExtension () const
 
std::string _langMmcesimExtension () const
 
std::string _langCommentSymbol () const
 
void _info (const std::string &str) const
 
bool _preCheck (const YAML::Node &node, unsigned allowed_type, bool mattered=true)
 
template<typename T >
_as (const YAML::Node &n, bool mattered=true)
 
std::string _asStr (const YAML::Node &n, bool mattered=true)
 
void _setLatestError (const std::string &str)
 
void _setLang ()
 
bool _isKeyword (const std::string &str) const
 
std::tuple< bool, std::string, std::string > _setChannelGains (const YAML::Node &n)
 
std::string _asVarName (const std::string &str) const
 
std::ofstream & _wComment ()
 
void _topComment ()
 
void _beginning ()
 
void _generateChannels ()
 
void _generateConstants ()
 
void _algorithms ()
 
void _sounding ()
 
void _estimation (const Macro &macro, int job_cnt=-1)
 
void _reporting ()
 
void _ending ()
 
bool _loadALG ()
 
bool _setCascadedChannel ()
 
bool _setDataParams ()
 
bool _setVarNames ()
 Set the variable names defined by users. More...
 
void _generateBF (unsigned Nt_B)
 Generate RIS reflection matrices. More...
 
unsigned _getTestNum (const YAML::Node &n)
 
std::tuple< unsigned, unsigned, unsigned, unsigned, unsigned, unsigned > _getSize (const YAML::Node &n)
 Get the size of the node (Tx/Rx/RIS). More...
 
void _checkALGdependency (std::vector< std::string > &algs, bool logged=true)
 

Private Attributes

CLI_Options_opt
 
YAML::Node _config
 
YAML_Errors _errors
 
bool _already_error_before_export = false
 
std::ofstream * _f_ptr = nullptr
 
Shared_Info *const _s_info
 
std::vector< int > _transmitters
 
std::vector< int > _receivers
 
struct Export::DataParams _data_params
 
std::string _cascaded_channel
 
std::string _received_signal
 
std::string _noise
 
std::string _beamforming_W
 
std::string _beamforming_F
 
std::vector< std::string > _beamforming_RIS
 
std::map< std::string, std::string > _beamforming
 
Channel_Graph _channel_graph
 
std::vector< std::tuple< std::string, std::any, bool > > _constants
 
const int _MAX_TX = 1
 
const int _MAX_RX = 1
 
Lang lang = Lang::CPP
 

Member Enumeration Documentation

◆ DType

enum Export::DType : unsigned
Enumerator
INT 

int

DOUBLE 

double

STRING 

string

BOOL 

bool

CHAR 

map

SEQ 

sequence

MAP 

map

NUL 

null

UNDEF 

undefined

◆ NodeRole

enum class Export::NodeRole
strong

Role of each node.

RIS is the default role.

Enumerator
Tx 

transmitter

Rx 

receiver

RIS 

RIS/IRS.

Constructor & Destructor Documentation

◆ Export() [1/2]

Export::Export ( CLI_Options opt,
Shared_Info *const  info = nullptr 
)
Here is the call graph for this function:

◆ Export() [2/2]

Export::Export ( CLI_Options opt,
const YAML::Node &  config,
const YAML_Errors errors,
Shared_Info *const  info = nullptr 
)
Here is the call graph for this function:

◆ ~Export()

Export::~Export ( )

Member Function Documentation

◆ _algorithms()

void Export::_algorithms ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _as()

template<typename T >
T Export::_as ( const YAML::Node &  n,
bool  mattered = true 
)
inlineprivate
Here is the call graph for this function:

◆ _asStr()

std::string Export::_asStr ( const YAML::Node &  n,
bool  mattered = true 
)
inlineprivate
Here is the caller graph for this function:

◆ _asVarName()

std::string Export::_asVarName ( const std::string &  str) const
inlineprivate
Here is the call graph for this function:

◆ _beginning()

void Export::_beginning ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkALGdependency()

void Export::_checkALGdependency ( std::vector< std::string > &  algs,
bool  logged = true 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _ending()

void Export::_ending ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _estimation()

void Export::_estimation ( const Macro macro,
int  job_cnt = -1 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _f()

std::ofstream & Export::_f ( )
inlineprivate
Here is the caller graph for this function:

◆ _generateBF()

void Export::_generateBF ( unsigned  Nt_B)
private

Generate RIS reflection matrices.

To generate the RIS reflection matrices (i.e. the passive beamforming at the RIS), four parameters should be known:

  1. Pilot;
  2. Beam Number at the Tx;
  3. RIS size;
  4. The variable names.

The first two are necessary because we need to calculate the number of RIS reflection patterns; The variable names are also needed since we need to generate those definitions.
The pilot can be directly written as 'pilot'; The size of RIS can be obtained in the list; The variable names are listed in _beamforming_RIS.

Parameters
Nt_BThe beam number at the transmitter (Tx).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _generateChannels()

void Export::_generateChannels ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _generateConstants()

void Export::_generateConstants ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getSize()

std::tuple< unsigned, unsigned, unsigned, unsigned, unsigned, unsigned > Export::_getSize ( const YAML::Node &  n)
private

Get the size of the node (Tx/Rx/RIS).

Parameters
nThe node.
Returns
(std::tuple<unsigned, unsigned, unsigned, unsigned, unsigned, unsigned>) The size. The five elements are: Mx, My, GMx, GMy, BMx, BMy.
Here is the caller graph for this function:

◆ _getTestNum()

unsigned Export::_getTestNum ( const YAML::Node &  n)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _info()

void Export::_info ( const std::string &  str) const
inlineprivate
Here is the caller graph for this function:

◆ _isKeyword()

bool Export::_isKeyword ( const std::string &  str) const
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _langCommentSymbol()

std::string Export::_langCommentSymbol ( ) const
inlineprivate
Here is the caller graph for this function:

◆ _langExtension()

std::string Export::_langExtension ( ) const
inlineprivate
Here is the caller graph for this function:

◆ _langHeaderExtension()

std::string Export::_langHeaderExtension ( ) const
inlineprivate

◆ _langMmcesimExtension()

std::string Export::_langMmcesimExtension ( ) const
inlineprivate
Here is the caller graph for this function:

◆ _langName()

std::string Export::_langName ( ) const
inlineprivate
Here is the caller graph for this function:

◆ _langStr()

std::string Export::_langStr ( ) const
inlineprivate
Here is the caller graph for this function:

◆ _loadALG()

bool Export::_loadALG ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _preCheck()

bool Export::_preCheck ( const YAML::Node &  node,
unsigned  allowed_type,
bool  mattered = true 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _reporting()

void Export::_reporting ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setCascadedChannel()

bool Export::_setCascadedChannel ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setChannelGains()

std::tuple< bool, std::string, std::string > Export::_setChannelGains ( const YAML::Node &  n)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setDataParams()

bool Export::_setDataParams ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setLang()

void Export::_setLang ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setLatestError()

void Export::_setLatestError ( const std::string &  str)
inlineprivate
Here is the caller graph for this function:

◆ _setVarNames()

bool Export::_setVarNames ( )
private

Set the variable names defined by users.

Return values
trueSuccess.
falseFailure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _sounding()

void Export::_sounding ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _topComment()

void Export::_topComment ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _wComment()

std::ofstream & Export::_wComment ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportCode() [1/3]

YAML_Errors Export::exportCode ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportCode() [2/3]

YAML_Errors Export::exportCode ( CLI_Options opt,
const YAML::Node &  config,
const YAML_Errors errors,
Shared_Info *const  info = nullptr 
)
static
Here is the call graph for this function:

◆ exportCode() [3/3]

YAML_Errors Export::exportCode ( CLI_Options opt,
Shared_Info *const  info = nullptr 
)
static
Here is the call graph for this function:

Member Data Documentation

◆ _already_error_before_export

bool Export::_already_error_before_export = false
private

◆ _beamforming

std::map<std::string, std::string> Export::_beamforming
private

◆ _beamforming_F

std::string Export::_beamforming_F
private

◆ _beamforming_RIS

std::vector<std::string> Export::_beamforming_RIS
private

◆ _beamforming_W

std::string Export::_beamforming_W
private

◆ _cascaded_channel

std::string Export::_cascaded_channel
private

◆ _channel_graph

Channel_Graph Export::_channel_graph
private

◆ _config

YAML::Node Export::_config
private

◆ _constants

std::vector<std::tuple<std::string, std::any, bool> > Export::_constants
private

◆ _data_params

struct Export::DataParams Export::_data_params
private

◆ _errors

YAML_Errors Export::_errors
private

◆ _f_ptr

std::ofstream* Export::_f_ptr = nullptr
private

◆ _MAX_RX

const int Export::_MAX_RX = 1
private

◆ _MAX_TX

const int Export::_MAX_TX = 1
private

◆ _noise

std::string Export::_noise
private

◆ _opt

CLI_Options& Export::_opt
private

◆ _received_signal

std::string Export::_received_signal
private

◆ _receivers

std::vector<int> Export::_receivers
private

◆ _s_info

Shared_Info* const Export::_s_info
private

◆ _transmitters

std::vector<int> Export::_transmitters
private

◆ lang

Lang Export::lang = Lang::CPP
private

The documentation for this class was generated from the following files: