-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTool.java
More file actions
95 lines (69 loc) · 2.82 KB
/
Tool.java
File metadata and controls
95 lines (69 loc) · 2.82 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package general;
import java.util.ArrayList;
import java.util.Scanner;
public class Tool {
public static int toolcounter = 0;
private double s;
private boolean[] whichSubPopsKnowIt;
private int knowledgeDistributionType; // there's overlap between this and the above. I'll see what turns out to be more useful.
private ArrayList<Integer> envsInWhichItIsUseful;
private int associatedToolKitSize;
public final int id;
public String NameOfTool; // composed of a concatenation of the ParentsIDs.
public ParamConfiguration conf;
public double createdACarryingCapacityChangeByAFactorOf = 1; // A factor of 1 is the default, and
// means that the tool doesn't change the carrying capacity.
public double reducedLossRateByAFactorOf = 1; // 1 is default, means nothing is changed.
public Tool(ParamConfiguration conf, double s, int distributionTypeOfToolKnowledge,
ArrayList<Integer> envsInWhichItIsUseful, int associatedToolKitSize) {
super();
if (associatedToolKitSize==0) {
System.out.println("someone tried to define a tool with a max size toolkit of zero tools!");
Scanner sc = new Scanner(System.in);while(!sc.nextLine().equals("")); //wait for "enter"
}
this.s = s;
this.conf = conf;
//this.whichSubPopsKnowIt = whichSubPopsKnowIt;
this.envsInWhichItIsUseful = envsInWhichItIsUseful;
this.associatedToolKitSize = associatedToolKitSize;
this.id = toolcounter;
toolcounter = toolcounter+1;
System.out.println("just created tool " + id);
this.knowledgeDistributionType = distributionTypeOfToolKnowledge;
if (distributionTypeOfToolKnowledge==0) {this.whichSubPopsKnowIt = conf.KnowledgeDistType0;}
else if (distributionTypeOfToolKnowledge==1) {this.whichSubPopsKnowIt = conf.KnowledgeDistType1;}
else {System.out.println("Tool ran into an unknown type of knowledge distribution: " + distributionTypeOfToolKnowledge);
Scanner sc = new Scanner(System.in);while(!sc.nextLine().equals("")); //wait for "enter"
}
}
public double getS() {
return s;
}
public boolean[] getWhichSubPopsKnowIt() {
return whichSubPopsKnowIt;
}
public ArrayList<Integer> getEnvsInWhichItIsUseful() {
return envsInWhichItIsUseful;
}
public int getAssociatedToolKitSize() {
return associatedToolKitSize;
}
public int getId() {
return id;
}
public String getNameOfTool() {
return NameOfTool;
}
public void setNameOfTool(String nameOfTool) {
NameOfTool = nameOfTool;
}
public int getKnowledgeDistributionType() {
return knowledgeDistributionType;
}
public void setValueOfCreatedACarryingCapacityChangeByAFactorOf(double PopSizeMultiplicationFactor) {
this.createdACarryingCapacityChangeByAFactorOf = createdACarryingCapacityChangeByAFactorOf;
}
public void setReducedLossRateByAFactorOf(double reducedLossRateByAFactorOf) {
this.reducedLossRateByAFactorOf = reducedLossRateByAFactorOf;
}
}