Singleton is probably the best option if you want these settings to be truly global.
However, for the purpose of simulation, I would think if you can pass a link to a configuration instance instead of your algorithms. This would make it easier to save configurations for simulation and, ultimately, would allow multiple simulations to be processed simultaneously with separate configurations if requirements change.
Often, trying to avoid a global state is the best, long-term approach.
source
share