Extension des Simulators pog

This commit is contained in:
Maximilian Wagner 2023-06-05 11:37:37 +02:00
parent e0234dd2e4
commit 0505f3f1c9
2 changed files with 89 additions and 9 deletions

View File

@ -11,6 +11,8 @@ APog = [2,3,4,5]
HPmult = 2 HPmult = 2
APmult = 2 APmult = 2
simRes = ""
print("AP:HP:HPnew\n") print("AP:HP:HPnew\n")
for i in range(0,4): for i in range(0,4):
@ -18,24 +20,33 @@ for i in range(0,4):
AP = HPog AP = HPog
match i: match i:
case 0: case 0:
print("## Calculating without Multipliers ##") caseString = "## Calculating without Multipliers ##"
print(caseString)
simRes += caseString
case 1: case 1:
print("\n## Calculating with Attack Multipliers ##") caseString = "\n## Calculating with Attack Multipliers ##"
print(caseString)
simRes += caseString
AP = [point * 2 for point in AP] AP = [point * 2 for point in AP]
case 2: case 2:
print("\n## Calculating with Defense Multipliers ##") caseString = "\n## Calculating with Defense Multipliers ##"
print(caseString)
simRes += caseString
HP = [point * 2 for point in HP] HP = [point * 2 for point in HP]
case 3: case 3:
print("\n## Calculating with Attack and Defense Multipliers ##") caseString = "\n## Calculating with Attack and Defense Multipliers ##"
print(caseString)
simRes += caseString
AP = [point * 2 for point in AP] AP = [point * 2 for point in AP]
HP = [point * 2 for point in HP] HP = [point * 2 for point in HP]
itString = "\n-First Iteration-\n"
print("-First Iteration-") print(itString)
simRes += itString
liste = [AP, HP] liste = [AP, HP]
combinations = [p for p in it.product(*liste)] combinations = [p for p in it.product(*liste)]
@ -44,11 +55,21 @@ for i in range(0,4):
for comb in combinations: for comb in combinations:
for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"): for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"):
print(str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"])) tmpStr = str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"]) + "\n"
print(tmpStr)
simRes += tmpStr
newcombs.append((comb[0], soln["HPnew"])) newcombs.append((comb[0], soln["HPnew"]))
print("-Second Iteration-") itString = "\n-Second Iteration-\n"
print(itString)
simRes += itString
for comb in newcombs: for comb in newcombs:
for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"): for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"):
print(str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"])) tmpStr = str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"]) + "\n"
print(tmpStr)
simRes += tmpStr
with open("res.txt", "w") as w:
w.write(simRes)

59
res.txt Normal file
View File

@ -0,0 +1,59 @@
## Calculating without Multipliers ##
-First Iteration-
1:2:1
1:3:2
1:5:4
2:3:1
2:5:3
3:5:2
-Second Iteration-
1:2:1
1:4:3
2:3:1
## Calculating with Attack Multipliers ##
-First Iteration-
2:3:1
2:5:3
4:5:1
-Second Iteration-
2:3:1
## Calculating with Defense Multipliers ##
-First Iteration-
1:2:1
1:4:3
1:6:5
1:10:9
2:4:2
2:6:4
2:10:8
3:4:1
3:6:3
3:10:7
5:6:1
5:10:5
-Second Iteration-
1:3:2
1:5:4
1:9:8
2:4:2
2:8:6
3:7:4
## Calculating with Attack and Defense Multipliers ##
-First Iteration-
2:4:2
2:6:4
2:10:8
4:6:2
4:10:6
6:10:4
-Second Iteration-
2:4:2
2:8:6
4:6:2