Skip to content
This repository has been archived by the owner on Sep 3, 2018. It is now read-only.

Commit

Permalink
update for RS
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Peters authored and Sean Peters committed Jul 6, 2018
1 parent 5b8e205 commit 3760a69
Show file tree
Hide file tree
Showing 19 changed files with 3,559 additions and 189 deletions.
103 changes: 81 additions & 22 deletions analyzeRS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pandas
import weights
import argparse
import re

parser = argparse.ArgumentParser(description='Analyzes a json file.')
parser.add_argument('dir', help='Directory you wish to analyze.')
Expand Down Expand Up @@ -49,14 +50,18 @@ def getChange(current, previous):
for value in data.iterrows():
profile = value[1].profile
if args.weights:
weight = weights.get(profile[profile.index('_')+1:])
# HC_da1_FetidDevourer -> HC_FetidDevourer
# HC_da_FetidDevourer -> HC_FetidDevourer
profile = re.sub(r"(_\w*_)", "_", profile)
weight = weights.get(profile)
if value[1].int <= 0: value[1].int = 0.01
haste = (value[1].haste / value[1].int) * weight
crit = (value[1].crit / value[1].int) * weight
mastery = (value[1].mastery / value[1].int) * weight
vers = (value[1].vers / value[1].int) * weight
else:
if args.dir == "talents/" or args.dir == "trinkets/":
weight = weights.get(profile[profile.index('_')+1:])
weight = weights.get(profile)
else:
weight = weights.get(profile)
weightedDPS = weight * value[1].DPS
Expand All @@ -72,25 +77,47 @@ def getChange(current, previous):
results[value[1].actor] = [weightedDPS,weight,haste,crit,mastery,vers]
else:
results[value[1].actor] = weightedDPS
if profile == "HC_Taloc":
taloc[value[1].actor] = value[1].DPS
elif profile == "HC_Mother_Early" or profile == "HC_Mother_Late":
if value[1].actor in mother:
mother[value[1].actor] = mother.get(value[1].actor) + (value[1].DPS * .5)
else:
mother[value[1].actor] = value[1].DPS
if profile == "HC_FetidDevourer":
fetid[value[1].actor] = value[1].DPS
if profile == "HC_Zekvoz":
zekvoz[value[1].actor] = value[1].DPS
if profile == "HC_Vectis":
vectis[value[1].actor] = value[1].DPS
if profile == "HC_Zul":
zul[value[1].actor] = value[1].DPS
if profile == "HC_Mythrax":
mythrax[value[1].actor] = value[1].DPS
if profile == "HC_Ghuun":
ghuun[value[1].actor] = value[1].DPS
if args.weights:
if profile == "HC_Taloc":
taloc[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
elif profile == "HC_Mother_Early" or profile == "HC_Mother_Late":
if value[1].actor in mother:
existing = mother.get(value[1].actor)
mother[value[1].actor] = [existing[0] + (value[1].DPS * .5),existing[1] + 0.5,existing[2] + (value[1].haste * .5),existing[3] + (value[1].crit * .5),existing[4] + (value[1].mastery * .5),existing[5] + (value[1].vers * .5)]
else:
mother[value[1].actor] = [(value[1].DPS * .5),0.5,(value[1].haste * .5),(value[1].crit * .5),(value[1].mastery * .5),(value[1].vers * .5)]
if profile == "HC_FetidDevourer":
fetid[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
if profile == "HC_Zekvoz":
zekvoz[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
if profile == "HC_Vectis":
vectis[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
if profile == "HC_Zul":
zul[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
if profile == "HC_Mythrax":
mythrax[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
if profile == "HC_Ghuun":
ghuun[value[1].actor] = [value[1].DPS,1.00,value[1].haste,value[1].crit,value[1].mastery,value[1].vers]
else:
if profile == "HC_Taloc":
taloc[value[1].actor] = value[1].DPS
elif profile == "HC_Mother_Early" or profile == "HC_Mother_Late":
if value[1].actor in mother:
mother[value[1].actor] = mother.get(value[1].actor) + (value[1].DPS * .5)
else:
mother[value[1].actor] = (value[1].DPS * .5)
if profile == "HC_FetidDevourer":
fetid[value[1].actor] = value[1].DPS
if profile == "HC_Zekvoz":
zekvoz[value[1].actor] = value[1].DPS
if profile == "HC_Vectis":
vectis[value[1].actor] = value[1].DPS
if profile == "HC_Zul":
zul[value[1].actor] = value[1].DPS
if profile == "HC_Mythrax":
mythrax[value[1].actor] = value[1].DPS
if profile == "HC_Ghuun":
ghuun[value[1].actor] = value[1].DPS

if args.dir == "talents/" or args.dir == "trinkets/":
baseDPS = results.get('Base') / 3
Expand Down Expand Up @@ -156,9 +183,41 @@ def getChange(current, previous):
with open(outputMarkdownRS, 'w') as resultsMD:
# Uldir Raidsimming
if args.weights:
resultsMD.write('# Taloc\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
resultsMD.write('# Composite\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in results.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Taloc\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in taloc.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Mother\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in mother.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Fetid\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in fetid.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Zekvoz\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in zekvoz.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Vectis\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in vectis.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Zul\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in zul.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Mythrax\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in mythrax.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))

resultsMD.write('# Ghuun\n| Actor | DPS | Int | Haste | Crit | Mastery | Vers |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n')
for key, value in ghuun.items():
resultsMD.write("|%s|%.0f|%.2f|%.2f|%.2f|%.2f|%.2f|\n" % (key, value[0], value[1], value[2], value[3], value[4], value[5]))
else:
resultsMD.write('# Composite\n| Actor | DPS | Increase |\n|---|:---:|:---:|\n')
for key, value in sorted(results.iteritems(), key=lambda (k,v): (v,k), reverse=True):
Expand Down
134 changes: 105 additions & 29 deletions apl/profiles.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import reports
import os
import shutil
import argparse

folder = 'results/'
for the_file in os.listdir(folder):
file_path = os.path.join(folder, the_file)
# clear out results
for the_file in os.listdir('results/'):
file_path = os.path.join('results/', the_file)
try:
if os.path.isfile(file_path):
os.unlink(file_path)
except Exception as e:
print(e)

# clear out profiles
for the_file in os.listdir('profiles/'):
file_path = os.path.join('profiles/', the_file)
try:
if os.path.isfile(file_path):
os.unlink(file_path)
except Exception as e:
print(e)

parser = argparse.ArgumentParser(description='Generates sim profiles.')
parser.add_argument('--composite', help='Run a raidsimming batch of sims. Value can be either HH or MM.', choices=['HC','MM'])
args = parser.parse_args()

simc = 'apl.simc'

small_add = 'raid_events+=/adds,count=3,first=45,cooldown=45,duration=10,distance=5'
Expand All @@ -20,35 +34,97 @@
light_movement = 'fight_style="LightMovement"'
heavy_movement = 'fight_style="HeavyMovement"'

# --composite [HC, MM]
if args.composite:
with open("../raidsimming/{0}/{1}_Taloc.simc".format(args.composite,args.composite), 'r') as sim:
taloc = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Mother_Early.simc".format(args.composite,args.composite), 'r') as sim:
mother_early = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Mother_Late.simc".format(args.composite,args.composite), 'r') as sim:
mother_late = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_FetidDevourer.simc".format(args.composite,args.composite), 'r') as sim:
fetid = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Zekvoz.simc".format(args.composite,args.composite), 'r') as sim:
zekvoz = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Vectis.simc".format(args.composite,args.composite), 'r') as sim:
vectis = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Zul.simc".format(args.composite,args.composite), 'r') as sim:
zul = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Mythrax.simc".format(args.composite,args.composite), 'r') as sim:
mythrax = sim.read()
sim.close()
with open("../raidsimming/{0}/{1}_Ghuun.simc".format(args.composite,args.composite), 'r') as sim:
ghuun = sim.read()
sim.close()

with open(simc, 'r') as f:
data = f.read()
f.close()

profiles = []

for value in reports.reports:
profile = value.replace('results', 'profiles')
profile = profile.replace('json', 'simc')
profiles.append(profile)

for value in profiles:
settings = '\n'
if "pw" in value:
settings = settings + patchwerk + "\n"
if "lm" in value:
settings = settings + light_movement + "\n"
if "hm" in value:
settings = settings + heavy_movement + "\n"
if "ba" in value:
settings = settings + big_add + "\n"
if "sa" in value:
settings = settings + small_add + "\n"
if "1" in value:
settings = settings + 'desired_targets="1"' + "\n"
else:
settings = settings + 'desired_targets="2"' + "\n"

with open(value, "w+") as f:
f.writelines(data)
f.writelines(settings)
f.close()
if args.composite:
for value in reports.reportsRS:
profile = value.replace('results/_', 'profiles/%s_' % args.composite)
profile = profile.replace('json', 'simc')
profiles.append(profile)
# create profiles
for value in profiles:
settings = '\n'
if "Taloc" in value:
settings = settings + taloc + "\n"
if "Mother_Early" in value:
settings = settings + mother_early + "\n"
if "Mother_Late" in value:
settings = settings + mother_late + "\n"
if "Fetid" in value:
settings = settings + fetid + "\n"
if "Zekvoz" in value:
settings = settings + zekvoz + "\n"
if "Vectis" in value:
settings = settings + vectis + "\n"
if "Zul" in value:
settings = settings + zul + "\n"
if "Mythrax" in value:
settings = settings + mythrax + "\n"
if "Ghuun" in value:
settings = settings + ghuun + "\n"

with open(value, "w+") as f:
f.writelines(data)
f.writelines(settings)
f.close()
else:
for value in reports.reports:
profile = value.replace('results', 'profiles')
profile = profile.replace('json', 'simc')
profiles.append(profile)
# create profiles
for value in profiles:
settings = '\n'
if "pw" in value:
settings = settings + patchwerk + "\n"
if "lm" in value:
settings = settings + light_movement + "\n"
if "hm" in value:
settings = settings + heavy_movement + "\n"
if "ba" in value:
settings = settings + big_add + "\n"
if "sa" in value:
settings = settings + small_add + "\n"
if "1" in value:
settings = settings + 'desired_targets="1"' + "\n"
else:
settings = settings + 'desired_targets="2"' + "\n"

with open(value, "w+") as f:
f.writelines(data)
f.writelines(settings)
f.close()
12 changes: 12 additions & 0 deletions apl/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@
'results/hm_na_2.json',
'results/hm_sa_2.json',
}

reportsRS = {
'results/_Taloc.json',
'results/_Mother_Early.json',
'results/_Mother_Late.json',
'results/_FetidDevourer.json',
'results/_Zekvoz.json',
'results/_Vectis.json',
'results/_Zul.json',
# 'results/_Mythrax.json',
'results/_Ghuun.json',
}
Loading

0 comments on commit 3760a69

Please sign in to comment.