Fixed bug in programm.
This commit is contained in:
@@ -29,26 +29,37 @@ Simulation::~Simulation() {
|
||||
}
|
||||
|
||||
void Simulation::init_pop_arrays() {
|
||||
Population_Manager *populations = looper.get_populations();
|
||||
|
||||
int number_pop_species = 0;
|
||||
vector<species> all_species = get_all_species_vector();
|
||||
number_pop_species = all_species.size();
|
||||
for (vector<species>::iterator itr = all_species.begin(); itr!= all_species.end(); itr++) {
|
||||
if (populations->find(*itr)->access_container() != nullptr) {
|
||||
number_pop_species += 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
pop_species = new species[number_pop_species];
|
||||
pop_array_lengths = new int[number_pop_species];
|
||||
global_cum_time_s = new double *[number_pop_species];
|
||||
global_offset = new double *[number_pop_species];
|
||||
|
||||
Population_Manager *populations = looper.get_populations();
|
||||
Population_Base *population;
|
||||
for (int i = 0; i<number_pop_species; i++) {
|
||||
pop_species[i] = all_species[i];
|
||||
population = populations->find(pop_species[i]);
|
||||
|
||||
pop_array_lengths[i] = population->access_container()->data_size;
|
||||
global_cum_time_s[i] = new double[pop_array_lengths[i]];
|
||||
global_offset[i] = new double[pop_array_lengths[i]];
|
||||
for (int j = 0; j<pop_array_lengths[i]; j++) {
|
||||
global_cum_time_s[i][j] = 0;
|
||||
global_offset[i][j] = 0;
|
||||
|
||||
int i = 0;
|
||||
for (vector<species>::iterator itr = all_species.begin(); itr!= all_species.end(); itr++) {
|
||||
if (populations->find(*itr)->access_container() != nullptr) {
|
||||
pop_species[i] = *itr;
|
||||
population = populations->find(*itr);
|
||||
|
||||
pop_array_lengths[i] = population->access_container()->data_size;
|
||||
global_cum_time_s[i] = new double[pop_array_lengths[i]];
|
||||
global_offset[i] = new double[pop_array_lengths[i]];
|
||||
for (int j = 0; j<pop_array_lengths[i]; j++) {
|
||||
global_cum_time_s[i][j] = 0;
|
||||
global_offset[i][j] = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user