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

Classes

struct  EnvParam
 A non-abstract EnvParam, derived from the base class. More...
 
struct  EnvCellState
 A non-abstract EnvCellState, derived from the base class. More...
 

Functions

int main (int, char **argv)
 

Function Documentation

◆ main()

int main ( int  ,
char **  argv 
)
84 {
85 try {
86 // Initialize the PseudoParent from a config file path
87 Utopia::PseudoParent pp(argv[1]);
88
89 // Initialize the main model instance and directly run it
90 // Use the constructed EnvParam and EnvCellState; Have the model in
91 // standalone mode.
92 auto model =
94
95 model.track_parameter("some_global_parameter");
96 model.track_state("some_heterogeneous_parameter");
97
98 model.run();
99
100 // Done.
101 return 0;
102 }
103 catch (Utopia::Exception& e) {
104 return Utopia::handle_exception(e);
105 }
106 catch (std::exception& e) {
107 std::cerr << e.what() << std::endl;
108 return 1;
109 }
110 catch (...) {
111 std::cerr << "Exception occurred!" << std::endl;
112 return 1;
113 }
114}
The base exception class to derive Utopia-specific exceptions from.
Definition exceptions.hh:15
The Environment model provides a non-uniform, dynamic parameter background.
Definition Environment.hh:140
A class to use at the top level of the model hierarchy as a mock parent.
Definition model.hh:1017
int handle_exception(exc_t &exc)
A helper function to handle a Utopia-specific exception.
Definition exceptions.hh:140