Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Functions
Opinionet.cc File Reference
#include <iostream>
#include "Opinionet.hh"
Include dependency graph for Opinionet.cc:

Functions

int main (int, char **argv)
 

Function Documentation

◆ main()

int main ( int  ,
char **  argv 
)
8{
9 try {
10
11 // Initialize the PseudoParent from config file path
12 Utopia::PseudoParent pp(argv[1]);
13
14 // Get network kind
15 auto model_cfg = pp.get_cfg()["Opinionet"];
16 const bool nw_is_directed =
17 Utopia::get_as<bool>("directed", model_cfg["network"]);
18
19 // Initialize the main model instance
20 if (nw_is_directed) {
21 Opinionet<NetworkDirected> model("Opinionet", pp);
22 model.run();
23 }
24
25 else {
26 Opinionet<NetworkUndirected> model("Opinionet", pp);
27 model.run();
28 }
29
30 return 0;
31 }
32 catch (std::exception& e) {
33 std::cerr << e.what() << std::endl;
34 return 1;
35 }
36 catch (...) {
37 std::cerr << "Exception occured!" << std::endl;
38 return 1;
39 }
40}
The Opinionet model class.
Definition Opinionet.hh:82
A class to use at the top level of the model hierarchy as a mock parent.
Definition model.hh:1017
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213