-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProj2_decisionMatrixCode_Team59.py
More file actions
38 lines (32 loc) · 1.33 KB
/
Proj2_decisionMatrixCode_Team59.py
File metadata and controls
38 lines (32 loc) · 1.33 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
#Takes in site, cost and efficiency
def getDecisionMatrixValue(site, cost, efficiency):
normalizedCost = 0
normalizedEfficiency = 0
normalizedEthical= 0
#intialize max values for each parameter
maxEfficiency = 40
maxCost = 20000000
maxEthical = 20
#calculate decision matrix values based on site
if(site == 1):
cost += 6660000
normalizedCost = (1 - (cost / maxCost))
normalizedEfficiency = efficiency / maxEfficiency
normalizedEthical = 1 - (20 / maxEthical)
elif(site == 2):
cost += 9300000
normalizedCost = (1 - (cost / maxCost))
normalizedEfficiency = efficiency / maxEfficiency
normalizedEthical = 1 - (0 / maxEthical)
elif(site == 3):
cost += 1616500
normalizedCost = (1 - (cost / maxCost))
normalizedEfficiency = efficiency / maxEfficiency
normalizedEthical = 1 - (0 / maxEthical)
# Returns total score for decision matrix
finalVal = ((0.4 * normalizedCost) + (0.4 * normalizedEfficiency) + (0.2 * normalizedEthical))
if finalVal > 1:
print(f"Cost: {normalizedCost:2.3f} --- Eff: {normalizedEfficiency:2.3f} --- Eth: {normalizedEthical:2.3f}")
print(efficiency)
print(finalVal)
return finalVal