Upd: Research preset using E2 projects and research_optimizer

This commit is contained in:
LmeSzinc 2022-11-08 22:12:45 +08:00
parent bad2995982
commit e3fdef94bb
4 changed files with 597 additions and 133 deletions

View File

@ -55,8 +55,8 @@ PROJECT_TABLE = """
34 4 Marcopolo-2.5 766.6697864 0 0 0 0 2.25 0.04
35 4 Marcopolo-5 485.7871007 0 0 0 0 3.75 0.06
36 4 Marcopolo-8 200.3313937 0 0 0 0 6 0.096
37 4 EB-2 203.9216684 0 0 0 0 0 0.024
38 4 EP-2 203.9216684 0 0 0 0 0 0.06
37 4 Z-2 203.9216684 0 0 0 0 0 0.024
38 4 A-2 203.9216684 0 0 0 0 0 0.06
39 4 G-1.5 582.001119 0.104 0.104 0.299 0.299 0.299 0.025
40 4 G-2.5 402.5500509 0.135 0.135 0.403333333 0.403333333 0.403333333 0.04
41 4 G-4 305.1449135 0.2585 0.2585 0.723333333 0.723333333 0.723333333 0.12
@ -111,8 +111,8 @@ PROJECT_TABLE = """
90 2 C-6 331.5425296 0 0 0 0 0 0
91 2 C-8 224.3791833 0 0 0 0 0 0
92 2 C-12 170.3707535 0 0 0 0 0 0
93 2 EB-2 222.8618262 0 0 0 0 0 0
94 2 EP-2 222.8618262 0 0 0 0 0 0
93 2 Z-2 222.8618262 0 0 0 0 0 0
94 2 A-2 222.8618262 0 0 0 0 0 0
95 2 G-1.5 636.0571355 0 0 0 0 0 0
96 2 G-2.5 439.9387285 0 0 0 0 0 0
97 2 G-4 333.4866434 0 0 0 0 0 0
@ -167,8 +167,8 @@ PROJECT_TABLE = """
146 3 C-6 328.1807665 0 0 0 0 0 0
147 3 C-8 222.1040313 0 0 0 0 0 0
148 3 C-12 168.6432343 0 0 0 0 0 0
149 3 EB-2 220.6020598 0 0 0 0 0 0
150 3 EP-2 220.6020598 0 0 0 0 0 0
149 3 Z-2 220.6020598 0 0 0 0 0 0
150 3 A-2 220.6020598 0 0 0 0 0 0
151 3 G-1.5 629.6076661 0 0 0 0 0 0
152 3 G-2.5 435.4778534 0 0 0 0 0 0
153 3 G-4 330.1051674 0 0 0 0 0 0
@ -245,8 +245,8 @@ PROJECT_TABLE_S4 = """
34 4 Marcopolo-2.5 766.6697864 0 0 0 0 2.25 0.04
35 4 Marcopolo-5 485.7871007 0 0 0 0 3.75 0.06
36 4 Marcopolo-8 200.3313937 0 0 0 0 6 0.096
37 4 EB-2 647.3855544 0 0 0 0 0 0.024
38 4 EP-2 647.3855544 0 0 0 0 0 0.06
37 4 Z-2 647.3855544 0 0 0 0 0 0.024
38 4 A-2 647.3855544 0 0 0 0 0 0.06
39 4 G-1.5 1847.665921 0.104 0.104 0.299 0.299 0.299 0.025
40 4 G-2.5 1277.966633 0.135 0.135 0.403333333 0.403333333 0.403333333 0.04
41 4 G-4 968.7367243 0.2585 0.2585 0.723333333 0.723333333 0.723333333 0.12
@ -646,7 +646,7 @@ FILTER_REGEX = re.compile('([s\!][1234])?'
'|gascogne|champagne|cheshire|drake|mainz|odin'
'|anchorage|hakuryu|agir|august|marcopolo)?'
'(dr|pry)?'
'([bcdeghqt])?'
'([bcdeghqtaz])?'
'-?'
'(\d.\d|\d\d?)?')
FILTER_ATTR = ('series', 'ship', 'ship_rarity', 'genre', 'duration')
@ -968,6 +968,8 @@ class FilterSimulator:
target = np.array([513, 513, 343, 343, 343, 150])
def __init__(self, string):
string = string.replace('E-315', 'A2')
string = string.replace('E-031', 'Z2')
self.string = string
self.pool = ResearchPool(string)
@ -1007,15 +1009,20 @@ def join_filter(selection):
return ' > '.join(selection)
def beautify_filter(string):
if isinstance(string, str):
string = split_filter(string)
out = ''
for index in range(0, len(string), 8):
row = string[index:index + 8]
out += ' > ' + join_filter(row) + '\n'
out = '\n ' + out.strip('> ')
return out
def beautify_filter(list_filter):
if isinstance(list_filter, str):
list_filter = split_filter(list_filter)
out = []
length = 0
for selection in list_filter:
if length + len(selection) + 3 > 70:
out.append('\n')
length = 0
out.append(selection)
length += len(selection) + 3
string = ' > '.join(out).strip('\n >').replace(' > \n', '\n').replace('\n ', '\n')
return string
def position_change(string, position):
@ -1118,7 +1125,7 @@ class BruteForceOptimizer:
# 切魔方:'B > T > E'
# 只做0.5h魔方:'B > T > E > H1 > H2 > H4'
# 不切魔方:'B > T > E > H'
ResearchPool.remove_projects = 'B > T > E > H1 > H2 > H4'
ResearchPool.remove_projects = 'B > T > H1 > H2 > H4'
# 每日活跃时间,按天计算
# 超出活跃时间后,仍在挂项目,但不再开始新项目
FilterSimulator.active = 24 / 24
@ -1140,7 +1147,7 @@ if __name__ == '__main__':
"""
这个文件包含模拟器和优化器两部分取消注释对应的代码来运行
Alas用户运行需要额外安装numba无指定版本
非Alas用户运行需要python>=3.7安装 numba numpy tqdm, 无指定版本
非Alas用户运行需要python>=3.7安装 numba==0.45.1 llvmlite==0.29.0 numpy tqdm
过滤器与Alas内的过滤器基本相同编写参考 https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/filter_string_cn
但需要注意
@ -1162,23 +1169,27 @@ if __name__ == '__main__':
模拟大量用户使用同一个过滤器的平均毕业时间和毕业时获取物品的平均数量
取消注释这些代码将你的过滤器粘贴至这里并运行在8700k上需要约4.5分钟
"""
simulator = FilterSimulator("""
S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-Q0.5 > S4-DR2.5 > !4-0.5 > S4-G1.5 > S4-Q1
> S4-DR5 > S4-DR8 > S4-G4 > S4-PRY2.5 > !4-1 > S4-Q2 > reset > S4-G2.5
> S4-PRY5 > S4-PRY8 > !4-2 > !4-1.5 > S4-Q4 > !4-2.5 > !4-4 > S4-C6
> S4-C8 > !4-6 > !4-8 > !4-12 > S4-C12
""")
simulator.run(sample_count=100000)
# simulator = FilterSimulator("""
# S4-DR0.5 > S4-PRY0.5 > S4-Q0.5 > S4-H0.5 > Q0.5 > S4-DR2.5
# > S4-G1.5 > S4-Q1 > S4-DR5 > 0.5 > S4-G4 > S4-Q2 > S4-PRY2.5 > reset
# > S4-DR8 > Q1 > 1 > S4-E-315 > S4-G2.5 > G1.5 > 1.5 > S4-E-031
# > S4-Q4 > Q2 > E2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-PRY5
# > S4-PRY8 > Q4 > G4 > 4 > S4-C6 > DR5 > PRY5 > 5 > C6 > 6 > S4-C8
# > S4-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
# """)
# simulator.run(sample_count=300000)
"""
优化一个过滤器尝试调整过滤器选择的顺序找到满足目标条件的消耗时间最短的排列方式
类似于早期机器学习的实现收敛过程中向前尝试移动的距离变短模拟样本量增大
取消注释这些代码并运行在8700k上需要约1-2
已给出一个包含所有选项顺序大体正确的过滤器作为开始不需要修改
"""
# optimizer = BruteForceOptimizer()
# optimizer.optimize("""
# S4-H0.5 > S4-DR0.5 > S4-PRY0.5 > S4-Q0.5 > !4-0.5 > S4-G1.5 > S4-Q1 > S4-DR2.5
# > S4-G4 > S4-Q4 > S4-DR5 > S4-DR8 > S4-Q2 > S4-PRY2.5 > S4-G2.5 > !4-1
# > reset > S4-PRY8 > !4-1.5 > S4-PRY5 > !4-2.5 > !4-2 > !4-4
# > S4-C6 > !4-C8 > S4-C8 > !4-C6 > S4-C12 > !4-C12
# """, diff=1)
optimizer = BruteForceOptimizer()
optimizer.optimize("""
S4-H0.5 > S4-DR0.5 > S4-PRY0.5 > S4-Q0.5 > !4-0.5 > S4-G1.5 > S4-Q1 > S4-DR2.5
> S4-G4 > S4-Q4 > S4-DR5 > S4-DR8 > S4-Q2 > S4-PRY2.5 > S4-G2.5 > !4-1
> S4-H1 > S4-H2 > S4-H4
> S4-EP2 > S4-EB2
> reset > S4-PRY8 > !4-1.5 > S4-PRY5 > !4-2.5 > !4-2 > !4-4
> S4-C6 > !4-C8 > S4-C8 > !4-C6 > S4-C12 > !4-C12
""", diff=1)

View File

@ -0,0 +1,93 @@
import typing as t
class TabWrapper:
def __init__(self, generator, prefix='', suffix=''):
"""
Args:
generator (CodeGenerator):
"""
self.generator = generator
self.prefix = prefix
self.suffix = suffix
def __enter__(self):
if self.prefix:
self.generator.add(self.prefix)
self.generator.tab_count += 1
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.generator.tab_count -= 1
if self.suffix:
self.generator.add(self.suffix)
class CodeGenerator:
def __init__(self):
self.tab_count = 0
self.lines = []
def generate(self) -> t.Iterable[str]:
yield ''
def add(self, line, comment=False, newline=True):
self.lines.append(self._line_with_tabs(line, comment=comment, newline=newline))
def print(self):
lines = ''.join(self.lines)
print(lines)
def write(self, file: str = None):
lines = ''.join(self.lines)
with open(file, 'w', encoding='utf-8', newline='') as f:
f.write(lines)
def _line_with_tabs(self, line, comment=False, newline=True):
if comment:
line = '# ' + line
out = ' ' * self.tab_count + line
if newline:
out += '\n'
return out
def _repr(self, obj):
if isinstance(obj, str) and '\n' in obj:
out = '"""\n'
with self.tab():
for line in obj.strip().split('\n'):
line = line.strip()
out += self._line_with_tabs(line)
out += self._line_with_tabs('"""', newline=False)
return out
return repr(obj)
def tab(self):
return TabWrapper(self)
def Value(self, key=None, value=None, **kwargs):
if key is not None:
self.add(f'{key} = {self._repr(value)}')
for key, value in kwargs.items():
self.Value(key, value)
def Comment(self, text):
for line in text.strip().split('\n'):
line = line.strip()
self.add(line, comment=True)
def Dict(self, key):
return TabWrapper(self, prefix=str(key) + ' = {', suffix='}')
def DictItem(self, key=None, value=None, **kwargs):
if key is not None:
self.add(f'{self._repr(key)}: {self._repr(value)},')
for key, value in kwargs.items():
self.DictItem(key, value)
generator = CodeGenerator()
Value = generator.Value
Comment = generator.Comment
Dict = generator.Dict
DictItem = generator.DictItem

View File

@ -1,111 +1,276 @@
FILTER_STRING_SHORTEST = '0.5 > 1 > 1.5 > 2 > 2.5 > 3 > 4 > 5 > 6 > 8 > 10 > 12'
FILTER_STRING_CHEAPEST = 'Q1 > Q2 > T3 > T4 > Q4 > C6 > T6 > C8 > C12 > G1.5 > D2.5 > G2.5 > D5 > Q0.5 > G4 > D8 > H1 > H2 > H0.5 > D0.5 > H4'
DICT_FILTER_PRESET = {
'series_5_blueprint_152_cube': """
S5-Q0.5 > S5-DR0.5 > S5-PRY0.5 > S5-H0.5 > S5-DR2.5 > 0.5 > S5-Q1
> S5-H1 > S5-Q2 > reset > S5-Q4 > S5-G1.5 > Q1 > 1 > S5-H2 > S5-G4
> 1.5 > S5-G2.5 > S5-PRY2.5 > 2.5 > S5-DR5 > Q2 > 2 > 3
> S5-H4 > S5-DR8 > S5-PRY5 > Q4 > G4 > 4 > 5 > S5-PRY8
> S5-C6 > C6 > 6 > S5-C8 > 8 > S5-C12 > 12""",
'series_5_blueprint_152': """
S5-DR0.5 > S5-PRY0.5 > S5-H0.5 > S5-Q0.5 > S5-DR2.5 > 0.5 > S5-G1.5
> S5-Q1 > S5-DR5 > S5-DR8 > S5-G4 > S5-PRY2.5 > 1 > S5-Q2 > reset
> S5-G2.5 > S5-PRY5 > S5-PRY8 > 1.5 > 2 > S5-Q4 > 2.5 > 3
> Q4 > G4 > 4 > 5 > S5-C6 > C6 > 6 > S5-C8 > 8
> S5-C12 > 12""",
'series_5_blueprint_only_cube': """
S5-DR0.5 > S5-H0.5 > S5-PRY0.5 > S5-H1 > S5-H2 > S5-DR2.5 > S5-Q0.5
> 0.5 > S5-DR5 > reset > S5-DR8 > S5-H4 > S5-Q1 > Q1 > 1 > S5-G1.5
> 1.5 > S5-Q2 > Q2 > 2 > S5-G2.5 > S5-PRY2.5 > 2.5 > 3
> S5-Q4 > S5-G4 > Q4 > G4 > 4 > S5-PRY5 > 5 > S5-PRY8 > S5-C6
> C6 > 6 > S5-C8 > 8 > S5-C12 > 12""",
'series_5_blueprint_only': """
S5-DR0.5 > S5-PRY0.5 > S5-H0.5 > S5-DR8 > S5-DR2.5 > S5-DR5 > S5-G1.5
> S5-PRY2.5 > S5-Q0.5 > 0.5 > S5-G2.5 > S5-Q1 > 1 > reset > S5-G4
> S5-PRY5 > 1.5 > S5-Q2 > 2 > S5-PRY8 > 2.5 > 3 > S5-Q4
> Q4 > G4 > 4 > 5 > S5-C6 > C6 > 6 > S5-C8 > 8
> S5-C12 > 12""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 153.41706666666678
# Average rewards: [238.69016631 238.37881965 529.71190834 528.92520834 528.39586667 150.07973333]
'series_5_152_only_cube': """
S5-Q0.5 > S5-DR0.5 > S5-PRY0.5 > S5-Q1 > S5-Q4 > S5-Q2 > S5-H0.5 > 0.5
> S5-G4 > S5-G1.5 > Q1 > S5-H1 > 1 > reset > S5-DR2.5 > S5-PRY2.5
> S5-G2.5 > 1.5 > Q2 > S5-H2 > 2 > 2.5 > 3 > S5-DR5 > S5-PRY5
> Q4 > G4 > S5-H4 > H4 > 4 > 5 > S5-DR8 > S5-PRY8 > S5-C6
> C6 > S5-C8 > 8 > S5-C12 > 12""",
S5-Q0.5 > S5-DR0.5 > S5-PRY0.5 > Q0.5 > S5-Q4 > S5-Q2 > S5-Q1 > 0.5
> S5-E-315 > S5-G1.5 > S5-G4 > Q1 > reset > S5-H1 > H1 > 1 > S5-E-031
> S5-DR2.5 > S5-PRY2.5 > S5-G2.5 > G1.5 > 1.5 > Q2 > E2 > S5-H2 > H2
> 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S5-DR5 > S5-PRY5 > Q4 > G4
> S5-H4 > H4 > 4 > S5-C6 > DR5 > PRY5 > 5 > S5-DR8 > S5-PRY8 > S5-C8
> C6 > 6 > S5-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 161.37177965277806
# Average rewards: [241.92774575 241.13046242 421.82134358 421.04494941 420.46893024 150.07799978]
'series_5_152_only': """
S5-Q0.5 > S5-DR0.5 > S5-PRY0.5 > S5-Q4 > S5-Q1 > S5-Q2 > S5-H0.5 > 0.5
> S5-G4 > S5-G1.5 > Q1 > 1 > S5-DR2.5 > S5-PRY2.5 > reset > S5-G2.5 > 1.5
> Q2 > 2 > 2.5 > 3 > S5-DR5 > S5-PRY5 > Q4 > G4
> 4 > 5 > S5-C6 > S5-DR8 > S5-PRY8 > S5-C8 > C6 > 6 > 8
> S5-C12 > 12""",
'series_4_blueprint_tenrai_cube': """
S4-Q0.5 > S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-DR2.5 > 0.5 > S4-Q1
> S4-H1 > S4-Q2 > reset > S4-Q4 > S4-G1.5 > Q1 > 1 > S4-H2 > S4-G4
> 1.5 > S4-G2.5 > S4-PRY2.5 > 2.5 > S4-DR5 > Q2 > 2 > 3
> S4-H4 > S4-DR8 > S4-PRY5 > Q4 > G4 > 4 > 5 > S4-PRY8
> S4-C6 > C6 > 6 > S4-C8 > 8 > S4-C12 > 12""",
'series_4_blueprint_tenrai': """
S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-Q0.5 > S4-DR2.5 > 0.5 > S4-G1.5
> S4-Q1 > S4-DR5 > S4-DR8 > S4-G4 > S4-PRY2.5 > 1 > S4-Q2 > reset
> S4-G2.5 > S4-PRY5 > S4-PRY8 > 1.5 > 2 > S4-Q4 > 2.5 > 3
> Q4 > G4 > 4 > 5 > S4-C6 > C6 > 6 > S4-C8 > 8
> S4-C12 > 12""",
'series_4_blueprint_only_cube': """
S4-DR0.5 > S4-H0.5 > S4-PRY0.5 > S4-H1 > S4-H2 > S4-DR2.5 > S4-Q0.5
> 0.5 > S4-DR5 > reset > S4-DR8 > S4-H4 > S4-Q1 > Q1 > 1 > S4-G1.5
> 1.5 > S4-Q2 > Q2 > 2 > S4-G2.5 > S4-PRY2.5 > 2.5 > 3
> S4-Q4 > S4-G4 > Q4 > G4 > 4 > S4-PRY5 > 5 > S4-PRY8 > S4-C6
> C6 > 6 > S4-C8 > 8 > S4-C12 > 12""",
'series_4_blueprint_only': """
S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-DR8 > S4-DR2.5 > S4-DR5 > S4-G1.5
> S4-PRY2.5 > S4-Q0.5 > 0.5 > S4-G2.5 > S4-Q1 > 1 > reset > S4-G4
> S4-PRY5 > 1.5 > S4-Q2 > 2 > S4-PRY8 > 2.5 > 3 > S4-Q4
> Q4 > G4 > 4 > 5 > S4-C6 > C6 > 6 > S4-C8 > 8
> S4-C12 > 12""",
S5-Q0.5 > S5-PRY0.5 > S5-DR0.5 > Q0.5 > S5-Q4 > S5-Q2 > S5-Q1 > 0.5
> S5-E-315 > S5-G4 > S5-G1.5 > Q1 > 1 > S5-E-031 > S5-DR2.5 > reset
> S5-G2.5 > S5-PRY2.5 > G1.5 > 1.5 > Q2 > E2 > 2 > DR2.5 > PRY2.5
> G2.5 > 2.5 > S5-DR5 > S5-PRY5 > Q4 > G4 > 4 > S5-C6 > DR5 > PRY5
> 5 > S5-DR8 > S5-PRY8 > S5-C8 > C6 > 6 > DR8 > PRY8 > C8 > 8
> S5-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 124.67622465277958
# Average rewards: [531.93022864 529.81919864 510.27473326 510.18530159 510.11215826 100.8088164]
'series_5_blueprint_152_cube': """
S5-DR0.5 > S5-Q0.5 > S5-PRY0.5 > 0.5 > S5-DR2.5 > S5-Q1 > S5-Q2
> S5-H1 > S5-E-315 > S5-G1.5 > reset > S5-Q4 > S5-G4 > S5-H2 > Q1
> H1 > 1 > S5-G2.5 > S5-DR5 > S5-PRY2.5 > G1.5 > 1.5 > S5-E-031
> S5-DR8 > Q2 > E2 > H2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S5-H4
> S5-PRY5 > Q4 > G4 > H4 > 4 > S5-C6 > S5-PRY8 > DR5 > PRY5 > 5 > C6
> 6 > S5-C8 > DR8 > PRY8 > C8 > 8 > S5-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 143.56399131945145
# Average rewards: [520.06195858 519.19883191 392.86544828 392.64870495 392.49383995 102.2368499]
'series_5_blueprint_152': """
S5-DR0.5 > S5-PRY0.5 > S5-Q0.5 > S5-H0.5 > Q0.5 > S5-DR2.5
> S5-G1.5 > S5-Q1 > S5-DR5 > 0.5 > S5-G4 > S5-Q2 > S5-PRY2.5 > reset
> S5-DR8 > Q1 > 1 > S5-E-315 > S5-G2.5 > G1.5 > 1.5 > S5-E-031
> S5-Q4 > Q2 > E2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S5-PRY5
> S5-PRY8 > Q4 > G4 > 4 > S5-C6 > DR5 > PRY5 > 5 > C6 > 6 > S5-C8
> S5-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 82.0121088194467
# Average rewards: [519.0311752 514.64003687 653.77171198 653.72126532 653.66129615 26.97694791]
'series_5_blueprint_only_cube': """
S5-DR0.5 > S5-PRY0.5 > S5-H0.5 > S5-H1 > S5-H2 > S5-DR2.5 > S5-DR5
> 0.5 > S5-DR8 > reset > S5-H4 > S5-Q1 > Q1 > H1 > 1 > S5-G1.5 > G1.5
> 1.5 > S5-G2.5 > S5-Q2 > S5-E-315 > S5-E-031 > Q2 > E2 > H2 > 2
> S5-PRY2.5 > S5-G4 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S5-Q4 > Q4 > G4
> H4 > 4 > S5-PRY5 > S5-PRY8 > S5-C6 > DR5 > PRY5 > 5 > C6 > 6
> S5-C8 > S5-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 124.71616166666873
# Average rewards: [514.96354877 514.70099977 355.58865468 354.96831385 354.66888635 56.48432238]
'series_5_blueprint_only': """
S5-DR0.5 > S5-H0.5 > S5-PRY0.5 > S5-DR8 > S5-DR5 > S5-DR2.5
> S5-G1.5 > S5-PRY2.5 > 0.5 > S5-G2.5 > S5-G4 > reset > S5-Q1 > Q1
> 1 > S5-PRY5 > G1.5 > 1.5 > S5-Q2 > S5-E-031 > S5-E-315 > Q2 > E2
> 2 > S5-PRY8 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S5-Q4 > Q4 > G4 > 4
> S5-C6 > DR5 > PRY5 > 5 > C6 > 6 > S5-C8 > DR8 > PRY8 > C8 > 8
> S5-C12 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 153.41706666666678
# Average rewards: [238.69016631 238.37881965 529.71190834 528.92520834 528.39586667 150.07973333]
'series_4_tenrai_only_cube': """
S4-Q0.5 > S4-DR0.5 > S4-PRY0.5 > S4-Q1 > S4-Q4 > S4-Q2 > S4-H0.5 > 0.5
> S4-G4 > S4-G1.5 > Q1 > S4-H1 > 1 > reset > S4-DR2.5 > S4-PRY2.5
> S4-G2.5 > 1.5 > Q2 > S4-H2 > 2 > 2.5 > 3 > S4-DR5 > S4-PRY5
> Q4 > G4 > S4-H4 > H4 > 4 > 5 > S4-DR8 > S4-PRY8 > S4-C6
> C6 > S4-C8 > 8 > S4-C12 > 12""",
S4-Q0.5 > S4-DR0.5 > S4-PRY0.5 > Q0.5 > S4-Q4 > S4-Q2 > S4-Q1 > 0.5
> S4-E-315 > S4-G1.5 > S4-G4 > Q1 > reset > S4-H1 > H1 > 1 > S4-E-031
> S4-DR2.5 > S4-PRY2.5 > S4-G2.5 > G1.5 > 1.5 > Q2 > E2 > S4-H2 > H2
> 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-DR5 > S4-PRY5 > Q4 > G4
> S4-H4 > H4 > 4 > S4-C6 > DR5 > PRY5 > 5 > S4-DR8 > S4-PRY8 > S4-C8
> C6 > 6 > S4-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 161.37177965277806
# Average rewards: [241.92774575 241.13046242 421.82134358 421.04494941 420.46893024 150.07799978]
'series_4_tenrai_only': """
S4-Q0.5 > S4-DR0.5 > S4-PRY0.5 > S4-Q4 > S4-Q1 > S4-Q2 > S4-H0.5 > 0.5
> S4-G4 > S4-G1.5 > Q1 > 1 > S4-DR2.5 > S4-PRY2.5 > reset > S4-G2.5 > 1.5
> Q2 > 2 > 2.5 > 3 > S4-DR5 > S4-PRY5 > Q4 > G4
> 4 > 5 > S4-C6 > S4-DR8 > S4-PRY8 > S4-C8 > C6 > 6 > 8
> S4-C12 > 12""",
'series_2_than_3_457_234': """
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > S2-Q4 > S2-Q1 > S2-Q2 > S2-H0.5 > 0.5
> S3-Q1 > S3-Q2 > S2-G4 > S3-Q4 > S2-G1.5 > S2-DR2.5 > reset > Q1 > S2-PRY2.5 > S2-G2.5 > H1 > 1.5
> Q2 > 2.5 > S2-DR5 > S2-PRY5 > Q4 > G4 > 5 > H2 > S2-C6 > S2-DR8 > S2-PRY8 > S2-C8
> 6 > 8 > 4 > S2-C12 > 12""",
S4-Q0.5 > S4-PRY0.5 > S4-DR0.5 > Q0.5 > S4-Q4 > S4-Q2 > S4-Q1 > 0.5
> S4-E-315 > S4-G4 > S4-G1.5 > Q1 > 1 > S4-E-031 > S4-DR2.5 > reset
> S4-G2.5 > S4-PRY2.5 > G1.5 > 1.5 > Q2 > E2 > 2 > DR2.5 > PRY2.5
> G2.5 > 2.5 > S4-DR5 > S4-PRY5 > Q4 > G4 > 4 > S4-C6 > DR5 > PRY5
> 5 > S4-DR8 > S4-PRY8 > S4-C8 > C6 > 6 > DR8 > PRY8 > C8 > 8
> S4-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 124.67622465277958
# Average rewards: [531.93022864 529.81919864 510.27473326 510.18530159 510.11215826 100.8088164]
'series_4_blueprint_tenrai_cube': """
S4-DR0.5 > S4-Q0.5 > S4-PRY0.5 > 0.5 > S4-DR2.5 > S4-Q1 > S4-Q2
> S4-H1 > S4-E-315 > S4-G1.5 > reset > S4-Q4 > S4-G4 > S4-H2 > Q1
> H1 > 1 > S4-G2.5 > S4-DR5 > S4-PRY2.5 > G1.5 > 1.5 > S4-E-031
> S4-DR8 > Q2 > E2 > H2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-H4
> S4-PRY5 > Q4 > G4 > H4 > 4 > S4-C6 > S4-PRY8 > DR5 > PRY5 > 5 > C6
> 6 > S4-C8 > DR8 > PRY8 > C8 > 8 > S4-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 143.56399131945145
# Average rewards: [520.06195858 519.19883191 392.86544828 392.64870495 392.49383995 102.2368499]
'series_4_blueprint_tenrai': """
S4-DR0.5 > S4-PRY0.5 > S4-Q0.5 > S4-H0.5 > Q0.5 > S4-DR2.5
> S4-G1.5 > S4-Q1 > S4-DR5 > 0.5 > S4-G4 > S4-Q2 > S4-PRY2.5 > reset
> S4-DR8 > Q1 > 1 > S4-E-315 > S4-G2.5 > G1.5 > 1.5 > S4-E-031
> S4-Q4 > Q2 > E2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-PRY5
> S4-PRY8 > Q4 > G4 > 4 > S4-C6 > DR5 > PRY5 > 5 > C6 > 6 > S4-C8
> S4-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 82.0121088194467
# Average rewards: [519.0311752 514.64003687 653.77171198 653.72126532 653.66129615 26.97694791]
'series_4_blueprint_only_cube': """
S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-H1 > S4-H2 > S4-DR2.5 > S4-DR5
> 0.5 > S4-DR8 > reset > S4-H4 > S4-Q1 > Q1 > H1 > 1 > S4-G1.5 > G1.5
> 1.5 > S4-G2.5 > S4-Q2 > S4-E-315 > S4-E-031 > Q2 > E2 > H2 > 2
> S4-PRY2.5 > S4-G4 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-Q4 > Q4 > G4
> H4 > 4 > S4-PRY5 > S4-PRY8 > S4-C6 > DR5 > PRY5 > 5 > C6 > 6
> S4-C8 > S4-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 124.71616166666873
# Average rewards: [514.96354877 514.70099977 355.58865468 354.96831385 354.66888635 56.48432238]
'series_4_blueprint_only': """
S4-DR0.5 > S4-H0.5 > S4-PRY0.5 > S4-DR8 > S4-DR5 > S4-DR2.5
> S4-G1.5 > S4-PRY2.5 > 0.5 > S4-G2.5 > S4-G4 > reset > S4-Q1 > Q1
> 1 > S4-PRY5 > G1.5 > 1.5 > S4-Q2 > S4-E-031 > S4-E-315 > Q2 > E2
> 2 > S4-PRY8 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S4-Q4 > Q4 > G4 > 4
> S4-C6 > DR5 > PRY5 > 5 > C6 > 6 > S4-C8 > DR8 > PRY8 > C8 > 8
> S4-C12 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 153.41706666666678
# Average rewards: [238.69016631 238.37881965 529.71190834 528.92520834 528.39586667 150.07973333]
'series_3_234_only_cube': """
S3-Q0.5 > S3-DR0.5 > S3-PRY0.5 > Q0.5 > S3-Q4 > S3-Q2 > S3-Q1 > 0.5
> S3-E-315 > S3-G1.5 > S3-G4 > Q1 > reset > S3-H1 > H1 > 1 > S3-E-031
> S3-DR2.5 > S3-PRY2.5 > S3-G2.5 > G1.5 > 1.5 > Q2 > E2 > S3-H2 > H2
> 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S3-DR5 > S3-PRY5 > Q4 > G4
> S3-H4 > H4 > 4 > S3-C6 > DR5 > PRY5 > 5 > S3-DR8 > S3-PRY8 > S3-C8
> C6 > 6 > S3-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 161.37177965277806
# Average rewards: [241.92774575 241.13046242 421.82134358 421.04494941 420.46893024 150.07799978]
'series_3_234_only': """
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > S3-Q4 > S3-Q1 > S3-Q2 > S2-H0.5 > 0.5
> S3-G4 > S3-G1.5 > S3-DR2.5 > reset > Q1 > S3-PRY2.5 > S3-G2.5 > H1 > 1.5
> Q2 > 2.5 > S3-DR5 > S3-PRY5 > Q4 > G4 > 5 > H2 > S2-C6 > S3-DR8 > S3-PRY8 > S3-C8
> 6 > 8 > 4 > S3-C12 > 12""",
S3-Q0.5 > S3-PRY0.5 > S3-DR0.5 > Q0.5 > S3-Q4 > S3-Q2 > S3-Q1 > 0.5
> S3-E-315 > S3-G4 > S3-G1.5 > Q1 > 1 > S3-E-031 > S3-DR2.5 > reset
> S3-G2.5 > S3-PRY2.5 > G1.5 > 1.5 > Q2 > E2 > 2 > DR2.5 > PRY2.5
> G2.5 > 2.5 > S3-DR5 > S3-PRY5 > Q4 > G4 > 4 > S3-C6 > DR5 > PRY5
> 5 > S3-DR8 > S3-PRY8 > S3-C8 > C6 > 6 > DR8 > PRY8 > C8 > 8
> S3-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 124.67622465277958
# Average rewards: [531.93022864 529.81919864 510.27473326 510.18530159 510.11215826 100.8088164]
'series_3_blueprint_234_cube': """
S3-DR0.5 > S3-Q0.5 > S3-PRY0.5 > 0.5 > S3-DR2.5 > S3-Q1 > S3-Q2
> S3-H1 > S3-E-315 > S3-G1.5 > reset > S3-Q4 > S3-G4 > S3-H2 > Q1
> H1 > 1 > S3-G2.5 > S3-DR5 > S3-PRY2.5 > G1.5 > 1.5 > S3-E-031
> S3-DR8 > Q2 > E2 > H2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S3-H4
> S3-PRY5 > Q4 > G4 > H4 > 4 > S3-C6 > S3-PRY8 > DR5 > PRY5 > 5 > C6
> 6 > S3-C8 > DR8 > PRY8 > C8 > 8 > S3-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 143.56399131945145
# Average rewards: [520.06195858 519.19883191 392.86544828 392.64870495 392.49383995 102.2368499]
'series_3_blueprint_234': """
S3-Q0.5 > S3-DR0.5 > S3-PRY0.5 > S3-H0.5 > S3-DR2.5 > 0.5 > S3-G1.5
> S3-Q1 > S3-G4 > S3-DR5 > S3-DR8 > S3-PRY2.5 > 1 > S3-Q2 > reset
> S3-G2.5 > S3-PRY5 > S3-PRY8 > 1.5 > 2 > S3-Q4 > 2.5 > 4 > 5 > S3-C6
> S3-C8 > 6 > 8 > S3-C12 > 12""",
'series_2_blueprint_457': """
S2-Q0.5 > S2-DR0.5 > S2-PRY0.5 > S2-H0.5 > S2-DR2.5 > 0.5 > S2-G1.5
> S2-Q1 > S2-G4 > S2-DR5 > S2-DR8 > S2-PRY2.5 > 1 > S2-Q2 > reset
> S2-G2.5 > S2-PRY5 > S2-PRY8 > 1.5 > 2 > S2-Q4 > 2.5 > 4 > 5 > S2-C6
> S2-C8 > 6 > 8 > S2-C12 > 12""",
S3-DR0.5 > S3-PRY0.5 > S3-Q0.5 > S3-H0.5 > Q0.5 > S3-DR2.5
> S3-G1.5 > S3-Q1 > S3-DR5 > 0.5 > S3-G4 > S3-Q2 > S3-PRY2.5 > reset
> S3-DR8 > Q1 > 1 > S3-E-315 > S3-G2.5 > G1.5 > 1.5 > S3-E-031
> S3-Q4 > Q2 > E2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S3-PRY5
> S3-PRY8 > Q4 > G4 > 4 > S3-C6 > DR5 > PRY5 > 5 > C6 > 6 > S3-C8
> S3-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 82.0121088194467
# Average rewards: [519.0311752 514.64003687 653.77171198 653.72126532 653.66129615 26.97694791]
'series_3_blueprint_only_cube': """
S3-DR0.5 > S3-PRY0.5 > S3-H0.5 > S3-H1 > S3-H2 > S3-DR2.5 > S3-DR5
> 0.5 > S3-DR8 > reset > S3-H4 > S3-Q1 > Q1 > H1 > 1 > S3-G1.5 > G1.5
> 1.5 > S3-G2.5 > S3-Q2 > S3-E-315 > S3-E-031 > Q2 > E2 > H2 > 2
> S3-PRY2.5 > S3-G4 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S3-Q4 > Q4 > G4
> H4 > 4 > S3-PRY5 > S3-PRY8 > S3-C6 > DR5 > PRY5 > 5 > C6 > 6
> S3-C8 > S3-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 124.71616166666873
# Average rewards: [514.96354877 514.70099977 355.58865468 354.96831385 354.66888635 56.48432238]
'series_3_blueprint_only': """
S3-DR0.5 > S3-PRY0.5 > S3-H0.5 > S3-Q0.5 > S3-DR2.5 > S3-G4 > S3-G1.5
> S3-PRY2.5 > 0.5 > S3-G2.5 > S3-Q1 > 1 > reset > S3-DR5 > S3-DR8
> S3-PRY5 > 1.5 > S3-Q2 > 2 > S3-PRY8 > 2.5 > S3-Q4 > 4 > 5 > S3-C6
> 6 > S3-C8 > 8 > S3-C12 > 12""",
'series_2_blueprint_only': """
S2-DR0.5 > S2-PRY0.5 > S2-H0.5 > S2-Q0.5 > S2-DR2.5 > S2-G4 > S2-G1.5
> S2-PRY2.5 > 0.5 > S2-G2.5 > S2-Q1 > 1 > reset > S2-DR5 > S2-DR8
> S2-PRY5 > 1.5 > S2-Q2 > 2 > S2-PRY8 > 2.5 > S2-Q4 > 4 > 5 > S2-C6
> 6 > S2-C8 > 8 > S2-C12 > 12""",
S3-DR0.5 > S3-H0.5 > S3-PRY0.5 > S3-DR8 > S3-DR5 > S3-DR2.5
> S3-G1.5 > S3-PRY2.5 > 0.5 > S3-G2.5 > S3-G4 > reset > S3-Q1 > Q1
> 1 > S3-PRY5 > G1.5 > 1.5 > S3-Q2 > S3-E-031 > S3-E-315 > Q2 > E2
> 2 > S3-PRY8 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S3-Q4 > Q4 > G4 > 4
> S3-C6 > DR5 > PRY5 > 5 > C6 > 6 > S3-C8 > DR8 > PRY8 > C8 > 8
> S3-C12 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 153.41706666666678
# Average rewards: [238.69016631 238.37881965 529.71190834 528.92520834 528.39586667 150.07973333]
'series_2_457_only_cube': """
S2-Q0.5 > S2-DR0.5 > S2-PRY0.5 > Q0.5 > S2-Q4 > S2-Q2 > S2-Q1 > 0.5
> S2-E-315 > S2-G1.5 > S2-G4 > Q1 > reset > S2-H1 > H1 > 1 > S2-E-031
> S2-DR2.5 > S2-PRY2.5 > S2-G2.5 > G1.5 > 1.5 > Q2 > E2 > S2-H2 > H2
> 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S2-DR5 > S2-PRY5 > Q4 > G4
> S2-H4 > H4 > 4 > S2-C6 > DR5 > PRY5 > 5 > S2-DR8 > S2-PRY8 > S2-C8
> C6 > 6 > S2-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
# Average time cost: 161.37177965277806
# Average rewards: [241.92774575 241.13046242 421.82134358 421.04494941 420.46893024 150.07799978]
'series_2_457_only': """
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > S2-Q4 > S2-Q1 > S2-Q2 > S2-H0.5 > 0.5
> Q1 > S2-G4 > S2-G1.5 > S2-DR2.5 > reset > S2-PRY2.5 > S2-G2.5 > H1 > 1.5
> Q2 > 2.5 > S2-DR5 > S2-PRY5 > Q4 > G4 > 5 > H2 > S2-C6 > S2-DR8 > S2-PRY8 > S2-C8
> 6 > 8 > 4 > S2-C12 > 12"""
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > Q0.5 > S2-Q4 > S2-Q2 > S2-Q1 > 0.5
> S2-E-315 > S2-G4 > S2-G1.5 > Q1 > 1 > S2-E-031 > S2-DR2.5 > reset
> S2-G2.5 > S2-PRY2.5 > G1.5 > 1.5 > Q2 > E2 > 2 > DR2.5 > PRY2.5
> G2.5 > 2.5 > S2-DR5 > S2-PRY5 > Q4 > G4 > 4 > S2-C6 > DR5 > PRY5
> 5 > S2-DR8 > S2-PRY8 > S2-C8 > C6 > 6 > DR8 > PRY8 > C8 > 8
> S2-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 124.67622465277958
# Average rewards: [531.93022864 529.81919864 510.27473326 510.18530159 510.11215826 100.8088164]
'series_2_blueprint_457_cube': """
S2-DR0.5 > S2-Q0.5 > S2-PRY0.5 > 0.5 > S2-DR2.5 > S2-Q1 > S2-Q2
> S2-H1 > S2-E-315 > S2-G1.5 > reset > S2-Q4 > S2-G4 > S2-H2 > Q1
> H1 > 1 > S2-G2.5 > S2-DR5 > S2-PRY2.5 > G1.5 > 1.5 > S2-E-031
> S2-DR8 > Q2 > E2 > H2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S2-H4
> S2-PRY5 > Q4 > G4 > H4 > 4 > S2-C6 > S2-PRY8 > DR5 > PRY5 > 5 > C6
> 6 > S2-C8 > DR8 > PRY8 > C8 > 8 > S2-C12 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
# Average time cost: 143.56399131945145
# Average rewards: [520.06195858 519.19883191 392.86544828 392.64870495 392.49383995 102.2368499]
'series_2_blueprint_457': """
S2-DR0.5 > S2-PRY0.5 > S2-Q0.5 > S2-H0.5 > Q0.5 > S2-DR2.5
> S2-G1.5 > S2-Q1 > S2-DR5 > 0.5 > S2-G4 > S2-Q2 > S2-PRY2.5 > reset
> S2-DR8 > Q1 > 1 > S2-E-315 > S2-G2.5 > G1.5 > 1.5 > S2-E-031
> S2-Q4 > Q2 > E2 > 2 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S2-PRY5
> S2-PRY8 > Q4 > G4 > 4 > S2-C6 > DR5 > PRY5 > 5 > C6 > 6 > S2-C8
> S2-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 82.0121088194467
# Average rewards: [519.0311752 514.64003687 653.77171198 653.72126532 653.66129615 26.97694791]
'series_2_blueprint_only_cube': """
S2-DR0.5 > S2-PRY0.5 > S2-H0.5 > S2-H1 > S2-H2 > S2-DR2.5 > S2-DR5
> 0.5 > S2-DR8 > reset > S2-H4 > S2-Q1 > Q1 > H1 > 1 > S2-G1.5 > G1.5
> 1.5 > S2-G2.5 > S2-Q2 > S2-E-315 > S2-E-031 > Q2 > E2 > H2 > 2
> S2-PRY2.5 > S2-G4 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S2-Q4 > Q4 > G4
> H4 > 4 > S2-PRY5 > S2-PRY8 > S2-C6 > DR5 > PRY5 > 5 > C6 > 6
> S2-C8 > S2-C12 > DR8 > PRY8 > C8 > 8 > C12 > 12
""",
# Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
# Average time cost: 124.71616166666873
# Average rewards: [514.96354877 514.70099977 355.58865468 354.96831385 354.66888635 56.48432238]
'series_2_blueprint_only': """
S2-DR0.5 > S2-H0.5 > S2-PRY0.5 > S2-DR8 > S2-DR5 > S2-DR2.5
> S2-G1.5 > S2-PRY2.5 > 0.5 > S2-G2.5 > S2-G4 > reset > S2-Q1 > Q1
> 1 > S2-PRY5 > G1.5 > 1.5 > S2-Q2 > S2-E-031 > S2-E-315 > Q2 > E2
> 2 > S2-PRY8 > DR2.5 > PRY2.5 > G2.5 > 2.5 > S2-Q4 > Q4 > G4 > 4
> S2-C6 > DR5 > PRY5 > 5 > C6 > 6 > S2-C8 > DR8 > PRY8 > C8 > 8
> S2-C12 > C12 > 12
""",
# Old community filters
'series_2_than_3_457_234': """
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > S2-Q4 > S2-Q1 > S2-Q2 > S2-H0.5
> 0.5 > S3-Q1 > S3-Q2 > S2-G4 > S3-Q4 > S2-G1.5 > S2-DR2.5 > reset
> Q1 > S2-PRY2.5 > S2-G2.5 > H1 > 1.5 > Q2 > 2.5 > S2-DR5 > S2-PRY5
> Q4 > G4 > 5 > H2 > S2-C6 > S2-DR8 > S2-PRY8 > S2-C8 > 6 > 8 > 4
> S2-C12 > 12
""",
}

View File

@ -0,0 +1,195 @@
import re
def split_filter(string):
if isinstance(string, list):
return string
return [f.strip(' \t\r\n') for f in string.split('>')]
def join_filter(selection):
if isinstance(selection, str):
return selection
return ' > '.join(selection)
def beautify_filter(list_filter):
if isinstance(list_filter, str):
list_filter = split_filter(list_filter)
out = []
length = 0
for selection in list_filter:
if length + len(selection) + 3 > 70:
out.append('\n')
length = 0
out.append(selection)
length += len(selection) + 3
string = ' > '.join(out).strip('\n >').replace(' > \n', '\n').replace('\n ', '\n')
return string
def translate(string: str, target='series_4_tenrai_only_cube', for_simulate=False):
res = re.search(r'series_?(\d)', target)
if res:
series = res.group(1)
else:
print(f'Translate target from unknown series: {target}')
return
cube = 'cube' in target
string = string.replace('S4-H0.5 > !4-0.5', '0.5')
string = string.replace('!4-0.5', '0.5')
# Add Q0.5 after the last 0.5 selection
selections = split_filter(string)
last_05 = 0
for index, sele in enumerate(selections):
if sele == '0.5':
break
if '0.5' in sele:
last_05 = index
if last_05:
selections.insert(last_05 + 1, 'Q0.5')
string = join_filter(selections)
string = string.replace('S4-Q0.5 > Q0.5 > 0.5', '0.5')
string = string.replace('Q0.5 > 0.5', '0.5')
string = string.replace('!4-1.5', 'G1.5 > 1.5')
string = string.replace('!4-1', 'Q1 > H1 > 1')
string = string.replace('!4-2.5', 'DR2.5 > PRY2.5 > G2.5 > 2.5')
string = string.replace('!4-2', 'Q2 > E2 > H2 > 2')
string = string.replace('!4-4', 'Q4 > G4 > H4 > 4')
string = string.replace('!4-5', 'DR5 > PRY5 > 5')
string = string.replace('!4-C6', 'C6 > 6')
string = string.replace('!4-C8', 'DR8 > PRY8 > C8 > 8')
string = string.replace('!4-C12', 'C12 > 12')
if not for_simulate:
string = string.replace('A2', 'E-315')
string = string.replace('Z2', 'E-031')
if not cube:
string = re.sub(r'(S4-)?H[124] > ', '', string)
string = string.replace('H1 > 1 > reset > S4-H1', 'reset > S4-H1 > H1 > 1')
string = string.replace('H1 > 1 > S4-H1', 'S4-H1 > H1 > 1')
string = string.replace('H2 > 2 > S4-H2', 'S4-H2 > H2 > 2')
string = string.replace('H4 > 4 > S4-H4', 'S4-H4 > H4 > 4')
string = re.sub(r'S4', f'S{series}', string)
return beautify_filter(string)
def convert_name(name, series):
name = re.sub(r'series_\d', f'series_{series}', name)
if 'series_5' in name:
name = name.replace('tenrai', '152')
if 'series_4' in name:
pass
if 'series_3' in name:
name = name.replace('tenrai', '234')
if 'series_2' in name:
name = name.replace('tenrai', '457')
return name
if __name__ == '__main__':
from module.config.code_generator import *
Value(FILTER_STRING_SHORTEST='0.5 > 1 > 1.5 > 2 > 2.5 > 3 > 4 > 5 > 6 > 8 > 10 > 12')
Value(
FILTER_STRING_CHEAPEST='Q1 > Q2 > T3 > T4 > Q4 > C6 > T6 > C8 > C12 > G1.5 > D2.5 > G2.5 > D5 > Q0.5 > G4 > D8 > H1 > H2 > H0.5 > D0.5 > H4')
with Dict('DICT_FILTER_PRESET'):
for series in [5, 4, 3, 2]:
def new_filter(**kwargs):
for k, v in kwargs.items():
k = convert_name(k, series)
v = translate(v, target=k)
DictItem(k, v)
# 1
Comment("""
Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
Average time cost: 153.41706666666678
Average rewards: [238.69016631 238.37881965 529.71190834 528.92520834 528.39586667 150.07973333]
""")
new_filter(series_4_tenrai_only_cube="""
S4-Q0.5 > S4-DR0.5 > S4-PRY0.5 > S4-Q4 > S4-Q2 > S4-Q1 > !4-0.5
> S4-A2 > S4-G1.5 > S4-G4 > !4-1 > reset > S4-H1 > S4-Z2
> S4-DR2.5 > S4-PRY2.5 > S4-G2.5 > !4-1.5 > !4-2 > S4-H2 > !4-2.5 > S4-DR5 > S4-PRY5
> !4-4 > S4-H4 > S4-C6 > !4-5 > S4-DR8 > S4-PRY8 > S4-C8 > !4-C6 > S4-C12
> !4-C8 > !4-C12
""")
# 2
Comment("""
Goal: DR_blurprint=0, PRY_blueprint=0, tanrai_blueprint=150
Average time cost: 161.37177965277806
Average rewards: [241.92774575 241.13046242 421.82134358 421.04494941 420.46893024 150.07799978]
""")
new_filter(series_4_tenrai_only="""
S4-Q0.5 > S4-PRY0.5 > S4-DR0.5 > S4-Q4 > S4-Q2 > S4-Q1 > S4-H0.5 > !4-0.5 > S4-A2
> S4-G4 > S4-H1 > S4-G1.5 > !4-1 > S4-Z2 > S4-DR2.5 > reset
> S4-G2.5 > S4-PRY2.5 > !4-1.5 > !4-2 > !4-2.5 > S4-H2 > S4-H4 > S4-DR5
> S4-PRY5 > !4-4 > S4-C6 > !4-5 > S4-DR8 > S4-PRY8 > S4-C8 > !4-C6
> !4-C8 > S4-C12 > !4-C12
""")
# 5
Comment("""
Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
Average time cost: 124.67622465277958
Average rewards: [531.93022864 529.81919864 510.27473326 510.18530159 510.11215826 100.8088164]
""")
new_filter(series_4_blueprint_tenrai_cube="""
S4-DR0.5 > S4-Q0.5 > S4-PRY0.5 > S4-H0.5 > !4-0.5 > S4-DR2.5 > S4-Q1
> S4-Q2 > S4-H1 > S4-A2 > S4-G1.5 > reset > S4-Q4 > S4-G4 > S4-H2
> !4-1 > S4-G2.5 > S4-DR5 > S4-PRY2.5 > !4-1.5 > S4-Z2 > S4-DR8
> !4-2 > !4-2.5 > S4-H4 > S4-PRY5 > !4-4 > S4-C6 > S4-PRY8 > !4-5 > !4-C6 > S4-C8
> !4-C8 > S4-C12 > !4-C12
""")
# 6
Comment("""
Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=100
Average time cost: 143.56399131945145
Average rewards: [520.06195858 519.19883191 392.86544828 392.64870495 392.49383995 102.2368499]
""")
new_filter(series_4_blueprint_tenrai="""
S4-DR0.5 > S4-PRY0.5 > S4-Q0.5 > S4-H1 > S4-H0.5 > S4-DR2.5 > S4-G1.5
> S4-Q1 > S4-DR5 > !4-0.5 > S4-G4 > S4-Q2 > S4-PRY2.5 > reset > S4-DR8
> !4-1 > S4-A2 > S4-G2.5 > S4-H2 > !4-1.5 > S4-Z2 > S4-H4
> S4-Q4 > !4-2 > !4-2.5 > S4-PRY5 > S4-PRY8 > !4-4 > S4-C6 > !4-5 > !4-C6 > S4-C8
> S4-C12 > !4-C8 > !4-C12
""")
# 3
Comment("""
Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
Average time cost: 82.0121088194467
Average rewards: [519.0311752 514.64003687 653.77171198 653.72126532 653.66129615 26.97694791]
""")
new_filter(series_4_blueprint_only_cube="""
S4-DR0.5 > S4-PRY0.5 > S4-H0.5 > S4-H1 > S4-H2 > S4-DR2.5 > S4-DR5 > S4-Q0.5
> !4-0.5 > S4-DR8 > reset > S4-H4 > S4-Q1 > !4-1 > S4-G1.5 > !4-1.5
> S4-G2.5 > S4-Q2 > S4-A2 > S4-Z2 > !4-2 > S4-PRY2.5 > S4-G4 > !4-2.5
> S4-Q4 > !4-4 > S4-PRY5 > S4-PRY8 > S4-C6 > !4-5 > !4-C6 > S4-C8
> S4-C12 > !4-C8 > !4-C12
""")
# 4
Comment("""
Goal: DR_blurprint=513, PRY_blueprint=343, tanrai_blueprint=0
Average time cost: 124.71616166666873
Average rewards: [514.96354877 514.70099977 355.58865468 354.96831385 354.66888635 56.48432238]
""")
new_filter(series_4_blueprint_only="""
S4-DR0.5 > S4-H0.5 > S4-PRY0.5 > S4-DR8 > S4-DR5
> S4-DR2.5 > S4-G1.5 > S4-PRY2.5 > S4-Q0.5 > !4-0.5 > S4-G2.5 > S4-G4
> reset > S4-Q1 > !4-1 > S4-PRY5 > !4-1.5 > S4-Q2 > S4-Z2 > S4-A2 > !4-2 > S4-PRY8
> !4-2.5 > S4-Q4 > !4-4 > S4-C6 > !4-5 > !4-C6 > S4-C8
> !4-C8 > S4-C12 > !4-C12
""")
Comment('Old community filters')
DictItem(series_2_than_3_457_234=beautify_filter("""
S2-Q0.5 > S2-PRY0.5 > S2-DR0.5 > S2-Q4 > S2-Q1 > S2-Q2 > S2-H0.5 > 0.5
> S3-Q1 > S3-Q2 > S2-G4 > S3-Q4 > S2-G1.5 > S2-DR2.5 > reset > Q1 > S2-PRY2.5 > S2-G2.5 > H1 > 1.5
> Q2 > 2.5 > S2-DR5 > S2-PRY5 > Q4 > G4 > 5 > H2 > S2-C6 > S2-DR8 > S2-PRY8 > S2-C8
> 6 > 8 > 4 > S2-C12 > 12
"""))
from module.logger import logger
generator.write('./module/research/preset.py')