To allow for as much flexibility as possible, VVE allows the user to parametrize a lot of types. While this is essential to develop new ideas and complex models, simple models become cumbersome to write.
Model helpers predefine the main data structures, provide initialization, default drawing functions and more. In some extreme case (like the Cell-System model helper) the smallest possible model can be three line long. In some other case, it is a bit longer to get any useful model.
The template to use helpers is always the same:
#define VertexAttributes \ double a; \ double b; #include <helper_model.h> StartModel void initialize() { // Custom initialization } void readParam(util::Parms& parms) { // Read custom parameters } void step() { // Redefining the default step ParentClass::step(); // Call the default step function } EndModel
From within the model, there will always be a set of variables and vertex attributes predefined. When adding your own attributes, be careful to choose name not clashing with already defined attributes. There are only two class names common to all the helpers:
ModelClass
is defined after the StartModel
and is the name of the model class being definedParentClass
is defined within the model (i.e. in between StartModel
and EndModel
) and can be used to call the original method when you define your own.In addition to these functions, all methods of the Model class can be overloaded to personalize the model.