Structure of the Code

BAT is object-oriented and uses inheritance for code reuse. The single most important hierarchy is that of BCModel. In most applications, a user would implement a model MyModel by either inheriting from BCModel directly or creating an instance of one of the Predefined Models and thus would inherit from BCModel indirectly.

The boxes on the diagram are links to the reference guide for the respective classes.

This structure has the benefit that MyModel has native access to all things related to Markov chains due to BCEngineMCMC and one can immediately optimize or integrate the posterior with the methods in BCIntegrate. However, one has to keep in mind that multiple Markov chains for the same instance of MyModel share the entire state of the object. This can lead to complications when MyModel::LogLikelihood is called concurrently; see Multithreading and Thread Safety for more details.



Return to the previous section or go to the next section.