Skip to content

Commit b7fe02a

Browse files
committed
Minor ideology matching changes
1 parent 5922cef commit b7fe02a

File tree

2 files changed

+50
-14
lines changed

2 files changed

+50
-14
lines changed

ideologies.js

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ ideologies = [
33
"name": "Anarcho-Communism",
44
"stats": {
55
"econ": 100,
6-
"dipl": 80,
6+
"dipl": 50,
77
"govt": 100,
8+
"scty": 90
9+
}
10+
},
11+
{
12+
"name": "Libertarian Communism",
13+
"stats": {
14+
"econ": 100,
15+
"dipl": 70,
16+
"govt": 80,
817
"scty": 80
918
}
1019
},
@@ -98,11 +107,20 @@ ideologies = [
98107
"scty": 80
99108
}
100109
},
110+
{
111+
"name": "Revolutionary Socialism",
112+
"stats": {
113+
"econ": 80,
114+
"dipl": 20,
115+
"govt": 50,
116+
"scty": 70
117+
}
118+
},
101119
{
102120
"name": "Libertarian Socialism",
103121
"stats": {
104122
"econ": 80,
105-
"dipl": 70,
123+
"dipl": 80,
106124
"govt": 80,
107125
"scty": 80
108126
}
@@ -260,20 +278,38 @@ ideologies = [
260278
"scty": 30
261279
}
262280
},
281+
{
282+
"name": "Reactionary",
283+
"stats": {
284+
"econ": 40,
285+
"dipl": 40,
286+
"govt": 40,
287+
"scty": 10
288+
}
289+
},
290+
{
291+
"name": "Social Libertarianism",
292+
"stats": {
293+
"econ": 60,
294+
"dipl": 70,
295+
"govt": 80,
296+
"scty": 70
297+
}
298+
},
263299
{
264300
"name": "Libertarianism",
265301
"stats": {
266302
"econ": 40,
267303
"dipl": 60,
268-
"govt": 70,
269-
"scty": 50
304+
"govt": 80,
305+
"scty": 60
270306
}
271307
},
272308
{
273309
"name": "Anarcho-Egoism",
274310
"stats": {
275311
"econ": 40,
276-
"dipl": 60,
312+
"dipl": 50,
277313
"govt": 100,
278314
"scty": 50
279315
}
@@ -327,8 +363,8 @@ ideologies = [
327363
"name": "Neo-Liberalism",
328364
"stats": {
329365
"econ": 30,
330-
"dipl": 40,
331-
"govt": 40,
366+
"dipl": 30,
367+
"govt": 50,
332368
"scty": 60
333369
}
334370
},
@@ -354,7 +390,7 @@ ideologies = [
354390
"name": "Neo-Conservatism",
355391
"stats": {
356392
"econ": 20,
357-
"dipl": 10,
393+
"dipl": 20,
358394
"govt": 40,
359395
"scty": 20
360396
}
@@ -373,7 +409,7 @@ ideologies = [
373409
"stats": {
374410
"econ": 20,
375411
"dipl": 50,
376-
"govt": 70,
412+
"govt": 80,
377413
"scty": 60
378414
}
379415
},

results.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
112112
document.getElementById("society-label").innerHTML = setLabel(progress, sctyArray)
113113

114114
ideology = ""
115-
ideodist = 30000
115+
ideodist = Infinity
116116
for (var i = 0; i < ideologies.length; i++) {
117117
dist = 0
118-
dist += Math.pow(ideologies[i].stats.econ - equality, 2)
119-
dist += Math.pow(ideologies[i].stats.govt - liberty, 2)
120-
dist += Math.pow(ideologies[i].stats.dipl - peace, 2)/3
121-
dist += Math.pow(ideologies[i].stats.scty - progress, 2)/2
118+
dist += Math.pow(Math.abs(ideologies[i].stats.econ - equality), 2)
119+
dist += Math.pow(Math.abs(ideologies[i].stats.govt - liberty), 2)
120+
dist += Math.pow(Math.abs(ideologies[i].stats.dipl - peace), 1.73856063)
121+
dist += Math.pow(Math.abs(ideologies[i].stats.scty - progress), 1.73856063)
122122
if (dist < ideodist) {
123123
ideology = ideologies[i].name
124124
ideodist = dist

0 commit comments

Comments
 (0)