A simple and efficient computing package for Genshin Impact gacha analysis

Overview

GGanalysisLite计算包

这个版本的计算包追求计算速度,而GGanalysis包有着更多计算功能。

GGanalysisLite包通过卷积计算分布列,通过FFT和快速幂加速卷积计算。

测试玩家得到的排名值rank的数学意义是:与抽了同样数量五星的其他玩家相比,测试玩家花费的抽数大于等于比例rank的玩家。rank的值在(0,1]上,值越高说明玩家越不幸运,达到1则说明达到了保底系统的极限。

安装方法

打开终端输入以下指令,安装完成后下载文件可以删除。

git clone https://github.com/OneBST/GGanalysisLite.git
cd GGanalysisLite
pip install .

卷积计算方法

采用的模型见我的B站专栏。通过卷积计算分布列。

卷积采用scipysignal.convolve()函数,由其自动根据规模选择使用FFT计算或是直接卷积。

当计算物品数量上升,获取分布列需要多次卷积时,朴素FFT计算复杂度接近,故采用快速幂进行加速,复杂度降为

用例

使用GenshinPlayer类添加玩家,初始化其抽卡情况,随后使用类函数输出rank

import GGanalysisLite as ggl

permanent_5 = 5			# 常驻祈愿五星数量
permanent_pull = 301	# 常驻祈愿恰好出最后一个五星时花费的抽数
character_5 = 14		# 角色祈愿五星数量
character_pull = 876	# 角色祈愿恰好出最后一个五星时花费的抽数
character_up_5 = 8		# 角色祈愿UP五星数量
character_up_pull = 876	# 角色祈愿恰好出最后一个UP五星时花费的抽数
weapon_5 = 2			# 武器祈愿五星数量
weapon_pull = 126		# 武器祈愿恰好出最后一个五星时花费的抽数

# 初始化玩家
player = ggl.GenshinPlayer(	p5=permanent_5,
                            c5=character_5,
                            u5=character_up_5,
                            w5=weapon_5,
                            p_pull=permanent_pull,
                            c_pull=character_pull,
                            u_pull=character_up_pull,
                            w_pull=weapon_pull)

# 查看常驻祈愿rank
print('常驻祈愿', player.get_p5_rank())

# 查看角色祈愿rank(考虑五星数量)
print('角色祈愿', player.get_c5_rank())

# 查看UP角色rank(考虑UP五星数量)
print('角色祈愿UP', player.get_u5_rank())

# 查看武器祈愿rank
print('武器祈愿', player.get_w5_rank())

# 查看综合rank(角色祈愿考虑五星数量)
print('综合', player.get_comprehensive_rank())

# 查看综合rank(角色祈愿考虑UP数量)
print('综合UP', player.get_comprehensive_rank_Up5Character())
You might also like...
This is a simple SV calling package for diploid assemblies.

dipdiff This is a simple SV calling package for diploid assemblies. It uses a modified version of svim-asm. The package includes its own version minim

A simple package for interacting with the 9kw.eu anti-captcha service.
A simple package for interacting with the 9kw.eu anti-captcha service.

Welcome to captcha9kw’s documentation! captcha9kw is a smallish Python package for making use of the 9kw.eu services, including solving of interactive

A collection of simple tools that proved to be needed for hadling large periodic calculations with the VASP software package.

VESTA-tools A collection of simple tools that proved to be needed for handling large periodic calculations with the VASP software package. distTotCalc

Simple package to make requests throughout Tor with circuit renewal.

AutoTor Table of Contents About the Project Contents Dependencies Getting Started Installation Coding Contributing About the Project Simple package to

redun aims to be a more expressive and efficient workflow framework

redun yet another redundant workflow engine redun aims to be a more expressive and efficient workflow framework, built on top of the popular Python pr

Mnemosyne: efficient learning with powerful digital flash-cards.

Mnemosyne: Optimized Flashcards and Research Project Mnemosyne is: a free, open-source, spaced-repetition flashcard program that helps you learn as ef

Calculate the efficient frontier

关于 代码主要参考Fábio Neves的文章,你可以在他的文章中找到一些细节性的解释

Framework for creating efficient data processing pipelines

Aqueduct Framework for creating efficient data processing pipelines. Contact Feel free to ask questions in telegram t.me/avito-ml Key Features Increas

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time. Works on both Windows and Linux.

Comments
  • 歐氣分析的範例好像寫錯了?

    歐氣分析的範例好像寫錯了?

    做了以下簡單的測試:

    for index in range(1, 100):
            dist_c = GI.up_5star_character(item_num=index)
            player_luck = str(round(100 * sum((dist_c)[:1001]), 2)) #在同樣花了 1000 抽的人之中,抽到了 index 個 UP 五星,排名前 player_luck%
            print(f"{index} {player_luck}%")
    

    結果當 index 越大時,player_luck 反而越小?這是不是反了?

    opened by seriaati 1
  • 关于函数返回结果的一些疑问

    关于函数返回结果的一些疑问

    在调用函数前,没有对任何参数进行修改。 我分别进行了以下调用: dist_c = AK.common_6star(item_num=1, pull_state=0) print(dist_c.exp) # 实际结果34.59,理论抽数35 dist_c = AK.single_up_6star(item_num=1, pull_state=0) print(dist_c.exp) # 实际结果69.18,理论抽数57 dist_c = AK.dual_up_specific_6star(item_num=1, pull_state=0) print(dist_c.exp) # 实际结果138.37,理论抽数102 dist_c = AK.limited_up_6star(item_num=1, pull_state=0) print(dist_c.exp) # 实际结果98.84,理论抽数70 除了获取到常规六星的理论抽数符合50%,其它的结果相对应的概率均偏高,是需要在调用前额外设置一些参数吗?

    opened by MilkWind 1
Owner
一棵平衡树
一棵平衡树
Arknights gacha simulation written in Python

Welcome to arknights-gacha repository This is my shameless attempt of simulating Arknights gacha. Current supported banner types (with potential bugs)

Swyrin 3 May 7, 2022
EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild community 87 Dec 27, 2022
Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed

⚠️ The Nimbus infrastructure project is no longer under development. ⚠️ For more information, please read the news announcement. If you are interested

Nimbus 194 Jun 30, 2022
IPython: Productive Interactive Computing

IPython: Productive Interactive Computing Overview Welcome to IPython. Our full documentation is available on ipython.readthedocs.io and contains info

IPython 15.6k Dec 31, 2022
freeCodeCamp Scientific Computing with Python Project for Certification.

Time_Calculator_freeCodeCamp freeCodeCamp Scientific Computing with Python Project for Certification. Write a function named add_time that takes in tw

Rajdeep Mondal 1 Dec 23, 2021
A test repository to build a python package and publish the package to Artifact Registry using GCB

A test repository to build a python package and publish the package to Artifact Registry using GCB. Then have the package be a dependency in a GCF function.

null 1 Feb 9, 2022
Some usefull scripts for the Nastran's 145 solution (Flutter Analysis) using the pyNastran package.

nastran-aero-flutter This project is intended to analyse the Supersonic Panel Flutter using the NASTRAN software. The project uses the pyNastran and t

zuckberj 11 Nov 16, 2022
GWCelery is a simple and reliable package for annotating and orchestrating LIGO/Virgo alerts

GWCelery is a simple and reliable package for annotating and orchestrating LIGO/Virgo alerts, built from widely used open source components.

Min-A Cho Zeno 1 Nov 2, 2021
Always fill your package requirements without the user having to do anything! Simple and easy!

WSL Should now work always-fill-reqs-python3 Always fill your package requirements without the user having to do anything! Simple and easy! Supported

Hashm 7 Jan 19, 2022
B-Pkg is a simple tool in python for installing all basic package in termux

Basic-Pkg ???? Basic-Pkg ???? B-Pkg is a simple tool in python for installing all basic package in termux This is my first tool, I hope you will like

Macgaiver 3 Oct 21, 2021