-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.js
More file actions
194 lines (124 loc) · 4.19 KB
/
Copy pathmodels.js
File metadata and controls
194 lines (124 loc) · 4.19 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
let diseaseTemplates=[];
class diseaseTemplate{//constant diseases array
constructor(name){
this.id=++diseaseTemplate.counter;
this.name=name;
//this.infectious=infectious;
}
}
diseaseTemplate.counter=0;
function fillDiseaseTemplates() {
diseaseTemplates.push(new diseaseTemplate("rabies"));
diseaseTemplates.push(new diseaseTemplate("Canine distemper "));
diseaseTemplates.push(new diseaseTemplate("canine hepatitis"));
diseaseTemplates.push(new diseaseTemplate("Brucellosis"));
diseaseTemplates.push(new diseaseTemplate("Lyme "));
diseaseTemplates.push(new diseaseTemplate("Hookworm "));
diseaseTemplates.push(new diseaseTemplate("Hydatid tapeworm"));
}
fillDiseaseTemplates();
class disease{//constant diseases array
constructor(diseaseTemplate,infectious){
this.diseaseTemplate=diseaseTemplate;
this.infectious=infectious;
}
}
class anatomicSizes{
constructor(jaw,foreLegHeight,pawDiameter,skullDiameter){
this.jaw=jaw;
this.foreLegHeight=foreLegHeight;
this.pawDiameter=pawDiameter;
this.skullDiameter=skullDiameter;
}
}
class definitiveFields{
constructor(wolfTagID,wolfNickname, wolfAnatomicSizes,diseases,characteristics,furColorCode,eyeColorCode,age,familySet,strMark,agiMark,intMark){
//characteristics is string array
//familySet is biome object
this.wolfTagID=wolfTagID;
this.wolfNickname=wolfNickname;
this.wolfAnatomicSizes=wolfAnatomicSizes;
this.diseases=diseases;
this.characteristics=characteristics;
this.furColorCode=furColorCode;
this.eyeColorCode=eyeColorCode;
this.age=age;
this.familySet=familySet;
this.strMark=strMark;
this.agiMark=agiMark;
this.intMark=intMark;
//
this.hunger=0;
this.alphaPoints=100;//to represent perfect alpha condition point for starters.
}
}
class structuralFields{
constructor(generationNumber,){
//branchID not mandatory
//branchName not mandatory
//ancestors are object
this.id=++structuralFields.counter;
this.generationNumber=generationNumber;
//this.maleAncestor=maleAncestor;
//this.femaleAncestor=femaleAncestor;
}
}
structuralFields.counter=0;
class wolf{
constructor(definitiveFields,structuralFields){
this.definitiveFields=definitiveFields;
this.structuralFields=structuralFields;
}
}
let wolves=[];
class environmentModel{
constructor(biome,waterAvailability,temperature,rainFreq,greenDensity, climateBias,surroundings, wildCardWolves, predatorCount, predatorThreat, preyCount){
this.id=++environmentModel.counter;
this.biome=biome;
this.waterAvailability=waterAvailability;
this.temperature=temperature;
this.rainFreq=rainFreq;
this.greenDensity=greenDensity;
this.climateBias=climateBias;
this.surroundings=surroundings;
this.wildCardWolves=wildCardWolves;
this.predatorCount=predatorCount;
this.predatorThreat=predatorThreat;
this.preyCount=preyCount;
}
}
environmentModel.counter=0;
class biome{
constructor(name){
this.name=name;
this.id=++biome.counter;
console.log(this.id);
}
}
biome.counter=0;
var biomeTemplates=[];
function fillBiomeTemplates() {
biomeTemplates.push(new biome("plains"));////
biomeTemplates.push(new biome("forest"));///
biomeTemplates.push(new biome("swamp"));
biomeTemplates.push(new biome("jungle"));///
biomeTemplates.push(new biome("taiga"));//
biomeTemplates.push(new biome("tundra"));////
biomeTemplates.push(new biome("desert"));
biomeTemplates.push(new biome("arctic"));//
}
fillBiomeTemplates();
var found = biomeTemplates.find(function(element) {
return element.name ="arctic";
});
console.log(found);
class simulationLog{
constructor(date,eventType,message){
this.id=++simulationLog.counter;
this.date=date+" days after release";
this.eventType=eventType;
this.message=message;
}
}
let simulationLogs=[];
simulationLog.counter=0;