-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMetaPopulation.java
More file actions
39 lines (29 loc) · 1.07 KB
/
MetaPopulation.java
File metadata and controls
39 lines (29 loc) · 1.07 KB
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
package general;
import java.io.IOException;
import java.util.ArrayList;
public class MetaPopulation {
// simply the whole world: a list of all the populations (in phase A of the project this will be a list of length 1)
public ArrayList<Population> poplist;
int numOfPopulations;
ParamConfiguration conf;
public MetaPopulation(ParamConfiguration conf) throws IOException {
super();
this.conf = conf;
this.numOfPopulations = conf.numOfPopulations;
this.poplist = new ArrayList<Population>();
CreateGenerationZeroMetaPop();
}
public void CreateGenerationZeroMetaPop () throws IOException {
for (int i = 0; i<numOfPopulations; i++) {
Population p1 = new Population(conf.popsizes[i], conf.poptypes[i], conf, i);
System.out.println("popsize:" + conf.popsizes[i]);
this.poplist.add(p1);
}
}
public int getNumOfPopulations() {
return numOfPopulations;
}
public void setNumOfPopulations(int numOfPopulations) { // this can be used if populations are annihilated or diverge
this.numOfPopulations = numOfPopulations;
}
}