fpmas-metamodel 1.0
|
#include <config.h>
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< GridAttractor > | grid_attractors |
float | zoltan_imbalance_tol = 1.1 |
bool | json_output = false |
int | json_output_period = -1 |
bool | dot_output = false |
Contains all the configuration relative to the environment of the model.
Each attribute corresponds to a YAML field. Some might be optional.
GraphConfig::GraphConfig | ( | YAML::Node | config | ) |
Loads the configuration from the specified YAML node.
config | YAML configuration |
|
inline |
Loads an optional configuration field into the corresponding attribute.
field_name | Name of the YAML field |
target | Reference to the attribute into which data should be loaded |
node | YAML node containing field value |
type_name | Name of the type, used to generate error messages |
default_value | Default value of the optional field, used if node is actually not defined. |
|
inline |
Loads a mandatory configuration field into the corresponding attribute.
field_name | Name of the YAML field |
target | Reference to the attribute into which data should be loaded |
node | YAML node containing field value |
type_name | Name of the type, used to generate error messages |
bool GraphConfig::is_valid = true |
True iff the configuration was properly loaded from the YAML file.
Environment GraphConfig::environment |
Environment type.
std::size_t GraphConfig::grid_width |
For GRID environment, specifies the grid width.
std::size_t GraphConfig::grid_height |
For GRID environment, specifies the grid height.
std::size_t GraphConfig::num_cells |
For environments other than GRID, specifies the number of cells in the global graph.
std::size_t GraphConfig::output_degree |
For environments other than GRID, specifies the average output degree of each cell in the cell network.
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.
float GraphConfig::cell_weight = 1.0f |
Weight of each cell.
Utility GraphConfig::utility = Utility::UNIFORM |
Cells utility function.
std::vector<GridAttractor> GraphConfig::grid_attractors |
List of GridAttractors. The utility of each cell corresponds to the sum of utilities generated by each attractor.
float GraphConfig::zoltan_imbalance_tol = 1.1 |
The Zoltan IMBALANCE_TOL parameter.
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.
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.
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.