5def concatenate_steps_of_species(
7 use_initialisation_steps=False,
11 Take the steps per species and concatenate them
13 So we first have all the steps of the first species, then all the steps of
14 the second species, and so forth.
16 @return [(Species,Step)]
17 The first entry is the species itself, the second its step. The third
18 entry is the number of the species. All species are enumerationed starting
19 with 0. This index is one way to distinguish them.
23 for current_species_set
in species_sets:
24 if use_initialisation_steps:
25 per_species_set = current_species_set.particle_model.initialisation_steps()
27 per_species_set = current_species_set.particle_model.algorithm_steps()
28 for step
in per_species_set:
30 (current_species_set, step)
35def interleave_steps_of_species(
37 use_initialisation_steps=False,
41 Interleave the steps of the species
43 Start with the first step of the first species, then the first step of the
44 second species, and so forth.
48 if use_initialisation_steps:
50 current_species_set.particle_model.initialisation_steps()
51 for current_species_set
in species_sets
55 current_species_set.particle_model.algorithm_steps()
56 for current_species_set
in species_sets
59 unassigned_steps = [0
for x
in current_species_set]
64 for current_species_set
in species_sets:
65 current_species_set_number = species_sets.index(current_species_set)
66 if use_initialisation_steps:
68 current_species_set.particle_model.initialisation_steps()
71 per_species_set = current_species_set.particle_model.algorithm_steps()
72 if active_step[current_species_set_number] < len(per_species_set):
75 per_species_set[active_step[current_species_set_number]]
77 active_step[current_species_set_number] += 1