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

Typedefs

using DummyModel = Utopia::Models::Dummy::Dummy
 

Functions

int main (int, char **argv)
 

Typedef Documentation

◆ DummyModel

Function Documentation

◆ main()

int main ( int  ,
char **  argv 
)
8{
9 try {
10 // -- Model definition and iteration -- //
11
12 // Create PseudoParent from config file, setting up the HDFFile and RNG
13 Utopia::PseudoParent pp(argv[1]);
14
15 // Set the initial state, then create the model instance
16 std::vector<double> state(1E3, 0.0);
17 DummyModel model("dummy", pp, state);
18
19 // ... now use the PseudoParent to perform the iteration
20 model.run();
21 // -- Model iteration finished. -- //
22
23
24 // Test messages needed to assert that all output is read by frontend:
25 pp.get_logger()->info("All done.");
26 pp.get_logger()->info("Really.");
27
28 return 0;
29 }
30 catch (Utopia::Exception& e) {
32 }
33 catch (std::exception& e) {
34 std::cerr << e.what() << std::endl;
35 return 1;
36 }
37 catch (...) {
38 std::cerr << "An unexpected exception occurred!" << std::endl;
39 return 1;
40 }
41}
The base exception class to derive Utopia-specific exceptions from.
Definition exceptions.hh:15
Dummy model with simple update rule.
Definition dummy.hh:19
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