.. DO NOT EDIT .. generated by reference.py .. default-role:: py:obj .. highlight:: none .. |nbsp| unicode:: 0xa0 :trim: `factoriocalc` package ====================== .. py:module:: factoriocalc Main package. Most symbols in submodules are available in this package. If a symbol is not mentioned as belonging to a submodule, the location should be considered an implementation detail. Fractions --------- .. autofunction:: frac .. autofunction:: div .. py:class:: Frac Class used internally for all calculation, should normally use `frac` to create a `Frac`. See `fracs.Frac` for complete documentation. Core ---- .. py:currentmodule:: factoriocalc .. py:data:: Default :type: DefaultType .. autoclass:: Ingredient .. autoclass:: Item .. autoclass:: Fluid .. autoclass:: Research .. autoclass:: Electricity .. autoclass:: Module .. autoclass:: MachineBase .. autoclass:: Machine .. autoclass:: CraftingMachine .. autoclass:: Mul .. autoclass:: Group .. autoclass:: Flow .. autoclass:: OneWayFlow .. autoclass:: FlowsState .. autoclass:: Flows .. autoclass:: SimpleFlows .. autoclass:: NetFlows .. autoclass:: Effect .. autoclass:: Bonus .. autoclass:: AllowedEffects .. autoclass:: Recipe .. autoclass:: RecipeComponent .. py:data:: IGNORE :value: -100 .. autoexception:: InvalidModulesError .. autofunction:: maxInputs .. autoclass:: MachinePrefs .. py:data:: rcpByName .. py:data:: itmByName .. py:data:: mchByName .. py:data:: recipesThatMake .. py:data:: recipesThatUse `mch` module ------------ .. automodule:: factoriocalc.mch :no-members: .. autofunction:: _find `itm` module ------------ .. automodule:: factoriocalc.itm :no-members: .. autofunction:: _find When the gameInfo context variable is configured for the base game this module also provides a few special items: .. py:data:: _combined_research Result of `rcp._combined_research `. .. py:data:: _military_research Result of `rcp._military_research `. .. py:data:: _production_research Result of `rcp._production_research `. `rcp` module ------------ .. automodule:: factoriocalc.rcp :no-members: .. autofunction:: _find When the gameInfo context variable is configured for the base game this module also provides some special recipes: .. py:data:: space_science_pack Recipe to produce 1000 `itm.space_science_pack` in a `RocketSilo `. .. py:data:: _combined_research Recipe to consume all 7 science packs at a rate of 1/s in a `FakeLab `. .. py:data:: _military_research Recipe to consume all but the production science pack at a rate of 1/s in a `FakeLab `. .. py:data:: _production_research Recipe to consume all but the military science pack at a rate of 1/s in a `FakeLab `. `config` module --------------- .. automodule:: factoriocalc.config `presets` module ---------------- .. automodule:: factoriocalc.presets :no-members: Base Game ......... When the gameInfo context variable is configured for the base game this module provides: .. py:data:: MP_EARLY_GAME :value: MachinePrefs(mch.AssemblingMachine1(), mch.StoneFurnace(fuel=None)) :no-index: .. py:data:: MP_LATE_GAME :value: MachinePrefs(mch.AssemblingMachine3(), mch.ElectricFurnace()) :no-index: .. py:function:: MP_MAX_PROD(level=3, beacon=None, beacons=None) :no-index: .. py:data:: SPEED_BEACON :value: mch.Beacon(2*itm.speed_module_3) :no-index: .. py:data:: sciencePacks :type: set :value: {itm.utility_science_pack, itm.automation_science_pack, itm.chemical_science_pack, itm.production_science_pack, itm.space_science_pack, itm.military_science_pack, itm.logistic_science_pack} :no-index: Space Age ......... When the gameInfo context variable is configured for Space Age this module provides: .. py:data:: MP_EARLY_GAME :value: MachinePrefs(mch.AssemblingMachine1(), mch.StoneFurnace(fuel=None), mch.ChemicalPlant()) :no-index: .. py:data:: MP_EARLY_MID_GAME :value: MachinePrefs(mch.AssemblingMachine3(), mch.ElectricFurnace(), mch.ChemicalPlant()) :no-index: .. py:data:: MP_LATE_GAME :value: MachinePrefs(mch.Foundry(), mch.ElectromagneticPlant(), mch.AssemblingMachine3(rcp.rocket_fuel), mch.ChemicalPlant(rcp.light_oil_cracking), mch.ChemicalPlant(rcp.heavy_oil_cracking), mch.Biochamber(fuel=None), mch.CryogenicPlant(), mch.AssemblingMachine3(), mch.ElectricFurnace()) :no-index: .. py:data:: MP_LEGENDARY :value: MachinePrefs(mch.LegendaryFoundry(modules=4*itm.legendary_productivity_module_3), mch.LegendaryElectromagneticPlant(modules=5*itm.legendary_productivity_module_3), mch.LegendaryAssemblingMachine3(rcp.rocket_fuel, modules=4*itm.legendary_productivity_module_3), mch.LegendaryChemicalPlant(rcp.light_oil_cracking, modules=3*itm.legendary_productivity_module_3), mch.LegendaryChemicalPlant(rcp.heavy_oil_cracking, modules=3*itm.legendary_productivity_module_3), mch.LegendaryBiochamber(fuel=None, modules=4*itm.legendary_productivity_module_3), mch.LegendaryCryogenicPlant(modules=8*itm.legendary_productivity_module_3), mch.LegendaryAssemblingMachine3(modules=4*itm.legendary_productivity_module_3), mch.LegendaryElectricFurnace(modules=2*itm.legendary_productivity_module_3), mch.LegendaryChemicalPlant(modules=3*itm.legendary_productivity_module_3), mch.LegendaryOilRefinery(modules=3*itm.legendary_productivity_module_3), mch.LegendaryRocketSilo(modules=4*itm.legendary_productivity_module_3), mch.LegendaryCentrifuge(modules=2*itm.legendary_productivity_module_3), mch.LegendaryRecycler(rcp.scrap_recycling), mch.LegendaryRecycler(modules=4*itm.legendary_quality_module_3)) :no-index: .. py:data:: sciencePacks :type: set :value: {itm.automation_science_pack, itm.chemical_science_pack, itm.metallurgic_science_pack, itm.cryogenic_science_pack, itm.promethium_science_pack, itm.logistic_science_pack, itm.production_science_pack, itm.agricultural_science_pack, itm.utility_science_pack, itm.military_science_pack, itm.electromagnetic_science_pack, itm.space_science_pack} :no-index: Units ----- .. py:currentmodule:: factoriocalc .. autoclass:: Unit .. autofunction:: wagonsPerUnit .. autofunction:: wagonsPerMinute .. autofunction:: rocketsPerUnit .. autofunction:: rocketsPerMinute .. py:data:: UNIT_SECONDS :value: Unit(abbr='s', sep='/', conv=1) .. py:data:: UNIT_MINUTES :value: Unit(abbr='m', sep='/', conv=60) .. py:data:: UNIT_HOURS :value: Unit(abbr='h', sep='/', conv=3600) .. py:data:: UNIT_EXPRESS_BELTS :value: Unit(abbr='eb', sep=' ', conv=Frac(1, 45)) .. py:data:: UNIT_FAST_BELTS :value: Unit(abbr='fb', sep=' ', conv=Frac(1, 30)) .. py:data:: UNIT_TRANSFER_BELTS :value: Unit(abbr='tb', sep=' ', conv=Frac(1, 15)) .. py:data:: UNIT_MEGAWATT :value: Unit(abbr='MW', sep=' ', conv=1) .. py:data:: UNIT_STACKS_PER_SEC :value: Unit(abbr='s/s', sep=' ', conv= at 0x73b4d670eb90>) .. py:data:: UNIT_STACKS_PER_MIN :value: Unit(abbr='s/m', sep=' ', conv= at 0x73b4d670ec20>) .. py:data:: UNIT_WAGONS_PER_MIN :value: Unit(abbr='w/m', sep=' ', conv=) .. py:data:: DU_SECONDS :value: ((Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_MINUTES :value: ((Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='m', sep='/', conv=60))) .. py:data:: DU_HOURS :value: ((Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='h', sep='/', conv=3600))) .. py:data:: DU_EXPRESS_BELTS :value: ((Item, Unit(abbr='eb', sep=' ', conv=Frac(1, 45))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_FAST_BELTS :value: ((Item, Unit(abbr='fb', sep=' ', conv=Frac(1, 30))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_TRANSFER_BELTS :value: ((Item, Unit(abbr='tb', sep=' ', conv=Frac(1, 15))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKS_PER_SEC :value: ((Item, Unit(abbr='s/s', sep=' ', conv= at 0x73b4d670eb90>)), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKS_PER_MIN :value: ((Item, Unit(abbr='s/m', sep=' ', conv= at 0x73b4d670ec20>)), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_WAGONS_PER_MIN :value: ((Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='w/m', sep=' ', conv=))) .. py:data:: UNIT_TURBO_BELTS :value: Unit(abbr='tb', sep=' ', conv=Frac(1, 60)) .. py:data:: UNIT_STACKED_TURBO_BELTS :value: Unit(abbr='stb', sep=' ', conv=Frac(1, 240)) .. py:data:: UNIT_STACKED_EXPRESS_BELTS :value: Unit(abbr='seb', sep=' ', conv=Frac(1, 180)) .. py:data:: UNIT_STACKED_FAST_BELTS :value: Unit(abbr='sfb', sep=' ', conv=Frac(1, 120)) .. py:data:: UNIT_STACKED_TRANSFER_BELTS :value: Unit(abbr='stb', sep=' ', conv=Frac(1, 60)) .. py:data:: DU_TURBO_BELTS :value: ((Item, Unit(abbr='tb', sep=' ', conv=Frac(1, 60))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKED_TURBO_BELTS :value: ((Item, Unit(abbr='stb', sep=' ', conv=Frac(1, 240))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKED_EXPRESS_BELTS :value: ((Item, Unit(abbr='seb', sep=' ', conv=Frac(1, 180))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKED_FAST_BELTS :value: ((Item, Unit(abbr='sfb', sep=' ', conv=Frac(1, 120))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: DU_STACKED_TRANSFER_BELTS :value: ((Item, Unit(abbr='stb', sep=' ', conv=Frac(1, 60))), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='s', sep='/', conv=1))) .. py:data:: UNIT_ROCKETS_PER_MIN :value: Unit(abbr='r/m', sep=' ', conv=) .. py:data:: DU_ROCKETS_PER_MIN :value: ((Item, Unit(abbr='r/m', sep=' ', conv=)), (Electricity, Unit(abbr='MW', sep=' ', conv=1)), (None, Unit(abbr='m', sep='/', conv=60))) Boxes and Produce ----------------- .. py:currentmodule:: factoriocalc .. autoclass:: BoxBase .. autoclass:: Equal .. autoclass:: AtLeast .. autoclass:: Box .. autoclass:: BlackBox .. autofunction:: finalizeGroup .. autoclass:: SolveRes .. autofunction:: box .. autofunction:: produce .. autofunction:: merge .. autofunction:: union .. autoclass:: ProduceResult .. autoexception:: MultipleChoiceError .. autoexception:: SolveFailedError .. autoexception:: NonUniqueSolutionError .. _blueprints: Blueprints ---------- .. py:currentmodule:: factoriocalc .. autoclass:: Blueprint .. autoclass:: BlueprintBook .. autofunction:: importBlueprint JSON Conversion --------------- .. py:currentmodule:: factoriocalc .. autofunction:: toJsonObj .. autofunction:: fromJsonObj Helpers ------- .. py:currentmodule:: factoriocalc .. autofunction:: withSettings .. autoclass:: FakeLab .. autoclass:: FakeBeacon .. autofunction:: useSpeedBeacons .. autofunction:: useEffectivityBeacons .. autofunction:: useBeacons `setGameConfig` --------------- .. py:currentmodule:: factoriocalc .. autofunction:: setGameConfig .. autofunction:: userRecipesFile `mods` module ------------- .. automodule:: factoriocalc.mods Miscellaneous ------------- These symbols are not imported by ``from factorocalc import *``. .. py:currentmodule:: factoriocalc .. autoclass:: Constraint .. autoclass:: Term `machine` module ---------------- .. automodule:: factoriocalc.machine `setGameConfig` internals ------------------------- .. py:currentmodule:: factoriocalc These symbols are only useful when adding support for new mods and are not imported by ``from factorocalc import *``. .. autofunction:: importGameInfo .. autofunction:: genMaxProd .. autofunction:: vanillaResearchHacks .. autofunction:: vanillaCraftingHints .. autoclass:: CraftingHint .. autoclass:: GameInfo .. autofunction:: toPythonName .. autofunction:: toClassName `fracs` module -------------- .. py:currentmodule:: factoriocalc.fracs .. automodule:: factoriocalc.fracs :no-members: .. autoclass:: Frac .. autofunction:: frac .. autofunction:: div .. py:data:: Inf :type: Frac .. py:data:: NaN :type: NanType .. py:data:: Invalid :type: InvalidType .. autofunction:: frac_from_float_exact .. autofunction:: frac_from_float_round .. autofunction:: as_integer_ratio .. py:data:: trunc :value: .. py:data:: ceil :value: .. py:data:: floor :value: .. autofunction:: isfinite .. autofunction:: isinf .. autofunction:: isnan .. py:data:: assume_positive_zero :value: .. py:data:: allow_nans :value: .. autoclass:: Rational `solver` module --------------- .. py:currentmodule:: factoriocalc.solver .. automodule:: factoriocalc.solver :no-members: .. autoclass:: Var .. autoclass:: Term .. autoclass:: SolveRes .. autoclass:: Cond .. py:data:: EQ :value: ="> .. py:data:: LE :value: