fpmas-metamodel 1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
GraphConfig Struct Reference

#include <config.h>

Inheritance diagram for GraphConfig:
Inheritance graph
[legend]

Public Member Functions

template<typename T >
void load_config_optional (std::string field_name, T &target, YAML::Node node, std::string type_name, const T &default_value)
 
template<typename T >
void load_config (std::string field_name, T &target, YAML::Node node, std::string type_name)
 
 GraphConfig (YAML::Node config)
 

Public Attributes

bool is_valid = true
 
Environment environment
 
std::size_t grid_width
 
std::size_t grid_height
 
std::size_t num_cells
 
std::size_t output_degree
 
float p
 
float cell_weight = 1.0f
 
Utility utility = Utility::UNIFORM
 
std::vector< GridAttractorgrid_attractors
 
float zoltan_imbalance_tol = 1.1
 
bool json_output = false
 
int json_output_period = -1
 
bool dot_output = false
 

Detailed Description

Contains all the configuration relative to the environment of the model.

Each attribute corresponds to a YAML field. Some might be optional.

Constructor & Destructor Documentation

◆ GraphConfig()

GraphConfig::GraphConfig ( YAML::Node  config)

Loads the configuration from the specified YAML node.

Parameters
configYAML configuration

Member Function Documentation

◆ load_config_optional()

template<typename T >
void GraphConfig::load_config_optional ( std::string  field_name,
T &  target,
YAML::Node  node,
std::string  type_name,
const T &  default_value 
)
inline

Loads an optional configuration field into the corresponding attribute.

Parameters
field_nameName of the YAML field
targetReference to the attribute into which data should be loaded
nodeYAML node containing field value
type_nameName of the type, used to generate error messages
default_valueDefault value of the optional field, used if node is actually not defined.

◆ load_config()

template<typename T >
void GraphConfig::load_config ( std::string  field_name,
T &  target,
YAML::Node  node,
std::string  type_name 
)
inline

Loads a mandatory configuration field into the corresponding attribute.

Parameters
field_nameName of the YAML field
targetReference to the attribute into which data should be loaded
nodeYAML node containing field value
type_nameName of the type, used to generate error messages

Member Data Documentation

◆ is_valid

bool GraphConfig::is_valid = true

True iff the configuration was properly loaded from the YAML file.

◆ environment

Environment GraphConfig::environment

Environment type.

◆ grid_width

std::size_t GraphConfig::grid_width

For GRID environment, specifies the grid width.

◆ grid_height

std::size_t GraphConfig::grid_height

For GRID environment, specifies the grid height.

◆ num_cells

std::size_t GraphConfig::num_cells

For environments other than GRID, specifies the number of cells in the global graph.

◆ output_degree

std::size_t GraphConfig::output_degree

For environments other than GRID, specifies the average output degree of each cell in the cell network.

◆ p

float GraphConfig::p

For SMALL_WORLD environment, probability to relink each edge.

The graph is regular for p=0, and completely random for p=1. p=0.1 is a decent value that is generally enough to generate the Small World property within the graph.

◆ cell_weight

float GraphConfig::cell_weight = 1.0f

Weight of each cell.

◆ utility

Utility GraphConfig::utility = Utility::UNIFORM

Cells utility function.

◆ grid_attractors

std::vector<GridAttractor> GraphConfig::grid_attractors

List of GridAttractors. The utility of each cell corresponds to the sum of utilities generated by each attractor.

◆ zoltan_imbalance_tol

float GraphConfig::zoltan_imbalance_tol = 1.1

◆ json_output

bool GraphConfig::json_output = false

If true, a json output representing the utility of each cell and the count of agents in each cells is generated.

◆ json_output_period

int GraphConfig::json_output_period = -1

Period at which the json_output should be performed.

If unspecified or negative but json_output is set to true, the json output is only performed at the end of the simulation.

◆ dot_output

bool GraphConfig::dot_output = false

If true, a DOT file representing the global simulation graph is generated at the end of each model test case.


The documentation for this struct was generated from the following file: