@@ -43,7 +43,6 @@ steps = 1000
4343burn = 0
4444block = [0 , 10 ]
4545sampletimes = build_schedule(steps, burn, block)
46- schedulers = [build_schedule(steps, 0 , 1 ), sampletimes, sampletimes, [0 , steps], build_schedule(steps, burn, steps ÷ 10 )]
4746callbacks = (callback_energy, callback_acceptance)
4847
4948# NO SWAPS
@@ -53,33 +52,27 @@ displacement_parameters = ComponentArray(σ=0.05)
5352pools = [(
5453 Move(Displacement(0 , zero(box)), displacement_policy, displacement_parameters, 1 - pswap),
5554) for _ in 1 : M]
55+
56+ algorithm_list = (
57+ (algorithm= Metropolis, pools= pools, seed= seed, parallel= false , sweepstep= N),
58+ (algorithm= StoreCallbacks, callbacks= (callback_energy, callback_acceptance), scheduler= sampletimes),
59+ (algorithm= StoreTrajectories, scheduler= sampletimes),
60+ (algorithm= StoreLastFrames, scheduler= [steps]),
61+ (algorithm= PrintTimeSteps, scheduler= build_schedule(steps, burn, steps ÷ 10 )),
62+ )
63+
5664# # Empty List
5765chains = deepcopy(chains_bkp)
5866path = " data/test/particles/KA2D_distribution/N$N /T$temperature /pswap$pswap /M$M "
59- algorithms = (
60- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
61- StoreCallbacks(callbacks, path),
62- StoreTrajectories(chains, path),
63- StoreLastFrames(chains, path),
64- PrintTimeSteps(),
65- )
66- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
67+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
6768run!(simulation)
6869
6970# # Linked List
7071chains = deepcopy(chains_ll_bkp)
7172path = " data/test/particles/KA2D_distribution_LL/N$N /T$temperature /pswap$pswap /M$M "
72- algorithms = (
73- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
74- StoreCallbacks(callbacks, path),
75- StoreTrajectories(chains, path),
76- StoreLastFrames(chains, path),
77- PrintTimeSteps(),
78- )
79- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
73+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
8074run!(simulation)
8175
82-
8376# SWAPS
8477pswap = 0.2
8578displacement_policy = SimpleGaussian()
@@ -91,30 +84,23 @@ pools = [(
9184 Move(DiscreteSwap(0 , 0 , (1 , 3 ), (NA, NC)), swap_policy, swap_parameters, pswap / 2 ),
9285 Move(DiscreteSwap(0 , 0 , (2 , 3 ), (NB, NC)), swap_policy, swap_parameters, pswap / 2 ),
9386) for _ in 1 : M]
87+ algorithm_list = (
88+ (algorithm= Metropolis, pools= pools, seed= seed, parallel= false , sweepstep= N),
89+ (algorithm= StoreCallbacks, callbacks= (callback_energy, callback_acceptance), scheduler= sampletimes),
90+ (algorithm= StoreTrajectories, scheduler= sampletimes),
91+ (algorithm= StoreLastFrames, scheduler= [steps]),
92+ (algorithm= PrintTimeSteps, scheduler= build_schedule(steps, burn, steps ÷ 10 )),
93+ )
9494# # Empty List
9595chains = deepcopy(chains_bkp)
9696path = " data/test/particles/KA2D_distribution/N$N /T$temperature /pswap$pswap /M$M "
97- algorithms = (
98- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
99- StoreCallbacks(callbacks, path),
100- StoreTrajectories(chains, path),
101- StoreLastFrames(chains, path),
102- PrintTimeSteps(),
103- )
104- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
97+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
10598run!(simulation)
10699
107100# # Linked List
108101chains = deepcopy(chains_ll_bkp)
109102path = " data/test/particles/KA2D_distribution_LL/N$N /T$temperature /pswap$pswap /M$M "
110- algorithms = (
111- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
112- StoreCallbacks(callbacks, path),
113- StoreTrajectories(chains, path),
114- StoreLastFrames(chains, path),
115- PrintTimeSteps(),
116- )
117- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
103+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
118104run!(simulation)
119105
120106
@@ -131,29 +117,21 @@ pools = [(
131117 Move(DiscreteSwap(0 , 0 , (1 , 3 ), (NA, NC)), swap_AC_policy, swap_AC_parameters, pswap / 2 ),
132118 Move(DiscreteSwap(0 , 0 , (2 , 3 ), (NB, NC)), swap_BC_policy, swap_BC_parameters, pswap / 2 ),
133119) for _ in 1 : M]
120+ algorithm_list = (
121+ (algorithm= Metropolis, pools= pools, seed= seed, parallel= false , sweepstep= N),
122+ (algorithm= StoreCallbacks, callbacks= (callback_energy, callback_acceptance), scheduler= sampletimes),
123+ (algorithm= StoreTrajectories, scheduler= sampletimes),
124+ (algorithm= StoreLastFrames, scheduler= [steps]),
125+ (algorithm= PrintTimeSteps, scheduler= build_schedule(steps, burn, steps ÷ 10 )),
126+ )
134127# # Empty List
135128chains = deepcopy(chains_bkp)
136129path = " data/test/particles/KA2D_distribution/N$N /T$temperature /ebswap$pswap /M$M "
137-
138- algorithms = (
139- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
140- StoreCallbacks(callbacks, path),
141- StoreTrajectories(chains, path),
142- StoreLastFrames(chains, path),
143- PrintTimeSteps(),
144- )
145- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
130+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
146131run!(simulation)
147132
148133# # Linked List
149134chains = deepcopy(chains_ll_bkp)
150135path = " data/test/particles/KA2D_distribution_LL/N$N /T$temperature /ebswap$pswap /M$M "
151- algorithms = (
152- Metropolis(chains, pools; sweepstep= N, seed= seed, parallel= false ),
153- StoreCallbacks(callbacks, path),
154- StoreTrajectories(chains, path),
155- StoreLastFrames(chains, path),
156- PrintTimeSteps(),
157- )
158- simulation = Simulation(chains, algorithms, steps; schedulers= schedulers, path= path, verbose= true )
159- run!(simulation)
136+ simulation = Simulation(chains, algorithm_list, steps; path= path, verbose= true )
137+ run!(simulation)
0 commit comments