Skip to content

Commit

Permalink
настройки производства для расчёта industry_profit передащил в q_indu…
Browse files Browse the repository at this point in the history
…strialist_settings

добавил в conveyor-формулы фракционные чертежи, которые продаются в контрактах
  • Loading branch information
Qandra-Si committed Nov 4, 2024
1 parent f51f187 commit 0e20c3c
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 51 deletions.
68 changes: 61 additions & 7 deletions q_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,23 @@ def main():
# см. также eve_conveyor_tools.py : setup_blueprint_details
# см. также q_industry_profit.py : main
# см. также q_dictionaries.py : main
icc = q_industrialist_settings.g_industry_calc_customization
industry_plan_customization = profit.QIndustryPlanCustomization(
# длительность всех реакций - около 1 суток
reaction_runs=15,
reaction_runs=icc.get('reaction_runs', 15),
# длительность производства компонентов общего потребления (таких как Advanced Components или
# Fuel Blocks) тоже принимается около 1 суток, остальные материалы рассчитываются в том объёме,
# в котором необходимо
industry_time=5 * 60 * 60 * 24,
industry_time=icc.get('industry_time', 5*60*60*24),
# market-группы компонентов общего потребления
common_components=[
common_components=icc.get('common_components', [
1870, # Fuel Blocks
65, # Advanced Components
1883, # Advanced Capital Components
2768, # Protective Components
1908, # R.A.M.
1147, # Subsystem Components
],
]),
# * 18% jump freighters; 22% battleships; 26% cruisers, BCs, industrial, mining barges;
# 30% frigate hull, destroyer hull; 34% modules, ammo, drones, rigs
# * Tech 3 cruiser hulls and subsystems have 22%, 30% or 34% chance depending on artifact used
Expand All @@ -293,11 +294,11 @@ def main():
# )
# ) * Decryptor_Modifier
# 27.5% => min навыки и импланты пилотов запускающих инвенты (вся научка мин в 3)
min_probability=27.5,
min_probability=icc.get('min_probability', 27.5),
# экономия материалов (material efficiency) промежуточных чертежей
unknown_blueprints_me=10,
unknown_blueprints_me=icc.get('unknown_blueprints_me', 10),
# экономия времени (time efficiency) промежуточных чертежей
unknown_blueprints_te=20)
unknown_blueprints_te=icc.get('unknown_blueprints_te', 20))

# автоматический выбор чертежей для их расчёта и загрузки в БД
possible_decryptors: typing.List[profit.QPossibleDecryptor] = profit.get_list_of_decryptors()
Expand Down Expand Up @@ -420,6 +421,59 @@ def main():
else:
assert 0

# в том случае, если invent невозможен, то проверяем что чертёж (1) не продаётся в маркете,
# (2) опубликован, (3) не является продуктом инвента, его (4) продукция опубликована
for key in sde_blueprints.keys():
# ограничитель: if len(calc_inputs) >= 10: break
tid = sde_type_ids.get(key)
if not tid: continue
if not tid.get('published', False): continue # Clone Grade Beta Blueprint
if tid.get('marketGroupID') is not None: continue
blueprint = sde_blueprints[key]
if 'invention' in blueprint['activities']: continue
blueprint_type_id: int = int(key)
if sde_products['invention'].get(blueprint_type_id) is not None: continue
# проверка, возможно ли производство по этому чертежу?
if 'manufacturing' in blueprint['activities']:
if 'materials' not in blueprint['activities']['manufacturing']: continue # Apotheosis Blueprint
assert len(blueprint['activities']['manufacturing']['products']) == 1
product_type_id = blueprint['activities']['manufacturing']['products'][0]['typeID']
product_tid = sde_type_ids.get(str(product_type_id))
if product_tid.get('published', False): # тут м.б. Haunter Cruise Missile
"""
-- поиск фракционных чертежей, которые продаются только в контрактах
select
bid.sdet_type_name, -- x.*,
pid.sdet_type_name, -- p.*,
bid.sdet_meta_group_id,
(SELECT sden_name FROM qi.eve_sde_names WHERE sden_category=0 and sden_id=bid.sdet_meta_group_id)
from
qi.eve_sde_blueprints x,
qi.eve_sde_blueprint_products p,
qi.eve_sde_type_ids bid,
qi.eve_sde_type_ids pid
where
bid.sdet_market_group_id is null and
x.sdeb_blueprint_type_id=bid.sdet_type_id and
bid.sdet_published and
x.sdeb_activity=1 and
x.sdeb_blueprint_type_id not in (select sdeb_blueprint_type_id from qi.eve_sde_blueprints where sdeb_activity=8) and
x.sdeb_blueprint_type_id not in (select sdebp_product_id from qi.eve_sde_blueprint_products where sdebp_activity=8) and
x.sdeb_blueprint_type_id in (select distinct sdebm_blueprint_type_id from qi.eve_sde_blueprint_materials) and
p.sdebp_blueprint_type_id=x.sdeb_blueprint_type_id and
p.sdebp_activity=1 and
p.sdebp_product_id=pid.sdet_type_id and
pid.sdet_published
order by pid.sdet_type_name
"""
if not next((1 for _ in calc_inputs if _['bptid'] == blueprint_type_id), None):
# print(tid['name']['en'])
calc_inputs.append({
'bptid': blueprint_type_id,
'qr': 1,
'me': 0,
'te': 0})

if user_choice == 'yes':
qidbdics.clean_conveyor_formulas()
else:
Expand Down
43 changes: 43 additions & 0 deletions q_industrialist_settings.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# g_client_scope : application scopes, едины для всех приложений проекта

g_use_filesystem_resources = False

g_client_id = "00000000000000000000000000000000"

g_client_scope = ["esi-fittings.read_fittings.v1", # Requires: access token
"esi-assets.read_corporation_assets.v1", # Requires role(s): Director
"esi-corporations.read_blueprints.v1", # Requires role(s): Director
Expand All @@ -19,6 +21,7 @@ g_client_scope = ["esi-fittings.read_fittings.v1", # Requires: access token
"esi-markets.structure_markets.v1", # Requires one of the following EVE corporation role(s): Accountant, Trader
"esi-corporations.read_corporation_membership.v1", # Requires: access token
]

g_database = {
#"ssh_tunnel": {
# "host": "server.ru",
Expand All @@ -35,6 +38,46 @@ g_database = {
"user": "qi_user",
"password": "qi_LAZ7dBLmSJb9" # <-- this is the value you probably need to edit
}


# см. также eve_conveyor_tools.py : setup_blueprint_details
# см. также q_industry_profit.py : main
# см. также q_dictionaries.py : main
g_industry_calc_customization = {
# длительность всех реакций - около 1 суток
'reaction_runs': 15,
# длительность производства компонентов общего потребления (таких как Advanced Components или Fuel Blocks)
# тоже принимается около 1 суток, остальные материалы рассчитываются в том объёме, в котором необходимо
'industry_time': 5 * 60 * 60 * 24, # типично для R Industry
# 'industry_time': (5 * 60 * 60 * 24) // 8, # производство по 2400 Fuel Blocks (60 runs)
'common_components': [ # market-группы компонентов общего потребления
1870, # Fuel Blocks
65, # Advanced Components
1883, # Advanced Capital Components
2768, # Protective Components
1908, # R.A.M.
1147, # Subsystem Components
],
# === min_probability ===
# * 18% jump freighters; 22% battleships; 26% cruisers, BCs, industrial, mining barges;
# 30% frigate hull, destroyer hull; 34% modules, ammo, drones, rigs
# * Tech 3 cruiser hulls and subsystems have 22%, 30% or 34% chance depending on artifact used
# * Tech 3 destroyer hulls have 26%, 35% or 39% chance depending on artifact used
# рекомендации к минимальным скилам: 3+3+3 (27..30% навыки и импланты)
# Invention_Chance =
# Base_Chance *
# (1 + ((Encryption_Skill_Level / 40) +
# ((Datacore_1_Skill_Level + Datacore_2_Skill_Level) / 30)
# )
# ) * Decryptor_Modifier
# 'min_probability': 36.7, # min навыки и импланты пилотов запускающих инвенты (вся научка мин в 4)
'min_probability': 27.5, # min навыки и импланты пилотов запускающих инвенты (вся научка мин в 3)
# экономия материалов (material efficiency) промежуточных чертежей
'unknown_blueprints_me': 10,
# экономия времени (time efficiency) промежуточных чертежей
'unknown_blueprints_te': 20,
}

g_market_regions = {
"The Forge",
}
Expand Down
52 changes: 8 additions & 44 deletions q_industry_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,54 +332,18 @@ def main():
{'bptid': 39583, 'qr': 3, 'me': 2+1, 'te': 4+8}, # Endurance + Symmetry Decryptor
]

# см. также eve_conveyor_tools.py : setup_blueprint_details
# см. также q_industry_profit.py : main
# см. также q_dictionaries.py : main
calc_customization = {
# длительность всех реакций - около 1 суток
'reaction_runs': 15,
# длительность производства компонентов общего потребления (таких как Advanced Components или Fuel Blocks)
# тоже принимается около 1 суток, остальные материалы рассчитываются в том объёме, в котором необходимо
# 'industry_time': 5 * 60 * 60 * 24, # типично для R Industry
'industry_time': (5 * 60 * 60 * 24) // 8, # производство по 2400 Fuel Blocks (60 runs)
'common_components': [ # market-группы компонентов общего потребления
1870, # Fuel Blocks
65, # Advanced Components
1883, # Advanced Capital Components
2768, # Protective Components
1908, # R.A.M.
1147, # Subsystem Components
],
# === min_probability ===
# * 18% jump freighters; 22% battleships; 26% cruisers, BCs, industrial, mining barges;
# 30% frigate hull, destroyer hull; 34% modules, ammo, drones, rigs
# * Tech 3 cruiser hulls and subsystems have 22%, 30% or 34% chance depending on artifact used
# * Tech 3 destroyer hulls have 26%, 35% or 39% chance depending on artifact used
# рекомендации к минимальным скилам: 3+3+3 (27..30% навыки и импланты)
# Invention_Chance =
# Base_Chance *
# (1 + ((Encryption_Skill_Level / 40) +
# ((Datacore_1_Skill_Level + Datacore_2_Skill_Level) / 30)
# )
# ) * Decryptor_Modifier
'min_probability': 27.5, # min навыки и импланты пилотов запускающих инвенты (вся научка мин в 3)
# экономия материалов (material efficiency) промежуточных чертежей
'unknown_blueprints_me': 10,
# экономия времени (time efficiency) промежуточных чертежей
'unknown_blueprints_te': 20,
}

# настройки оптимизации производства: реакции на 15 ран (сутки) и производство в зависимости от времени (сутки)
# см. также eve_conveyor_tools.py : setup_blueprint_details
industry_plan_customization: typing.Optional[profit.QIndustryPlanCustomization] = None
if calc_customization:
if q_industrialist_settings.g_industry_calc_customization:
icc = q_industrialist_settings.g_industry_calc_customization
industry_plan_customization = profit.QIndustryPlanCustomization(
reaction_runs=calc_customization.get('reaction_runs'),
industry_time=calc_customization.get('industry_time'),
common_components=calc_customization.get('common_components'),
min_probability=calc_customization.get('min_probability'),
unknown_blueprints_me=calc_customization.get('unknown_blueprints_me'),
unknown_blueprints_te=calc_customization.get('unknown_blueprints_te'))
reaction_runs=icc.get('reaction_runs'),
industry_time=icc.get('industry_time'),
common_components=icc.get('common_components'),
min_probability=icc.get('min_probability'),
unknown_blueprints_me=icc.get('unknown_blueprints_me'),
unknown_blueprints_te=icc.get('unknown_blueprints_te'))

calc_num: int = 0
for calc_input in calc_inputs:
Expand Down

0 comments on commit 0e20c3c

Please sign in to comment.