def burst10(args): preset = get_preset(args.id) gen: JobGenerator = jobMap[preset.job].JobGenerator() target, weapon_stat = TemplateGenerator().get_template_and_weapon_stat( gen, str(args.ulevel), args.cdr) v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=preset.options, ulevel=args.ulevel, weaponstat=weapon_stat, ability_grade=Ability_grade(4, 1), ) sche = policy.AdvancedGraphScheduler( graph, policy.ListedFetchingPolicy( skill_ids=gen.get_skill_rotation_10sec(graph)), [rules.UniquenessRule()], ) analytics = core.StatAnalytics() control = core.Simulator(sche, target, analytics) control.start_simulation(args.time * 1000) start, end, dpm, loss = analytics.get_peak(10000) print(preset.job, f"{dpm:,.3f}") return analytics.get_log()
def dpm(args): preset = get_preset(args.id) gen: JobGenerator = jobMap[preset.job].JobGenerator() target, weapon_stat = TemplateGenerator().get_template_and_weapon_stat( gen, str(args.ulevel), args.cdr) v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=preset.options, ulevel=args.ulevel, weaponstat=weapon_stat, ability_grade=Ability_grade(4, 1), ) sche = policy.AdvancedGraphScheduler( graph, policy.TypebaseFetchingPolicy(priority_list=[ core.BuffSkillWrapper, core.SummonSkillWrapper, core.DamageSkillWrapper, ]), [rules.UniquenessRule()] + gen.get_predefined_rules(rules.RuleSet.BASE), ) analytics = core.StatAnalytics() control = core.Simulator(sche, target, analytics) control.start_simulation(args.time * 1000) dpm = analytics.get_dpm() print(preset.job, f"{dpm:,.3f}") return analytics.get_log()
def burst10(args): preset = get_preset(args.id) template = get_template_generator("high_standard")().get_template( args.ulevel) target: ItemedCharacter = template(weaponList[preset.job], args.cdr) gen: JobGenerator = jobMap[preset.job].JobGenerator() v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=preset.options, ulevel=args.ulevel, weaponstat=[4, 9], ability_grade=Ability_grade(4, 1), ) sche = policy.AdvancedGraphScheduler( graph, policy.ListedFetchingPolicy( skill_ids=gen.get_skill_rotation_10sec(graph)), [rules.UniquenessRule()], ) analytics = core.StatAnalytics() control = core.Simulator(sche, target, analytics) control.start_simulation(args.time * 1000) start, end, dpm, loss = analytics.get_peak(10000) print(dpm) return analytics.get_log()
def get_detailed_dpm( self, spec_name: str = "8000", cdr: int = 0, ulevel: int = 6000, options={} ) -> Dict[str, Any]: gen: JobGenerator = self.supplier.JobGenerator() target, weapon_stat = TemplateGenerator().get_template_and_weapon_stat(gen=gen, spec_name=spec_name, cdr=cdr) # 코어강화량 설정 v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=options, ulevel=ulevel, weaponstat=weapon_stat, ability_grade=Ability_grade(4, 1), ) # 가져온 그래프를 토대로 스케줄러를 생성합니다. sche = policy.AdvancedGraphScheduler( graph, policy.TypebaseFetchingPolicy( priority_list=[ core.BuffSkillWrapper, core.SummonSkillWrapper, core.DamageSkillWrapper, ] ), [rules.UniquenessRule()] + gen.get_predefined_rules(rules.RuleSet.BASE), ) # 데이터를 분석할 분석기를 생성합니다. analytics = core.Analytics() # 시뮬레이터에 스케줄러, 캐릭터, 애널리틱을 연결하고 생성합니다. control = core.Simulator( sche, target, analytics ) control.start_simulation(self.runtime) return { "data": analytics.get_results(), "meta": analytics.get_metadata(target.get_buffed_modifier()), "skill": analytics.get_skill_info(), "graph": graph.get_network_information("merged"), "dpm": analytics.getDPM(), "detail": gen.generate.__doc__, "loss": analytics.get_unrestricted_DPM() - analytics.getDPM(), }
def get_modifier(args) -> core.CharacterModifier: preset = get_preset(args.id) gen: JobGenerator = jobMap[preset.job].JobGenerator() target, weapon_stat = TemplateGenerator().get_template_and_weapon_stat(gen, str(args.ulevel), args.cdr) v_builder = core.AlwaysMaximumVBuilder() gen.package( target, v_builder, options=preset.options, ulevel=args.ulevel, weaponstat=weapon_stat, ability_grade=Ability_grade(4, 1), farm=False, ) return gen.get_passive_skill_modifier()
def get_dpm( self, ulevel=6000, level=None, weaponstat=[4, 9], cdr=0, options={}, printFlag=False, statistics=False, restricted=True, default_modifier=core.CharacterModifier(), ): # TODO target을 동적으로 생성할 수 있도록. target: ItemedCharacter = self.template(maplejobs.weaponList[self.job], cdr) if level is not None: target.unsafe_change_level(level) gen: JobGenerator = self.supplier.JobGenerator() v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=options, ulevel=ulevel, weaponstat=weaponstat, ability_grade=Ability_grade(4, 1), ) sche = policy.AdvancedGraphScheduler( graph, policy.TypebaseFetchingPolicy(priority_list=[ core.BuffSkillWrapper, core.SummonSkillWrapper, core.DamageSkillWrapper, ]), [rules.UniquenessRule()] + gen.get_predefined_rules(rules.RuleSet.BASE), ) # 가져온 그래프를 토대로 스케줄러를 생성합니다. analytics = core.Analytics(printFlag=printFlag) # 데이터를 분석할 분석기를 생성합니다. if printFlag: print(target.get_modifier()) control = core.Simulator( sche, target, analytics) # 시뮬레이터에 스케줄러, 캐릭터, 애널리틱을 연결하고 생성합니다. control.set_default_modifier(default_modifier) control.start_simulation(self.runtime) if statistics: control.analytics.statistics() return analytics.getDPM(restricted=restricted)
def get_dpm( self, spec_name: str, ulevel: int, cdr: int = 0, options={}, printFlag=False, statistics=False, restricted=True, default_modifier=core.CharacterModifier(), ) -> float: gen: JobGenerator = self.supplier.JobGenerator() target, weapon_stat = TemplateGenerator().get_template_and_weapon_stat( gen=gen, spec_name=spec_name, cdr=cdr) v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=options, ulevel=ulevel, weaponstat=weapon_stat, ability_grade=Ability_grade(4, 1), farm=False, ) sche = policy.AdvancedGraphScheduler( graph, policy.TypebaseFetchingPolicy(priority_list=[ core.BuffSkillWrapper, core.SummonSkillWrapper, core.DamageSkillWrapper, ]), [rules.UniquenessRule()] + gen.get_predefined_rules(rules.RuleSet.BASE), ) # 가져온 그래프를 토대로 스케줄러를 생성합니다. analytics = core.Analytics(printFlag=printFlag) # 데이터를 분석할 분석기를 생성합니다. if printFlag: print(target.get_modifier()) control = core.Simulator( sche, target, analytics) # 시뮬레이터에 스케줄러, 캐릭터, 애널리틱을 연결하고 생성합니다. control.set_default_modifier(default_modifier) control.start_simulation(self.runtime) if statistics: control.analytics.statistics() return analytics.getDPM(restricted=restricted)
def get_detailed_dpm(self, ulevel=6000, weaponstat=[4, 9], cdr=0, options={}): # TODO target을 동적으로 생성할 수 있도록. target: ItemedCharacter = self.template(maplejobs.weaponList[self.job], cdr) gen: JobGenerator = (self.supplier).JobGenerator() # 코어강화량 설정 v_builder = core.AlwaysMaximumVBuilder() graph = gen.package( target, v_builder, options=options, ulevel=ulevel, weaponstat=weaponstat, ability_grade=Ability_grade(4, 1), ) sche = policy.AdvancedGraphScheduler( graph, policy.TypebaseFetchingPolicy(priority_list=[ core.BuffSkillWrapper, core.SummonSkillWrapper, core.DamageSkillWrapper, ]), [rules.UniquenessRule()] + gen.get_predefined_rules(rules.RuleSet.BASE), ) # 가져온 그래프를 토대로 스케줄러를 생성합니다. analytics = core.Analytics() # 데이터를 분석할 분석기를 생성합니다. control = core.Simulator( sche, target, analytics) # 시뮬레이터에 스케줄러, 캐릭터, 애널리틱을 연결하고 생성합니다. control.start_simulation(self.runtime) return { "data": analytics.get_results(), "meta": analytics.get_metadata(target.get_buffed_modifier()), "skill": analytics.get_skill_info(), "graph": graph.get_network_information("merged"), "dpm": analytics.getDPM(), "detail": gen.generate.__doc__, "loss": analytics.get_unrestricted_DPM() - analytics.getDPM(), }