/
simulation.hpp
46 lines (33 loc) · 891 Bytes
/
simulation.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2020 Joren Brunekreef and Andrzej Görlich
#pragma once
#include <random>
#include <vector>
#include "universe.hpp"
#include "observable.hpp"
class Simulation {
public:
static double lambda;
static int seed;
static void start(int sweeps, double lambda_, int targetVolume_, int seed_ = 0);
static void addObservable(Observable& o) {
observables.push_back(&o);
}
static bool pinch;
static std::array<int, 2> moveFreqs;
static int attemptMove();
private:
static std::default_random_engine rng;
static int targetVolume;
static double epsilon;
static bool measuring;
static std::vector<Observable*> observables;
static void sweep();
static bool moveAdd();
static bool moveDelete();
static bool moveFlip();
static void prepare();
// tuning isn't used in the current setup
// static void tune();
static void grow();
static void thermalize();
};