Skip to content

Instantly share code, notes, and snippets.

@ArcHound
Last active July 21, 2025 09:54
Show Gist options
  • Select an option

  • Save ArcHound/5545d489608d21b15a9fc72fa7f41d54 to your computer and use it in GitHub Desktop.

Select an option

Save ArcHound/5545d489608d21b15a9fc72fa7f41d54 to your computer and use it in GitHub Desktop.
Factorio Gleba Production Worksheet
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "a01e514c-d28d-485e-a6b1-59d95b90f02b",
"metadata": {},
"source": [
"# Gleba Factory Worksheet\n",
"\n",
"I've finally reached Gleba in Factorio Space Age. But due to the spoilage mechanics, I can't just wing it and hope it works out and I don't want to deal with the nutrient cold starts. \n",
"\n",
"Why is that, you ask? Let me explain the Factorio crafting process. Crafting in Factorio is quite complex to describe (as opposed to e.g. Minecraft or Terraria - use 3xA, 4xB and C to get P).\n",
"\n",
"## Recipes\n",
"\n",
"You have your recipes, they take ingredients and create products. If only it were that simple:\n",
"\n",
" - You might create multiple products from a single recipe pass (copper-cable),\n",
" - You might create multiple types of products from a single recipe (yumako mash and seeds from yumako processing)\n",
" - Sometimes, you have a probability of obtaining a product (again, seeds from yumako processing). This can be thought of as recieving a fraction of the product, and over time it will be approximately correct. But there's a dice roll hidden in the process.\n",
" - Some recipes are catalytic, meaning you use ingredient A to get more of ingredient A (bacteria cultivation),\n",
" - or you use ingredient B to get ingredient A and you get to keep at least some of the ingredient B (Aquilo fluoroketone recipes).\n",
" - Each recipe has a crafting time required in seconds. Lowest I've observed is 0.1s, highest are around a minute (if we count spoilage as recipes, then the highest has 2 hours).\n",
"\n",
"## Stations\n",
"\n",
"To foster automation, recipes have crafting stations that can automatically perform them. Now things get even more hairy:\n",
"\n",
" - Each station has a crafting speed (multiplicative modifier applied to the crafting time).\n",
" - Stations have power costs, usually expressed in kW of electricity required. There's some constatnt low station cost even when idle (drain). Then there are biochambers, which get their power from nutrients, so you need to keep a steady supply to keep them running.\n",
" - Still speaking of biochambers, some stations have implicit productivity bonuses that create products out of thin air. If you have a 50% productivity bonus, you get a 3 for 2 discount (assuming a recipe that produces one product per run). More on productivity in a moment.\n",
" - You need stations to process fluids - you hook a pipe to a station. Water is the most common, but it gets complicated fast (oil processing or anything Aquilo related).\n",
" - Some stations can perform only some of the recipes - assembly machines are general and then you have niche recipes for the rest, e.g. dedicated refineries to create oil products from crude oil.\n",
"\n",
"## Effects and Modules\n",
"\n",
"We're still not done explaining this system. Let's talk effects, a modifiers you can use in-game to modify the recipe properties within the context of a crafting station. Effects are usually expressed in percentages that are added together and then they multiply the original value. These can be negative too!\n",
"\n",
"We have:\n",
"\n",
" - Crafting speed effect\n",
" - Power cost effect\n",
" - Productivity effect\n",
" - Quality effect\n",
"\n",
"Each of these effects has a module associated with this. Each module has 3 levels that increase their effectiveness. They don't map one-to-one, that would be too simple.\n",
"\n",
" - Speed module: provides crafting speed bonus for the price of increased energy consumption and decreased quality.\n",
" - Efficiency module: provides power cost decrease. That's it. There's a hard limit of -80%: meaning you can't decrease the power requirements to less than 20% of the cost. This can be achieved with 2 efficiency modules of level 2.\n",
" - Productivity module: provides productivity for the increased power cost and increases crafting time a bit.\n",
" - Quality module: provides an increased chance to obtain items of higher quality which have better properties.\n",
"\n",
"Please forget that quality exists to keep my sanity, your sanity, and also to keep this explanation relatively short. If you've already lost it, then I am sorry, but please try and enjoy the ride anyway.\n",
"\n",
"### Productivity \n",
"\n",
"Productivity is a funny effect to explain - basically a product count modifier. However, there are constraints. \n",
"\n",
" - Productivity modules can only be inserted for intermediary products (most of what we're crafting here, including rocket parts, science packs and more).\n",
" - To keep things complicated, the built-in station productivity modules apply to everything (create biochambers in biochambers to get more biochambers per biochamber).\n",
" - The way this works in practice is a separate productivity bar that fills up as you process recipes. That means that when the productivity hits, you get additional output. If this aligns with a recipe completion, you'll get double the output at the same time, which might cause throughput issues.\n",
" - A hard upper bound of 300% productivity is implemented - you can get maximum of 4 times the products for single recipe costs. This also means that further global productivity infinity researches won't matter after level 30. But hey, the megabase needs something to do anyway.\n",
" - Remember catalytic recipes? The final productivity multiplier is applied to the additional products only - I was very sad when I've realized I can't get infinite uranium from Kovarex enrichment process. Bacteria cultivation is the exception, you get productivity applied to the whole products.\n",
" - A final productivity quirk to note are the [biolabs](https://wiki.factorio.com/Biolab) which have 50% pack drain - that translates to 100% multiplicative productivity bonus.\n",
"\n",
"### Modules in Stations\n",
"\n",
"As we've explained effects, we can now see how they modify the stations:\n",
"\n",
" - Stations can have module slots that fit modules that modify their effects.\n",
" - Moreover, there are beacons in the game that can transfer this bonus wirelessly, but their effect decreases with the distance. And yes, a single beacon can have multiple types of modules. Multiple beacons can affect a single station too. An exception here is productivity modules, which can't be inserted into beacons. \n",
"\n",
"There might exist an analytical solution to reversing this process (strictly counting the requirements from the desired result), but I've opted not to search for it and simulate the process until I have enough.\n",
"\n",
"## Get ready\n",
"\n",
"So obviously, the simplest way forward is to implement these mechanics on the side. There might exist an analytical solution to reversing this process (strictly counting the requirements from the desired result), but I've opted not to search for it and simulate the process until I have enough. Another argument against this approach is that you cannot have fractional stations anyway."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ed9f169d-884e-4529-a128-ed3fdbd6cf9b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: networkx in /home/milo/nb_env/lib/python3.13/site-packages (3.5)\n",
"Requirement already satisfied: matplotlib in /home/milo/nb_env/lib/python3.13/site-packages (3.10.3)\n",
"Requirement already satisfied: graphviz in /home/milo/nb_env/lib/python3.13/site-packages (0.20.3)\n",
"Requirement already satisfied: tabulate in /home/milo/nb_env/lib/python3.13/site-packages (0.9.0)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (1.3.2)\n",
"Requirement already satisfied: cycler>=0.10 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (4.58.1)\n",
"Requirement already satisfied: kiwisolver>=1.3.1 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (1.4.8)\n",
"Requirement already satisfied: numpy>=1.23 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (2.2.6)\n",
"Requirement already satisfied: packaging>=20.0 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (24.2)\n",
"Requirement already satisfied: pillow>=8 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (11.2.1)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (3.2.3)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /home/milo/nb_env/lib/python3.13/site-packages (from matplotlib) (2.9.0.post0)\n",
"Requirement already satisfied: six>=1.5 in /home/milo/nb_env/lib/python3.13/site-packages (from python-dateutil>=2.7->matplotlib) (1.17.0)\n"
]
}
],
"source": [
"# but first, arbitrary global imports, just in case\n",
"import sys\n",
"!{sys.executable} -m pip install networkx matplotlib graphviz tabulate\n",
"\n",
"import pprint\n",
"import networkx as nx\n",
"import matplotlib.pyplot as plt\n",
"import graphviz\n",
"from dataclasses import dataclass, field\n",
"import math\n",
"from collections import defaultdict\n",
"import tabulate\n",
"from IPython.display import HTML, Image, display\n",
"import copy"
]
},
{
"cell_type": "markdown",
"id": "2c75c20e-a0a1-4113-9788-6a211c368f3f",
"metadata": {},
"source": [
"## Factorio Data for Simulation\n",
"\n",
"We need the recipes in a somewhat standard form for further processing. As I don't want to build extensively on Gleba, all I care about are:\n",
"\n",
" - Gleba Science\n",
" - Carbon Fiber\n",
" - Bioflux\n",
" - Rocket parts\n",
" - All of the intermediary products\n",
"\n",
"Provided here as dicts, if somebody somehow wants to play with this also. Data taken from [factorio wiki](https://wiki.factorio.com/), names of entities are the \"internal names\" displayed there. This convention will carry us and it's non-negotiable. I repeat, don't try and invent your own names, don't try to be smart about this."
]
},
{
"cell_type": "markdown",
"id": "56faa27f-e09c-4137-8e6e-d9210c10fb46",
"metadata": {},
"source": [
"### Nauvis Recipes\n",
"\n",
"I am trying to be really focused here, let's try and make only what we need for rockets. I also want to prioritize bio-recipes."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "7db14105-a864-4a5b-9093-e62ba363f8d5",
"metadata": {},
"outputs": [],
"source": [
"nauvis_recipes_dict = {\n",
" \"r_landfill\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"stone\", \"quantity\": 50}\n",
" ],\n",
" \"crafting_time\": 0.5,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"landfill\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_steel-plate\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"iron-plate\", \"quantity\": 5}\n",
" ],\n",
" \"crafting_time\": 16,\n",
" \"crafted_in\": [\n",
" \"steel-furnace\",\n",
" \"electric-furnace\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"steel-plate\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_iron-plate\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"iron-ore\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 3.2,\n",
" \"crafted_in\": [\n",
" \"steel-furnace\",\n",
" \"electric-furnace\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"iron-plate\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_copper-plate\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-ore\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 3.2,\n",
" \"crafted_in\": [\n",
" \"steel-furnace\",\n",
" \"electric-furnace\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"copper-plate\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_copper-cable\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-plate\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 0.5,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"copper-cable\", \"quantity\": 2, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_electronic-circuit\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-cable\", \"quantity\": 3},\n",
" {\"item\": \"iron-plate\", \"quantity\":1 }\n",
" ],\n",
" \"crafting_time\": 0.5,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"electronic-circuit\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_advanced-circuit\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-cable\", \"quantity\": 4},\n",
" {\"item\": \"electronic-circuit\", \"quantity\":2},\n",
" {\"item\": \"plastic-bar\", \"quantity\":2}\n",
" ],\n",
" \"crafting_time\": 6,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"advanced-circuit\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_processing-unit\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"sulfuric-acid\", \"quantity\": 5, \"input_type\":\"fluid\"},\n",
" {\"item\": \"electronic-circuit\", \"quantity\":20},\n",
" {\"item\": \"advanced-circuit\", \"quantity\":2}\n",
" ],\n",
" \"crafting_time\": 10,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"processing-unit\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_low-density-structure\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-plate\", \"quantity\": 20},\n",
" {\"item\": \"plastic-bar\", \"quantity\":5},\n",
" {\"item\": \"steel-plate\", \"quantity\":2}\n",
" ],\n",
" \"crafting_time\": 15,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"low-density-structure\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_rocket-part\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"low-density-structure\", \"quantity\": 1},\n",
" {\"item\": \"processing-unit\", \"quantity\":1},\n",
" {\"item\": \"rocket-fuel\", \"quantity\":1}\n",
" ],\n",
" \"crafting_time\": 3,\n",
" \"crafted_in\": [\n",
" \"rocket-silo\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"rocket-part\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_sulfuric-acid\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"iron-plate\", \"quantity\": 1},\n",
" {\"item\": \"sulfur\", \"quantity\":5},\n",
" {\"item\": \"water\", \"quantity\":100, \"input_type\":\"fluid\"}\n",
" ],\n",
" \"crafting_time\": 1,\n",
" \"crafted_in\": [\n",
" \"chemical-plant\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"sulfuric-acid\", \"quantity\": 50, \"chance_to_get\":1, \"output_type\":\"fluid\"}\n",
" ]\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "fb4b74eb-9551-4014-88a8-9acd07a43e56",
"metadata": {},
"source": [
"### Gleba Recipes\n",
"\n",
"There are issues with Gleba. You have a couple of basic ingredients that are used in various recipes. You also have some probabilities of seeds that you need to manage. Most of the stuff is made in biochambers, which have a 50% productivity bonus in a baseline, but require nutrients instead of power (more on that later). "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a01334bf-67a3-48eb-961f-bed65130cacd",
"metadata": {},
"outputs": [],
"source": [
"gleba_recipes_dict= {\n",
" \"r_artificial-yumako-soil\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"landfill\", \"quantity\": 5},\n",
" {\"item\": \"nutrients\", \"quantity\": 50},\n",
" {\"item\": \"yumako-seed\", \"quantity\": 2}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"artificial-yumako-soil\", \"quantity\": 10, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_artificial-jellynut-soil\": {\n",
" \"ingredients\": [\n",
" {\"item\": \"landfill\", \"quantity\": 5},\n",
" {\"item\": \"nutrients\", \"quantity\": 50},\n",
" {\"item\": \"jellynut-seed\", \"quantity\": 2}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"artificial-jellynut-soil\", \"quantity\": 10, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_agricultural-tower\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"landfill\", \"quantity\": 1},\n",
" {\"item\": \"steel-plate\", \"quantity\": 10},\n",
" {\"item\": \"electronic-circuit\", \"quantity\": 3},\n",
" {\"item\": \"spoilage\", \"quantity\": 20}\n",
" ],\n",
" \"crafting_time\": 10,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-1\",\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"agricultural-tower\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_biochamber\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"landfill\", \"quantity\": 1},\n",
" {\"item\": \"iron-plate\", \"quantity\": 20},\n",
" {\"item\": \"electronic-circuit\", \"quantity\": 5},\n",
" {\"item\": \"nutrients\", \"quantity\": 5},\n",
" {\"item\": \"pentapod-egg\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 20,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\",\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"biochamber\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_pentapod-egg\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"water\", \"quantity\": 60, \"input_type\": \"fluid\"},\n",
" {\"item\": \"nutrients\", \"quantity\": 30},\n",
" {\"item\": \"pentapod-egg\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 15,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"pentapod-egg\", \"quantity\": 2, \"chance_to_get\":1}\n",
" ],\n",
" \"catalytic\": True\n",
" },\n",
" \"r_agri_part_yumako\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"yumako-seed\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 300,\n",
" \"crafted_in\": [\n",
" \"agricultural-tower\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"yumako\", \"quantity\": 50, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_agri_part_jellynut\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"jellynut-seed\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 300,\n",
" \"crafted_in\": [\n",
" \"agricultural-tower\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"jellynut\", \"quantity\": 50, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_yumako-mash\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"yumako\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 1,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\",\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"yumako-mash\", \"quantity\": 2, \"chance_to_get\":1},\n",
" {\"item\": \"yumako-seed\", \"quantity\": 1, \"chance_to_get\":0.02}\n",
" ]\n",
" },\n",
" \"r_jelly\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"jellynut\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 1,\n",
" \"crafted_in\": [\n",
" \"assembling-machine-2\",\n",
" \"assembling-machine-3\",\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"jelly\", \"quantity\": 4, \"chance_to_get\":1},\n",
" {\"item\": \"jellynut-seed\", \"quantity\": 1, \"chance_to_get\":0.02}\n",
" ]\n",
" },\n",
" \"r_bioflux\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"jelly\", \"quantity\": 12},\n",
" {\"item\": \"yumako-mash\", \"quantity\": 15}\n",
" ],\n",
" \"crafting_time\": 6,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 4, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_agricultural-science-pack\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1},\n",
" {\"item\": \"pentapod-egg\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 4,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"agricultural-science-pack\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_carbon-fiber\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"carbon\", \"quantity\": 1},\n",
" {\"item\": \"yumako-mash\", \"quantity\": 10}\n",
" ],\n",
" \"crafting_time\": 5,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"carbon-fiber\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_rocket-fuel_from_jelly\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 2},\n",
" {\"item\": \"jelly\", \"quantity\": 30},\n",
" {\"item\": \"water\", \"quantity\":30, \"input_type\": \"fluid\"}\n",
" ],\n",
" \"crafting_time\": 10,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"rocket-fuel\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_bioplastic\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1},\n",
" {\"item\": \"yumako-mash\", \"quantity\": 4}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"plastic-bar\", \"quantity\": 3, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_biosulfur\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1},\n",
" {\"item\": \"spoilage\", \"quantity\": 5}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"sulfur\", \"quantity\": 2, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_cult_iron-bacteria\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1},\n",
" {\"item\": \"iron-bacteria\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 4,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"iron-bacteria\", \"quantity\": 4, \"chance_to_get\":1}\n",
" ],\n",
" \"catalytic\": False, # it's an exception, wanted to make this explicit\n",
" },\n",
" \"r_cult_copper-bacteria\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1},\n",
" {\"item\": \"copper-bacteria\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 4,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"copper-bacteria\", \"quantity\": 4, \"chance_to_get\":1}\n",
" ],\n",
" \"catalytic\": False, # it's an exception, wanted to make this explicit\n",
" },\n",
" \"r_nutrients_from_spoilage\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 10}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"nutrients\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_nutrients_from_yumako-mash\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"yumako-mash\", \"quantity\": 4}\n",
" ],\n",
" \"crafting_time\": 4,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"nutrients\", \"quantity\": 6, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_nutrients_from_bioflux\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 5}\n",
" ],\n",
" \"crafting_time\": 2,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"nutrients\", \"quantity\": 40, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_burnt_spoilage\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 6}\n",
" ],\n",
" \"crafting_time\": 12,\n",
" \"crafted_in\": [\n",
" \"biochamber\"\n",
" ],\n",
" \"products\": [\n",
" {\"item\": \"carbon\", \"quantity\":1, \"chance_to_get\":1}\n",
" ]\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "b7ff7e44-f091-4155-981d-b6f8ad2b7562",
"metadata": {},
"source": [
"Also, nearly everything is spoilable, mostly into spoilage (pentapod eggs spoil into enemies, bacteria spoils into ore). That means you are on a timer and also no buffering. The design should account for that and the requirements should be precise. The spoilage recipes are separate (but still in the recipe format). "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "a72ddf92-4ab4-4843-8324-ce8ae6e9e070",
"metadata": {},
"outputs": [],
"source": [
"spoilage = {\n",
" \"r_spoil_iron_bacteria\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"iron-bacteria\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 60,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"iron-ore\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_copper_bacteria\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"copper-bacteria\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 60,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"copper-ore\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_yumako\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"yumako\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 3600,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_jellynut\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"jellynut\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 3600,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_jelly\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"jelly\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 60,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_yumako-mash\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"yumako-mash\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 180,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_bioflux\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"bioflux\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 7200,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_pentapod-egg\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"pentapod-egg\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 900,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"danger\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_agricultural-science-pack\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"agricultural-science-pack\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 3600,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" },\n",
" \"r_spoil_nutrients\":{\n",
" \"ingredients\": [\n",
" {\"item\": \"nutrients\", \"quantity\": 1}\n",
" ],\n",
" \"crafting_time\": 300,\n",
" \"crafted_in\": [\"none\"],\n",
" \"products\": [\n",
" {\"item\": \"spoilage\", \"quantity\": 1, \"chance_to_get\":1}\n",
" ]\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "27c9b6f3-9e56-45cc-b0f8-e85fd06c85ad",
"metadata": {},
"source": [
"## More Data\n",
"\n",
"### Crafting Stations\n",
"\n",
"I'd also need to formalize the crafting stations a bit - they have various requirements mostly:\n",
"\n",
" - Power: assembly machines require electricity, biochambers require nutrients and steel furnaces require solid fuel.\n",
" - Crafting speed: a multiplicative constant that changes the speed of output. With the spoilage mechanics, taking this into account is critical.\n",
" - Productivity: Biochambers have base productivity that provides stuff for free.\n",
" - Module slots: some crafting stations accept modules (speed, efficiency, productivity, quality) with various levels (1,2 and 3) that modify the parameters above.\n",
"\n",
"The `none` station is for consistency reasons, as I have spoilage processes as recipes and each recipe needs a station. \n",
"\n",
"Another quirk is the agri tower - it exists on a 7x7 grid. One spot is taken by the tower, another spot is taken by a medium pole, two inserters and the underground belts to get the seeds in and fruits out. Assuming a fully utilized plant - divide the power requirements by 47."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "3a34d544-476c-469a-ad31-ab8d808aa580",
"metadata": {},
"outputs": [],
"source": [
"crafting_stations = {\n",
" \"assembling-machine-1\":{\n",
" \"module_slots\":0,\n",
" \"crafting_speed\":0.5,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":75000,\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":False\n",
" },\n",
" \"assembling-machine-2\":{\n",
" \"module_slots\":2,\n",
" \"crafting_speed\":0.75,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":150000,\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":True\n",
" },\n",
" \"assembling-machine-3\":{\n",
" \"module_slots\":4,\n",
" \"crafting_speed\":1.25,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":375000,\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":True\n",
" },\n",
" \"chemical-plant\":{\n",
" \"module_slots\":3,\n",
" \"crafting_speed\":1,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":210000,\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":True\n",
" },\n",
" \"rocket-silo\":{\n",
" \"module_slots\":4,\n",
" \"crafting_speed\":1,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":4000000,\n",
" \"energy_source\":{\n",
" \"electric\"\n",
" },\n",
" \"fluid_support\":False\n",
" },\n",
" \"stone-furnace\":{\n",
" \"module_slots\":0,\n",
" \"crafting_speed\":1,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":90000,\n",
" \"energy_source\":[\n",
" \"wood\",\n",
" \"coal\",\n",
" \"solid-fuel\",\n",
" \"rocket-fuel\",\n",
" \"nuclear-fuel\"\n",
" ],\n",
" \"fluid_support\":False\n",
" },\n",
" \"steel-furnace\":{\n",
" \"module_slots\":0,\n",
" \"crafting_speed\":2,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":90000,\n",
" \"energy_source\":[\n",
" \"wood\",\n",
" \"coal\",\n",
" \"solid-fuel\",\n",
" \"rocket-fuel\",\n",
" \"nuclear-fuel\"\n",
" ],\n",
" \"fluid_support\":False\n",
" },\n",
" \"electric-furnace\":{\n",
" \"module_slots\":2,\n",
" \"crafting_speed\":2,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":180000,\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":False\n",
" },\n",
" \"agricultural-tower\":{\n",
" \"module_slots\":0,\n",
" \"crafting_speed\":1,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":100000/47, # it is what it is\n",
" \"energy_source\":[\n",
" \"electric\"\n",
" ],\n",
" \"fluid_support\":False\n",
" },\n",
" \"biochamber\":{\n",
" \"module_slots\":4,\n",
" \"crafting_speed\":2,\n",
" \"productivity\":0.5,\n",
" \"energy_usage_W\":500000,\n",
" \"energy_source\":[\n",
" \"nutrients\"\n",
" ],\n",
" \"fluid_support\":True\n",
" },\n",
" \"none\":{\n",
" \"module_slots\":0,\n",
" \"crafting_speed\":1,\n",
" \"productivity\":0,\n",
" \"energy_usage_W\":0,\n",
" \"energy_source\":[],\n",
" \"fluid_support\":False\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "bc0db8d1-1bef-49a5-914c-508049684653",
"metadata": {},
"source": [
"### Global Bonuses\n",
"\n",
"There are researches that grant global bonuses for productivity, depending on the level you've researched. These are quite substantial and need to be accounted for. They all are 10% increase per level (so lvl1 -> 110%, lvl2 -> 120%, etc.). Mining is out of scope of this sheet (plus we're not really mining on Gleba anyway)."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ebd9e275-c157-43d6-a19f-3f865235c0a4",
"metadata": {},
"outputs": [],
"source": [
"bonus_tech_levels = {\n",
" \"steel-plate\": 0,\n",
" \"low-density-structure\": 0,\n",
" \"processing-unit\": 0,\n",
" \"plastic-bar\": 0,\n",
" \"rocket-fuel\": 0,\n",
" \"rocket-part\": 0\n",
"} # will be modified later"
]
},
{
"cell_type": "markdown",
"id": "0871e2af-4d55-432f-95e2-11c501b1cc8e",
"metadata": {},
"source": [
"### Modules\n",
"\n",
"A quick reminder of this great feature of the game: you can modify the station with modules. These have various properties that can shift the crafting flow. We have:\n",
"\n",
" - Speed (increase speed with increased energy costs),\n",
" - Productivity (provide \"free\" items with decrease of speed and increased energy cost),\n",
" - Efficiency (flat decrease of energy costs),\n",
" - Quality modules (not doing those, lol).\n",
"\n",
"So here they are (without the quality modifiers of course):"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "8db7eb5a-13f6-446e-a364-e0930eccf33e",
"metadata": {},
"outputs": [],
"source": [
"modules_data = {\n",
" \"speed-module\": {\n",
" \"speed\":0.2,\n",
" \"energy\":0.5,\n",
" \"quality\":-0.01,\n",
" },\n",
" \"speed-module-2\": {\n",
" \"speed\":0.3,\n",
" \"energy\":0.6,\n",
" \"quality\":-0.015,\n",
" },\n",
" \"speed-module-3\": {\n",
" \"speed\":0.5,\n",
" \"energy\":0.7,\n",
" \"quality\":-0.025,\n",
" },\n",
" \"productivity-module\": {\n",
" \"speed\":-0.05,\n",
" \"energy\":0.40,\n",
" \"productivity\":0.04,\n",
" },\n",
" \"productivity-module-2\": {\n",
" \"speed\":-0.1,\n",
" \"energy\":0.60,\n",
" \"productivity\":0.06,\n",
" },\n",
" \"productivity-module-3\": {\n",
" \"speed\":-0.15,\n",
" \"energy\":0.80,\n",
" \"productivity\":0.10,\n",
" },\n",
" \"efficiency-module\": {\n",
" \"energy\":-0.3,\n",
" },\n",
" \"efficiency-module-2\": {\n",
" \"energy\":-0.4,\n",
" },\n",
" \"efficiency-module-3\": {\n",
" \"energy\":-0.5,\n",
" },\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "7315aae1-dca7-4876-92bc-bbbef4dd6607",
"metadata": {},
"source": [
"### Fuel\n",
"\n",
"Some of the items made can be used as fuel, this you'll need in some crafting stations and for powering the factory (I think I am going to use heat tower). Not all things accept all kinds of fuel, yay."
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "887f4ef0-efb2-48bf-9b41-d1ece2c65a63",
"metadata": {},
"outputs": [],
"source": [
"fuel_value_map = {\n",
" \"wood\":{\n",
" \"fuel-value-J\":2000000\n",
" },\n",
" \"carbon\":{\n",
" \"fuel-value-J\":2000000\n",
" },\n",
" \"coal\":{\n",
" \"fuel-value-J\":4000000\n",
" },\n",
" \"solid-fuel\":{\n",
" \"fuel-value-J\":12000000\n",
" },\n",
" \"rocket-fuel\":{\n",
" \"fuel-value-J\":100000000\n",
" },\n",
" \"nuclear-fuel\":{\n",
" \"fuel-value-J\":1210000000\n",
" },\n",
" \"nutrients\":{\n",
" \"fuel-value-J\":2000000,\n",
" },\n",
" \"yumako\":{\n",
" \"fuel-value-J\":2000000\n",
" },\n",
" \"yumako-mash\":{\n",
" \"fuel-value-J\":1000000\n",
" },\n",
" \"yumako-seed\":{\n",
" \"fuel-value-J\":4000000\n",
" },\n",
" \"jellynut\":{\n",
" \"fuel-value-J\":10000000\n",
" },\n",
" \"jelly\":{\n",
" \"fuel-value-J\":1000000\n",
" },\n",
" \"jellynut-seed\":{\n",
" \"fuel-value-J\":4000000\n",
" },\n",
" \"spoilage\":{\n",
" \"fuel-value-J\":250000\n",
" },\n",
" \"pentapod-egg\":{\n",
" \"fuel-value-J\":5000000\n",
" },\n",
" \"tree-seed\":{\n",
" \"fuel-value-J\":100000\n",
" },\n",
" \"biter-egg\":{\n",
" \"fuel-value-J\":6000000\n",
" },\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "1a463ade-ebbe-4c42-9ffc-9994ea96567c",
"metadata": {},
"source": [
"### Energy\n",
"\n",
"Since I want to do insert fuel into the heating tower and heating tower has a maximum output as well as a efficiency bonus, I need .... this:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "f97bdd80-41ce-4736-b990-9e5f0eb737d6",
"metadata": {},
"outputs": [],
"source": [
"power_sources = {\n",
" \"heating-tower\":{\n",
" \"energy_usage_W\":16000000,\n",
" \"energy_source\":[\n",
" \"wood\",\n",
" \"coal\",\n",
" \"solid-fuel\",\n",
" \"rocket-fuel\",\n",
" \"nuclear-fuel\",\n",
" \"yumako\",\n",
" \"yumako-mash\",\n",
" \"yumako-seed\",\n",
" \"jelly\",\n",
" \"jellynut\",\n",
" \"jellynut-seed\",\n",
" \"spoilage\",\n",
" \"pentapod-egg\",\n",
" \"tree-seed\",\n",
" \"biter-egg\"\n",
" ],\n",
" \"fluid_support\":False,\n",
" \"energy_output_W\":40000000,\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "9d12629c-46b5-4c49-b373-b4a4f5f80789",
"metadata": {},
"source": [
"# Programming\n",
"\n",
"Finally, we get to some logic. The way I think about factorio is a bottom-up approach, so we start with some functions and properties that will be later tied at the high level to get the info we need."
]
},
{
"cell_type": "markdown",
"id": "2b782cec-4a88-4284-93d7-83ef0a369205",
"metadata": {},
"source": [
"## Dataclasses\n",
"\n",
"I love dataclasses. With so many subtle differences (everything is a product, even a crafting station can benefit from productivity) I'd prefer a more typed approach. Let's start simple - items. We know that items are spoilable, so here we just note down the numbers.\n",
"\n",
"I'd also like to connect all of the items to an inventory class that perhaps has some helper functions. The set of these inventory classes will later come toghether to a game state, where we'll also track some save specific stuff like the productivity researches."
]
},
{
"cell_type": "markdown",
"id": "38b0b10d-be98-4f5e-b9e3-b80dc472bbdb",
"metadata": {},
"source": [
"## Items\n",
"\n",
"I've worked hard to get the recipes. They contain all of the item data I care about, so let's parse items from recipes. And since we note spoiling process as a recipe, I expect the `add_item` call for spoilables to be done from spoilable recipe parsing. So we should have the `spoil_time` == `crafting_time` available. However, for some reason I've opted to first check all of the spoilage recipes ingredients and provide them as a list of item ids anyway. I guess I didn't trust myself to nail this without a lot of debugging."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "052e8006-bf31-4fa7-987c-df9a2774c5a7",
"metadata": {},
"outputs": [],
"source": [
"@dataclass\n",
"class Item:\n",
" name: str\n",
" can_spoil: bool=False\n",
" spoil_time: int=0\n",
" is_fuel: bool=False\n",
" fuel_value_J: int=0\n",
" is_fluid: bool=False\n",
" rocket_capacity: int=0\n",
"\n",
"class ItemInventory:\n",
" def __init__(self, spoilables:list[str], fuel_value_map:dict[str,dict[str,int]]):\n",
" \"\"\" Takes lists of item names so that we can classify the items properly \"\"\"\n",
" self.spoilables = spoilables\n",
" self.fuel_value_map = fuel_value_map\n",
" self.fuels = [x for x in fuel_value_map]\n",
" self.item_map = dict()\n",
"\n",
" def is_in_inventory(self, item_label):\n",
" return item_label in self.item_map\n",
"\n",
" def is_spoilable(self, item_label):\n",
" if item_label in self.item_map:\n",
" return item_label in self.spoilables\n",
" else:\n",
" raise ValueError(\"Item {item_label} not in inventory!\")\n",
"\n",
" def is_fuel(self, item_label):\n",
" if self.is_in_inventory(item_label):\n",
" return item_label in self.fuels\n",
" else:\n",
" raise ValueError(\"Item {item_label} not in inventory!\")\n",
"\n",
" def set_rocket_capacity(self, item_label, capacity):\n",
" if self.is_in_inventory(item_label):\n",
" self.item_map[item_label].rocket_capacity=capacity\n",
" else:\n",
" raise ValueError(\"Item {item_label} not in inventory!\")\n",
" \n",
" def add_item(self, item_label, spoil_time=None, input_type=\"item\"):\n",
" if self.is_in_inventory(item_label):\n",
" return\n",
" can_spoil = (item_label in self.spoilables)\n",
" is_fuel = (item_label in self.fuels)\n",
" is_fluid = (input_type == \"fluid\")\n",
" self.item_map[item_label]=Item(\n",
" name=item_label, \n",
" can_spoil=can_spoil,\n",
" is_fuel=is_fuel,\n",
" is_fluid=is_fluid,\n",
" spoil_time=spoil_time,\n",
" fuel_value_J=self.fuel_value_map.get(item_label,{}).get(\"fuel-value-J\", None)\n",
" )\n",
" return\n",
"\n",
" def get_item_by_name(self, item_label):\n",
" if self.is_in_inventory(item_label):\n",
" return self.item_map[item_label]\n",
" else:\n",
" raise ValueError(f\"No known item named {item_label}\")\n",
"\n",
" def get_all_items(self):\n",
" return [x for x in self.item_map]\n",
"\n",
" def convert_fuel(self, energy, fuel_label):\n",
" if fuel_label in self.fuels:\n",
" return energy / self.item_map[fuel_label].fuel_value_J\n",
" else:\n",
" raise ValueError(f\"{fuel_label} isn't a fuel\")\n"
]
},
{
"cell_type": "markdown",
"id": "152b41c0-10b2-4b0e-911f-e86d63641931",
"metadata": {},
"source": [
"## Global Productivity Researches\n",
"\n",
"Before we do crafting, recall that there are some infinite researches that increase base productivity of critical intermediate products. These are substantial and should be accounted for. They all are 10% increase per level (so lvl1 -> +10%, lvl2 -> +20%, etc.)."
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "bb4c8b32-d7e2-4446-bb6b-f929fa0f503b",
"metadata": {},
"outputs": [],
"source": [
"class ProductivityResearchInventory:\n",
" \n",
" def __init__(self, item_list=[x for x in bonus_tech_levels]):\n",
" self.productivity_research_overview = {x:0 for x in item_list}\n",
"\n",
" def set_research(self, item, level:int):\n",
" if item in self.productivity_research_overview and level>=0:\n",
" self.productivity_research_overview[item] = level\n",
" elif level<0:\n",
" raise ValueError(f\"Level {level} must be a positive integer\")\n",
" else:\n",
" raise ValueError(f\"{item} doesn't have a productivity research\")\n",
"\n",
" def get_research_bonus_mult(self, item):\n",
" if item in self.productivity_research_overview:\n",
" return 0.1*self.productivity_research_overview[item] # there's a global productivity limit, I know, will be addressed\n",
" else:\n",
" return 0 # equal to no bonus"
]
},
{
"cell_type": "markdown",
"id": "2172ab63-9d88-46d7-b9c7-d27e85e968c8",
"metadata": {},
"source": [
"## Modules\n",
"\n",
"Modules in factorio modify the station properties. We have speed, efficiency, productivity and quality modules. As I am not counting with any quality, I'd expect to never use these. But there's a compelling argument for quality on Gleba as it increases spoilage time.\n",
"\n",
"If you want, you can define your own module. This is useful when working with beacons. Calculating beacon strenght depends on the layout and that's out of scope of this sheet. But if you setup an example and measure the gained percentages, you can pass them to crafting using a custom module instance later."
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "11f1a472-902a-4638-8aa7-904d715bd20d",
"metadata": {},
"outputs": [],
"source": [
"@dataclass\n",
"class Module:\n",
" name: str\n",
" speed: float=0\n",
" energy: float=0\n",
" quality: float=0\n",
" productivity: float=0\n",
"\n",
" def get_speed_modifier(self):\n",
" return self.speed\n",
"\n",
" def get_energy_modifier(self):\n",
" return self.energy\n",
"\n",
" def get_quality_modifier(self):\n",
" return self.quality\n",
"\n",
" def get_productivity_modifier(self):\n",
" return self.productivity\n",
"\n",
" def __repr__(self):\n",
" if self.speed == 0 and self.energy == 0 and self.quality == 0 and self.productivity == 0:\n",
" return \"No Effect\"\n",
" else:\n",
" # wasn't able to get super() to work, just re-implement this one\n",
" return f\"Module(name=\\\"{self.name}\\\", speed={self.speed}, energy={self.energy}, quality={self.quality}, productivity={self.productivity})\"\n",
"\n",
"class ModuleInventory:\n",
" def __init__(self, modules_data:dict=modules_data):\n",
" self.module_map = dict()\n",
" for name, module in modules_data.items():\n",
" new_dict = dict(module)\n",
" new_dict[\"name\"] = name\n",
" self.module_map[name] = Module(**new_dict)\n",
" self.module_plan = dict()\n",
"\n",
" def get_module_by_name(self, module_name):\n",
" return self.module_map[module_name]\n",
"\n",
" def add_module_plan(self, recipe, station, modules, beacons=Module('beacons')):\n",
" if recipe not in self.module_plan:\n",
" self.module_plan[recipe] = dict()\n",
" self.module_plan[recipe][station] = (modules, beacons)\n",
"\n",
" def get_modules_from_plan(self, recipe, station):\n",
" if recipe not in self.module_plan:\n",
" return list()\n",
" elif station not in self.module_plan[recipe]:\n",
" return list()\n",
" else:\n",
" return [self.get_module_by_name(module) for module in self.module_plan[recipe][station][0]]\n",
"\n",
" def get_beacons_from_plan(self, recipe, station):\n",
" if recipe not in self.module_plan:\n",
" return Module('beacons')\n",
" elif station not in self.module_plan[recipe]:\n",
" return Module('beacons')\n",
" else:\n",
" return self.module_plan[recipe][station][1]\n"
]
},
{
"cell_type": "markdown",
"id": "2fb85e8f-002d-4acb-8d16-d275efa61d6a",
"metadata": {},
"source": [
"## Crafting Stations\n",
"\n",
"The crafting in factorio has some quirks we need to tackle (related to the stuff above, as you've figured). But first, we need to define the crafting station."
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "162658e4-beea-4903-a7e7-bf1c868259b6",
"metadata": {},
"outputs": [],
"source": [
"@dataclass\n",
"class Station:\n",
" name: str\n",
" fluid_support: bool\n",
" module_slots: int\n",
" crafting_speed: float\n",
" energy_usage_W: int\n",
" productivity: int=1\n",
" needs_fuel: bool=False\n",
" allowed_fuel: list[str]=field(default_factory=lambda:list())\n",
" needs_electricity: bool=True\n",
"\n",
" def get_allowed_fuel_items(self, item_inventory:ItemInventory):\n",
" return [item_inventory.get_item_by_name(x) for x in self.allowed_fuel]\n",
" \n",
"\n",
"class StationInventory:\n",
" def __init__(self, crafting_stations):\n",
" self.station_map = dict()\n",
" self.crafting_stations = crafting_stations\n",
" for label in crafting_stations:\n",
" self.add_station(label)\n",
"\n",
" def get_station_by_name(self, station_label):\n",
" if station_label in self.station_map:\n",
" return self.station_map[station_label]\n",
" else:\n",
" raise ValueError(f\"No known station named {station_label}\")\n",
" \n",
" def add_station(self, station_label):\n",
" if station_label in self.station_map:\n",
" return\n",
" station_dict = self.crafting_stations[station_label]\n",
" needs_electricity, needs_fuel = False, False\n",
" if \"electric\" in station_dict[\"energy_source\"]:\n",
" needs_electricity = True\n",
" else:\n",
" needs_fuel = True\n",
" ns = Station(\n",
" name=station_label, \n",
" module_slots=station_dict[\"module_slots\"],\n",
" crafting_speed=station_dict[\"crafting_speed\"],\n",
" productivity=station_dict[\"productivity\"],\n",
" energy_usage_W=station_dict[\"energy_usage_W\"],\n",
" fluid_support=station_dict[\"fluid_support\"],\n",
" needs_electricity=needs_electricity,\n",
" needs_fuel=needs_fuel,\n",
" allowed_fuel=[x for x in station_dict[\"energy_source\"] if x!=\"electric\"]\n",
" )\n",
" self.station_map[station_label] = ns\n"
]
},
{
"cell_type": "markdown",
"id": "ab1f18fb-4aec-4d74-a408-02382a3209aa",
"metadata": {},
"source": [
"## Recipes\n",
"\n",
"Now we can move forward for recipes. The recipe is then a collection of data, albeit with some helper functions.\n",
"\n",
"However, since I don't really have a list of items ready, I will take them from the recipes - each recipe will try and add it's items into the inventory. The inventory is able to stop the duplicates and I trust my data are consistent. If not, then we'd better pray.\n",
"\n",
"A pleasant side effect is that we don't really need to deal with unknown recipes - since we take all of the items from the recipes, we can't have an item that we didn't take from a recipe. Yes, we have some baseline items that spawn from thin air, but it's quite under control is what I'm saying."
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "ae356de7-705c-48ed-8733-c72293667618",
"metadata": {},
"outputs": [],
"source": [
"@dataclass\n",
"class ItemInput:\n",
" item: str\n",
" quantity: int\n",
"\n",
" def get_item_from_inventory(self, item_inventory:ItemInventory):\n",
" return item_inventory.get_item_by_name(self.item)\n",
"\n",
"@dataclass\n",
"class ItemOutput:\n",
" item: str\n",
" quantity: int\n",
" chance_to_get: float\n",
"\n",
" def get_item_from_inventory(self, item_inventory:ItemInventory):\n",
" return item_inventory.get_item_by_name(self.item)\n",
"\n",
"@dataclass\n",
"class Recipe:\n",
" name: str\n",
" ingredients: list[ItemInput]\n",
" crafting_time: float\n",
" crafted_in: list[str]\n",
" products: list[ItemOutput]\n",
" catalytic: bool=False\n",
"\n",
"class RecipeInventory:\n",
" def __init__(self):\n",
" self.recipe_map = dict()\n",
" self.item_inventory = None\n",
" pass\n",
"\n",
" def get_recipe_by_name(self, recipe_name):\n",
" if recipe_name in self.recipe_map:\n",
" return self.recipe_map[recipe_name]\n",
" else:\n",
" raise ValueError(f\"No recipe with name '{recipe_name}'\")\n",
"\n",
" def add_stop_items(self, stop_items=list[str]):\n",
" self.stop_items = stop_items\n",
" \n",
" def add_item_inventory(self, item_inventory:ItemInventory):\n",
" self.item_inventory = item_inventory \n",
" \n",
" def parse_recipe_items(self, recipe_label, recipe_dict, add_to_item_inventory=True):\n",
" if add_to_item_inventory and self.item_inventory is None:\n",
" raise ValueError(\"Item inventory wasn't initialized, can't add values to it!\")\n",
" ingredients = list()\n",
" products = list()\n",
" if recipe_label.startswith(\"r_spoil\"): # it's a spoilage recipe\n",
" for item in recipe_dict[\"ingredients\"]:\n",
" if add_to_item_inventory:\n",
" self.item_inventory.add_item(\n",
" item[\"item\"], \n",
" spoil_time=recipe_dict[\"crafting_time\"], \n",
" input_type=item.get(\"input_type\",\"item\")\n",
" )\n",
" ingredients.append(ItemInput(item[\"item\"], item[\"quantity\"]))\n",
" else:\n",
" for item in recipe_dict[\"ingredients\"]:\n",
" self.item_inventory.add_item(\n",
" item[\"item\"], \n",
" spoil_time=None, \n",
" input_type=item.get(\"input_type\",\"item\")\n",
" )\n",
" ingredients.append(ItemInput(item[\"item\"], item[\"quantity\"]))\n",
" for item in recipe_dict[\"products\"]:\n",
" self.item_inventory.add_item(\n",
" item[\"item\"],\n",
" spoil_time=None, # as we're parsing spoilables first, this shouldn't matter\n",
" input_type=item.get(\"output_type\", \"item\")\n",
" )\n",
" products.append(ItemOutput(item[\"item\"], item[\"quantity\"], item[\"chance_to_get\"]))\n",
" return ingredients, products\n",
" \n",
" def parse_recipe(self, recipe_label, recipe_dict, add_to_item_inventory=True):\n",
" if recipe_label in self.recipe_map:\n",
" return\n",
" ingredients, products = self.parse_recipe_items(recipe_label, recipe_dict, add_to_item_inventory)\n",
" stations = [station for station in recipe_dict[\"crafted_in\"]]\n",
" self.recipe_map[recipe_label]=Recipe(\n",
" name=recipe_label, \n",
" ingredients=ingredients, \n",
" products=products, \n",
" crafted_in=stations,\n",
" crafting_time=recipe_dict[\"crafting_time\"],\n",
" catalytic=recipe_dict.get(\"catalytic\", False)\n",
" )\n",
"\n",
" def find_recipes_for(self, item: str):\n",
" if self.item_inventory.is_in_inventory(item):\n",
" return [self.recipe_map[recipe] for recipe in self.recipe_map if item in [i.item for i in self.recipe_map[recipe].products]]\n",
" else:\n",
" raise ValueError(f\"Unknown item {item}\")\n",
"\n",
" def find_chain_for_item(self, item:str):\n",
" # print(f\"Finding chain for item {item}\")\n",
" nodes = list()\n",
" edges = list()\n",
" nodes.append(item)\n",
" if item in self.stop_items:\n",
" return nodes, edges\n",
" recipes = self.find_recipes_for(item)\n",
" if len(recipes) == 0:\n",
" return nodes, edges\n",
" else:\n",
" selected_recipe = recipes[0] # I can do this since we use only a subset of the available recipes. Good luck with coal products.\n",
" # print(f\"Looking at recipe {selected_recipe}\")\n",
" for in_item in selected_recipe.ingredients:\n",
" edges.append((in_item.item, item))\n",
" new_nodes, new_edges = self.find_chain_for_item(in_item.item)\n",
" nodes += new_nodes\n",
" edges += new_edges\n",
" return list(set(nodes)), list(set(edges))\n",
"\n",
" "
]
},
{
"cell_type": "markdown",
"id": "0f2a1961-89f9-4a49-874f-dab4e0a732c7",
"metadata": {},
"source": [
"## Game State\n",
"\n",
"So now we should have all of the structures in place to process the raw data in dicts into these dataclasses. To untangle this a bit, let's start with declaring our indexes and let's parse out spoilables and fuels. \n",
"\n",
"With that data, we can process the stations, as we are now able to discover fuels needed for some stations. \n",
"\n",
"Then we move on to process spoilable recipes and then we move on to other recipes. As I want to order the products so that I know how much of what I need, normally I'd do a topological sort. But on Gleba we have cycles, so we can't do that. However, I've identified a handful of \"stop\" items that we don't really want to elaborate further on.\n",
"\n",
"What follows here is a set of sanity checks and ordering of the parsing. Quite boring, but critical to do properly."
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "e1a8b304-daf6-4464-8e1e-030e6f2ffef8",
"metadata": {},
"outputs": [],
"source": [
"class GameState:\n",
" def __init__(self):\n",
" self.spoilage = None\n",
" self.fuel_value_map = None\n",
" self.item_inventory = None\n",
" self.crafting_stations = None\n",
" self.station_inventory = None\n",
" self.productivity_researches = None\n",
"\n",
" ### =====================================================================\n",
" ### Parsing Helpers\n",
" ### =====================================================================\n",
"\n",
" def note_fuels(self, fuel_value_map=fuel_value_map):\n",
" self.fuel_value_map = fuel_value_map\n",
" \n",
" def note_spoilage_items(self, spoilage=spoilage):\n",
" self.spoilage=spoilage\n",
"\n",
" def init_item_inventory(self):\n",
" if self.spoilage:\n",
" self.spoilables = [y[\"item\"] for x in self.spoilage for y in self.spoilage[x][\"ingredients\"]] # let's just keep things simple for a while\n",
" else:\n",
" raise ValueError(\"Note down spoilage data by calling 'note_spoilage_items' before initializing item inventory\")\n",
" if self.fuel_value_map:\n",
" self.item_inventory = ItemInventory(self.spoilables, self.fuel_value_map)\n",
" else:\n",
" raise ValueError(\"Note down fuels by calling 'note_fuels' before initializing item inventory\")\n",
"\n",
" def add_fuel_items(self):\n",
" if self.item_inventory:\n",
" for fuel_name in self.fuel_value_map:\n",
" self.item_inventory.add_item(fuel_name)\n",
" else:\n",
" raise ValueError(\"Item inventory needs to be initialized before adding fuels\")\n",
" \n",
" def init_productivity_research_inventory(self, item_list=[x for x in bonus_tech_levels]):\n",
" self.productivity_research_inventory = ProductivityResearchInventory(item_list)\n",
"\n",
" def init_modules(self, modules_data=modules_data):\n",
" self.module_inventory = ModuleInventory(modules_data)\n",
" \n",
" def note_station_data(self, crafting_stations=crafting_stations):\n",
" self.crafting_stations = crafting_stations\n",
" \n",
" def init_stations(self):\n",
" if self.crafting_stations:\n",
" self.station_inventory = StationInventory(crafting_stations)\n",
" else:\n",
" raise ValueError(\"Note down the stations by calling 'note_station_data' before initializing stations\")\n",
"\n",
" def init_recipe_inventory(self):\n",
" self.recipe_inventory = RecipeInventory()\n",
" if self.item_inventory:\n",
" self.recipe_inventory.add_item_inventory(self.item_inventory)\n",
" else:\n",
" raise ValueError(\"Item inventory needs to be initialized before the recipes\")\n",
"\n",
" def add_recipes(self, recipe_group):\n",
" if self.recipe_inventory:\n",
" for recipe, recipe_dict in recipe_group.items():\n",
" self.recipe_inventory.parse_recipe(recipe, recipe_dict)\n",
" else:\n",
" raise ValueError(\"Recipe inventory needs to be initialized before parsing recipes\")\n",
"\n",
" def set_productivity_research_value(self, item, level:int):\n",
" self.productivity_research_inventory.set_research(item, level)\n",
"\n",
" ### =====================================================================\n",
" ### Parsing Flow\n",
" ### =====================================================================\n",
" \n",
" def init_this_dataset(self): # I know, I know. This was the best I came up with.\n",
" self.note_fuels()\n",
" self.note_spoilage_items()\n",
" self.init_item_inventory()\n",
"\n",
" self.init_productivity_research_inventory()\n",
" self.init_modules()\n",
" \n",
" self.note_station_data()\n",
" self.init_stations()\n",
" \n",
" self.init_recipe_inventory()\n",
" self.add_recipes(spoilage)\n",
" self.add_fuel_items()\n",
" self.add_recipes(nauvis_recipes_dict)\n",
" self.add_recipes(gleba_recipes_dict)\n",
" \n",
" # I know, but I can't be bothered to rework the item parsing\n",
" self.item_inventory.set_rocket_capacity('bioflux', 1000)\n",
" self.item_inventory.set_rocket_capacity('agricultural-science-pack', 1000)\n",
" self.item_inventory.set_rocket_capacity('carbon-fiber', 500)\n",
"\n",
" \n",
"game_state = GameState()\n",
"game_state.init_this_dataset()"
]
},
{
"cell_type": "markdown",
"id": "9f312ec2-0c85-400a-8fb2-cf39b93735d2",
"metadata": {},
"source": [
"### Crafting\n",
"\n",
"Since crafting depends on the game state, now we can pick out a class with all of the crafting related processes.\n",
"\n",
"For crafting overview, check the first cell in the sheet."
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "b6f61f3c-15d0-42cd-a460-e8f2e848093e",
"metadata": {},
"outputs": [],
"source": [
"stop_items = [\"iron-ore\", \"copper-ore\", \"iron-bacteria\", \"copper-bacteria\", \"yumako-seed\", \"jellynut-seed\", \"pentapod-egg\", \"spoilage\", \"water\"]\n",
"\n",
"class CraftingProcessor:\n",
" def __init__(self, game_state:GameState, stop_items:list[str]=stop_items):\n",
" self.game_state = game_state\n",
" \n",
" # inventory shorthands\n",
" self.items = self.game_state.item_inventory\n",
" self.recipes = self.game_state.recipe_inventory\n",
" self.modules = self.game_state.module_inventory\n",
" self.prod_res = self.game_state.productivity_research_inventory\n",
" self.stations = self.game_state.station_inventory\n",
" \n",
" self.stop_items = stop_items\n",
" self.recipes.add_stop_items(self.stop_items)\n",
"\n",
"\n",
" def picking_stations_strategy(self, recipe:Recipe) -> str:\n",
" return recipe.crafted_in[-1] # pick the last one, the best one!\n",
"\n",
" def picking_recipes_strategy(self, item, recipes:list[Recipe]) -> Recipe:\n",
" if item == \"nutrients\":\n",
" return next(filter(lambda r:r.name==\"r_nutrients_from_bioflux\", recipes)) # use this one for nutrients\n",
" else:\n",
" return recipes[0] # pick the first one! We can do this, since our recipe set is so focused and we don't work with coal.\n",
" \n",
" def research_prod_item(self, item:str):\n",
" return self.prod_res.get_research_bonus_mult(item) \n",
" \n",
" def run_recipe(self, \n",
" recipe:Recipe, \n",
" station:Station, \n",
" modules:list[Module]=[],\n",
" beacons:Module=Module(\"beacons\", speed=0, productivity=0, energy=0, quality=0)\n",
" ):\n",
" \"\"\" Take a recipe and a station, optionally a list of modules. Calculate the expected outputs as well as the expected costs \"\"\"\n",
" ingredients = [ItemInput(x.item, x.quantity) for x in recipe.ingredients] # make a copy\n",
" \n",
" applied_modules = modules[:station.module_slots]+[beacons] # the station has a limit of modules it can fit.\n",
" module_speed = sum([module.get_speed_modifier() for module in applied_modules])\n",
" # this right here is why we test\n",
" module_efficiency = max(-0.8, sum([module.get_energy_modifier() for module in applied_modules])) # hard limit\n",
" module_productivity = sum([module.get_productivity_modifier() for module in applied_modules])\n",
" productivity_coefficient = station.productivity+module_productivity\n",
" \n",
" time_req = recipe.crafting_time / (station.crafting_speed * (1 + module_speed))\n",
" power_req = station.energy_usage_W * (1 + module_efficiency) * time_req\n",
" products = list()\n",
" for p in recipe.products:\n",
" quantity = 0\n",
" if recipe.catalytic:\n",
" base = next(filter(lambda x:x.item==p.item, recipe.ingredients)).quantity\n",
" quantity=base*p.chance_to_get + (p.quantity-base)*p.chance_to_get*min(3, 1+productivity_coefficient+self.research_prod_item(p.item)) # hard limit\n",
" else:\n",
" quantity=p.quantity*p.chance_to_get*min(3, 1+productivity_coefficient+self.research_prod_item(p.item)) # hard limit\n",
" products.append(\n",
" ItemOutput(\n",
" item=p.item, \n",
" quantity=quantity,\n",
" chance_to_get=1 # normalized\n",
" )\n",
" )\n",
" return ingredients, products, time_req, power_req\n",
"\n",
" def run_recipe_in_multiple_parallel_stations(self, recipe:Recipe, station:Station, station_number:int=1,modules:list[Module]=[], beacons:Module=Module('beacons')):\n",
" ingredients, products, time_req, power_req = self.run_recipe(recipe, station, modules, beacons)\n",
" return (\n",
" [ItemInput(x.item, x.quantity*station_number) for x in ingredients], \n",
" [ItemOutput(x.item, x.quantity*station_number, 1) for x in products], \n",
" time_req, \n",
" power_req*station_number)\n",
"\n",
"crafting_processor = CraftingProcessor(game_state, stop_items)"
]
},
{
"cell_type": "markdown",
"id": "dfbe1f54-738c-48ce-8e7d-64f7d1e2ecea",
"metadata": {},
"source": [
"Let me do a quick sanity check against the classic [smelting recipes](https://wiki.factorio.com/Stone_furnace). Properly testing this process is a good idea, but it's also work. So yeah. Don't do this at home."
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "b7cf6704-4410-4460-8f69-5b916562b67e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--------------------------------------------------------------------\n",
"Classic steel smelting example\n",
"--------------------------------------------------------------------\n",
"IN: [ItemInput(item='iron-plate', quantity=5)]\n",
"OUT: [ItemOutput(item='steel-plate', quantity=1.0, chance_to_get=1)]\n",
"0.125 prod/s\n",
"0.0225 coal/s\n",
"--------------------------------------------------------------------\n",
"With level 5 of steel-plate productivity\n",
"--------------------------------------------------------------------\n",
"IN: [ItemInput(item='iron-plate', quantity=5)]\n",
"OUT: [ItemOutput(item='steel-plate', quantity=1.5, chance_to_get=1)]\n",
"0.1875 prod/s\n",
"0.0225 coal/s\n",
"--------------------------------------------------------------------\n",
"basic smelting array that should compress a yellow belt\n",
"--------------------------------------------------------------------\n",
"IN: [ItemInput(item='iron-ore', quantity=48)]\n",
"OUT: [ItemOutput(item='iron-plate', quantity=48, chance_to_get=1)]\n",
"15.0 prod/s\n",
"1.08 coal/s\n",
"--------------------------------------------------------------------\n"
]
}
],
"source": [
"print(\"--------------------------------------------------------------------\")\n",
"game_state.set_productivity_research_value(\"steel-plate\",0)\n",
"print(\"Classic steel smelting example\")\n",
"print(\"--------------------------------------------------------------------\")\n",
"ingredients, products, time_req, power_req = crafting_processor.run_recipe(\n",
" game_state.recipe_inventory.recipe_map[\"r_steel-plate\"], \n",
" game_state.station_inventory.station_map[\"steel-furnace\"])\n",
"print(f\"IN: {ingredients}\")\n",
"print(f\"OUT: {products}\")\n",
"print(f\"{products[0].quantity/time_req} prod/s\")\n",
"print(str(power_req/(time_req*game_state.item_inventory.item_map[\"coal\"].fuel_value_J))+\" coal/s\")\n",
"print(\"--------------------------------------------------------------------\")\n",
"\n",
"game_state.set_productivity_research_value(\"steel-plate\",5)\n",
"print(\"With level 5 of steel-plate productivity\")\n",
"print(\"--------------------------------------------------------------------\")\n",
"ingredients, products, time_req, power_req = crafting_processor.run_recipe(\n",
" game_state.recipe_inventory.recipe_map[\"r_steel-plate\"], \n",
" game_state.station_inventory.station_map[\"steel-furnace\"])\n",
"print(f\"IN: {ingredients}\")\n",
"print(f\"OUT: {products}\")\n",
"print(f\"{products[0].quantity/time_req} prod/s\")\n",
"print(str(power_req/(time_req*game_state.item_inventory.item_map[\"coal\"].fuel_value_J))+\" coal/s\")\n",
"print(\"--------------------------------------------------------------------\")\n",
"\n",
"game_state.set_productivity_research_value(\"steel-plate\",0)\n",
"print(\"basic smelting array that should compress a yellow belt\")\n",
"print(\"--------------------------------------------------------------------\")\n",
"ingredients, products, time_req, power_req = crafting_processor.run_recipe_in_multiple_parallel_stations(\n",
" game_state.recipe_inventory.recipe_map[\"r_iron-plate\"],\n",
" game_state.station_inventory.station_map[\"stone-furnace\"],\n",
" 48)\n",
"print(f\"IN: {ingredients}\")\n",
"print(f\"OUT: {products}\")\n",
"print(f\"{products[0].quantity/time_req} prod/s\")\n",
"print(str(power_req/(time_req*game_state.item_inventory.item_map[\"coal\"].fuel_value_J))+\" coal/s\")\n",
"print(\"--------------------------------------------------------------------\")"
]
},
{
"cell_type": "markdown",
"id": "5aeb99ea-8e24-4946-b1e4-da79d632d813",
"metadata": {},
"source": [
"# Exploring our options\n",
"\n",
"So, let's take a look at what we're working with here. But first, we need to input our global bonuses."
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "e8397e81-2206-429a-961d-2d253a894823",
"metadata": {},
"outputs": [],
"source": [
"game_state.set_productivity_research_value('steel-plate', 6)\n",
"game_state.set_productivity_research_value('low-density-structure', 2)\n",
"game_state.set_productivity_research_value('processing-unit', 2)"
]
},
{
"cell_type": "markdown",
"id": "8ac2692c-1817-4447-b079-3e54bccf3a40",
"metadata": {},
"source": [
"We also define a couple of helper functions for graph and table vizualization:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "ef02a223-6bf2-4cda-8eca-acac632a5cb3",
"metadata": {},
"outputs": [],
"source": [
"def fill_color_map(item_label):\n",
" if item_label in game_state.item_inventory.spoilables and item_label in game_state.item_inventory.fuels:\n",
" return 'springgreen'\n",
" elif item_label in game_state.item_inventory.spoilables:\n",
" return 'green'\n",
" elif item_label in game_state.item_inventory.fuels:\n",
" return 'gold'\n",
" else:\n",
" return 'lightgray'\n",
"\n",
"def draw_graph(nodes, edges, engine='sfdp'):\n",
" g = graphviz.Digraph(engine=engine)\n",
" g.attr(bgcolor=\"#232323\")\n",
" for n in nodes:\n",
" g.node(n, color=fill_color_map(n), style=\"filled\")\n",
" for a,b in edges:\n",
" g.edge(a,b, color=\"white\")\n",
" return g\n",
"\n",
"unit_prefixes = {\n",
" 0.0000000001: \"n\",\n",
" 0.000001: \"µ\",\n",
" 0.001: \"m\",\n",
" 1: \"\",\n",
" 1000: \"k\",\n",
" 1000000: \"M\",\n",
" 1000000000: \"G\",\n",
" 1000000000000: \"T\",\n",
" 1000000000000000: \"P\",\n",
"}\n",
"prefix_vals = [x for x in unit_prefixes]\n",
"\n",
"def get_unit(value, unit):\n",
" result = \"\"\n",
" if unit in [\"s\", \"min\", \"h\"]:\n",
" result = str(round(value,3))+\" \"+unit\n",
" else:\n",
" for i in range(1, len(prefix_vals)):\n",
" if prefix_vals[i-1]<=value and value<prefix_vals[i]:\n",
" result = str(round(value/prefix_vals[i-1],3))+\" \"+unit_prefixes[prefix_vals[i-1]]+unit \n",
" return result\n",
"\n",
"def get_image(item):\n",
" item_name = item\n",
" if item.startswith(\"user_\"):\n",
" item_name = item[5:]\n",
" underscored = item_name.replace('-', '_').capitalize() # this depends on factorio wiki and it should work\n",
" src = f\"https://wiki.factorio.com/images/thumb/{underscored}.png/32px-{underscored}.png\"\n",
" img = f'<img src=\"{src}\" alt=\"{item_name}\" title=\"{item_name}\" decoding=\"async\" width=\"32\" height=\"32\">'\n",
" return img\n",
"\n",
"def render_entity(item, strat):\n",
" result = \"\"\n",
" if strat==\"icon\":\n",
" result = get_image(item)\n",
" elif strat==\"full\":\n",
" result = item+\" \"+get_image(item)\n",
" elif strat==\"text\":\n",
" result = item\n",
" elif strat==\"icon_list\":\n",
" # f this\n",
" for i in item.split(\", \"):\n",
" if i == \"\":\n",
" continue\n",
" result+=get_image(i)\n",
" return result\n",
" \n",
"def dict_to_table(render_dict):\n",
" table = tabulate.tabulate([(render_entity(x,\"full\"),y) for x,y in render_dict.items()], tablefmt='unsafehtml') # YOLO\n",
" return table\n",
" \n",
"def dict_dict_to_table(render_dict, unit_map={}, entity_columns={}):\n",
" keys = [\"id\"]+list(render_dict[list(render_dict.keys())[0]].keys())\n",
" vals = [[k]+list(x.values()) for k,x in render_dict.items()]\n",
" for column, unit in unit_map.items():\n",
" if column in keys:\n",
" column_index = keys.index(column)\n",
" for row in vals:\n",
" row[column_index] = get_unit(row[column_index], unit)\n",
" for column, strat in entity_columns.items():\n",
" if column in keys:\n",
" column_index = keys.index(column)\n",
" for row in vals:\n",
" row[column_index] = render_entity(row[column_index], strat)\n",
" table = tabulate.tabulate(vals, headers=keys, tablefmt='unsafehtml') # YOLO\n",
" return table\n",
"\n",
"def display_table(table):\n",
" display(HTML(table))\n",
"\n",
"def render_station_requirements(srq):\n",
" dict_s = {x: srq[x].to_dict() for x in srq}\n",
" display_table(dict_dict_to_table(dict_s, unit_map={\"power\":\"W\", \"time\":\"s\"}, entity_columns={\"id\":\"full\", \"station\":\"icon\", \"modules\":\"icon_list\"}))"
]
},
{
"cell_type": "markdown",
"id": "a2131694-b66f-4009-a6bf-cad5238d14f3",
"metadata": {},
"source": [
"Then we can take a look at the glorious Gleba production tree."
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "2f05bb63-cba6-4469-8bf5-215f11eaee90",
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.43.0 (0)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1386pt\" height=\"967pt\"\n",
" viewBox=\"0.00 0.00 1386.04 967.19\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 963.19)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#232323\" stroke=\"transparent\" points=\"-4,4 -4,-963.19 1382.04,-963.19 1382.04,4 -4,4\"/>\n",
"<!-- iron&#45;bacteria -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>iron&#45;bacteria</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"767.41\" cy=\"-250.26\" rx=\"70.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"767.41\" y=\"-246.56\" font-family=\"Times,serif\" font-size=\"14.00\">iron&#45;bacteria</text>\n",
"</g>\n",
"<!-- iron&#45;bacteria&#45;&gt;iron&#45;bacteria -->\n",
"<g id=\"edge71\" class=\"edge\">\n",
"<title>iron&#45;bacteria&#45;&gt;iron&#45;bacteria</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M833.18,-256.74C846.27,-256.01 855.6,-253.85 855.6,-250.26 855.6,-247.69 850.78,-245.85 843.21,-244.75\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"843.47,-241.25 833.18,-243.79 842.8,-248.22 843.47,-241.25\"/>\n",
"</g>\n",
"<!-- iron&#45;ore -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>iron&#45;ore</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"852.28\" cy=\"-19.22\" rx=\"47.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"852.28\" y=\"-15.52\" font-family=\"Times,serif\" font-size=\"14.00\">iron&#45;ore</text>\n",
"</g>\n",
"<!-- iron&#45;bacteria&#45;&gt;iron&#45;ore -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>iron&#45;bacteria&#45;&gt;iron&#45;ore</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M774.07,-232.13C788.88,-191.81 824.63,-94.5 842.2,-46.68\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"845.49,-47.86 845.66,-37.26 838.92,-45.44 845.49,-47.86\"/>\n",
"</g>\n",
"<!-- iron&#45;plate -->\n",
"<g id=\"node27\" class=\"node\">\n",
"<title>iron&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"840.25\" cy=\"-170.51\" rx=\"55.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"840.25\" y=\"-166.81\" font-family=\"Times,serif\" font-size=\"14.00\">iron&#45;plate</text>\n",
"</g>\n",
"<!-- iron&#45;ore&#45;&gt;iron&#45;plate -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>iron&#45;ore&#45;&gt;iron&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M850.83,-37.47C848.76,-63.48 844.95,-111.46 842.5,-142.13\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"839.01,-141.95 841.7,-152.2 845.99,-142.5 839.01,-141.95\"/>\n",
"</g>\n",
"<!-- copper&#45;bacteria -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>copper&#45;bacteria</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"993.73\" cy=\"-764.77\" rx=\"83.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"993.73\" y=\"-761.07\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;bacteria</text>\n",
"</g>\n",
"<!-- copper&#45;bacteria&#45;&gt;copper&#45;bacteria -->\n",
"<g id=\"edge73\" class=\"edge\">\n",
"<title>copper&#45;bacteria&#45;&gt;copper&#45;bacteria</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1071.8,-771.1C1085.44,-770.26 1094.93,-768.15 1094.93,-764.77 1094.93,-762.32 1089.92,-760.54 1081.95,-759.42\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1082.09,-755.92 1071.8,-758.45 1081.42,-762.89 1082.09,-755.92\"/>\n",
"</g>\n",
"<!-- copper&#45;ore -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>copper&#45;ore</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1257.29\" cy=\"-761.43\" rx=\"60.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1257.29\" y=\"-757.73\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;ore</text>\n",
"</g>\n",
"<!-- copper&#45;bacteria&#45;&gt;copper&#45;ore -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>copper&#45;bacteria&#45;&gt;copper&#45;ore</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1077.13,-763.71C1112.25,-763.27 1152.7,-762.75 1186.36,-762.33\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1186.63,-765.82 1196.58,-762.2 1186.54,-758.82 1186.63,-765.82\"/>\n",
"</g>\n",
"<!-- copper&#45;plate -->\n",
"<g id=\"node29\" class=\"node\">\n",
"<title>copper&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1309.15\" cy=\"-557.06\" rx=\"68.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1309.15\" y=\"-553.36\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;plate</text>\n",
"</g>\n",
"<!-- copper&#45;ore&#45;&gt;copper&#45;plate -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>copper&#45;ore&#45;&gt;copper&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1261.9,-743.29C1270.99,-707.46 1291.3,-627.4 1302.09,-584.87\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1305.49,-585.71 1304.56,-575.15 1298.71,-583.99 1305.49,-585.71\"/>\n",
"</g>\n",
"<!-- yumako -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>yumako</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"290.46\" cy=\"-642.12\" rx=\"46.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"290.46\" y=\"-638.42\" font-family=\"Times,serif\" font-size=\"14.00\">yumako</text>\n",
"</g>\n",
"<!-- spoilage -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>spoilage</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"487.6\" cy=\"-617.93\" rx=\"49.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"487.6\" y=\"-614.23\" font-family=\"Times,serif\" font-size=\"14.00\">spoilage</text>\n",
"</g>\n",
"<!-- yumako&#45;&gt;spoilage -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>yumako&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M335.2,-636.63C363.47,-633.17 400.26,-628.65 430.61,-624.92\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"431.14,-628.39 440.64,-623.69 430.29,-621.44 431.14,-628.39\"/>\n",
"</g>\n",
"<!-- yumako&#45;mash -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>yumako&#45;mash</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"554.68\" cy=\"-674.27\" rx=\"74.99\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"554.68\" y=\"-670.57\" font-family=\"Times,serif\" font-size=\"14.00\">yumako&#45;mash</text>\n",
"</g>\n",
"<!-- yumako&#45;&gt;yumako&#45;mash -->\n",
"<g id=\"edge53\" class=\"edge\">\n",
"<title>yumako&#45;&gt;yumako&#45;mash</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M335.28,-647.58C374.24,-652.32 431.52,-659.29 477.79,-664.92\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"477.43,-668.4 487.78,-666.13 478.28,-661.45 477.43,-668.4\"/>\n",
"</g>\n",
"<!-- yumako&#45;seed -->\n",
"<g id=\"node21\" class=\"node\">\n",
"<title>yumako&#45;seed</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"71.49\" cy=\"-526.32\" rx=\"71.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"71.49\" y=\"-522.62\" font-family=\"Times,serif\" font-size=\"14.00\">yumako&#45;seed</text>\n",
"</g>\n",
"<!-- yumako&#45;&gt;yumako&#45;seed -->\n",
"<g id=\"edge54\" class=\"edge\">\n",
"<title>yumako&#45;&gt;yumako&#45;seed</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M269.07,-625.87C234.82,-604.72 166.89,-568.33 120.32,-545.78\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"121.55,-542.49 111.01,-541.33 118.52,-548.8 121.55,-542.49\"/>\n",
"</g>\n",
"<!-- nutrients -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>nutrients</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"437.5\" cy=\"-447.81\" rx=\"53.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"437.5\" y=\"-444.11\" font-family=\"Times,serif\" font-size=\"14.00\">nutrients</text>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;nutrients -->\n",
"<g id=\"edge74\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;nutrients</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M486.68,-599.8C481,-569.97 463.8,-510.41 451.06,-475.35\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"454.24,-473.86 447.43,-465.74 447.69,-476.33 454.24,-473.86\"/>\n",
"</g>\n",
"<!-- carbon -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>carbon</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"398.12\" cy=\"-883.92\" rx=\"42.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"398.12\" y=\"-880.22\" font-family=\"Times,serif\" font-size=\"14.00\">carbon</text>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;carbon -->\n",
"<g id=\"edge77\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;carbon</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M481.45,-636.21C466.05,-681.97 425.79,-801.67 407.45,-856.17\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"404.06,-855.26 404.19,-865.86 410.7,-857.49 404.06,-855.26\"/>\n",
"</g>\n",
"<!-- sulfur -->\n",
"<g id=\"node38\" class=\"node\">\n",
"<title>sulfur</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"660.93\" cy=\"-519.2\" rx=\"38.19\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"660.93\" y=\"-515.5\" font-family=\"Times,serif\" font-size=\"14.00\">sulfur</text>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;sulfur -->\n",
"<g id=\"edge69\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;sulfur</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M514.3,-602.72C544.77,-585.37 594.63,-556.96 627.62,-538.17\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"629.49,-541.14 636.44,-533.15 626.02,-535.06 629.49,-541.14\"/>\n",
"</g>\n",
"<!-- agricultural&#45;tower -->\n",
"<g id=\"node42\" class=\"node\">\n",
"<title>agricultural&#45;tower</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"647.59\" cy=\"-344.51\" rx=\"94.78\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"647.59\" y=\"-340.81\" font-family=\"Times,serif\" font-size=\"14.00\">agricultural&#45;tower</text>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;agricultural&#45;tower -->\n",
"<g id=\"edge42\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;agricultural&#45;tower</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M498.1,-599.99C525.5,-553.16 599.32,-427 631.85,-371.42\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"635.03,-372.92 637.06,-362.52 628.99,-369.38 635.03,-372.92\"/>\n",
"</g>\n",
"<!-- jellynut -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>jellynut</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"325.38\" cy=\"-764.48\" rx=\"46.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"325.38\" y=\"-760.78\" font-family=\"Times,serif\" font-size=\"14.00\">jellynut</text>\n",
"</g>\n",
"<!-- jellynut&#45;&gt;spoilage -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>jellynut&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M343.68,-747.95C372.44,-721.96 428.37,-671.44 461.4,-641.6\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"463.8,-644.15 468.87,-634.85 459.11,-638.95 463.8,-644.15\"/>\n",
"</g>\n",
"<!-- jelly -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>jelly</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"568.98\" cy=\"-755.31\" rx=\"30.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"568.98\" y=\"-751.61\" font-family=\"Times,serif\" font-size=\"14.00\">jelly</text>\n",
"</g>\n",
"<!-- jellynut&#45;&gt;jelly -->\n",
"<g id=\"edge55\" class=\"edge\">\n",
"<title>jellynut&#45;&gt;jelly</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M371.49,-762.74C416.73,-761.04 485.04,-758.47 528.31,-756.84\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"528.61,-760.33 538.47,-756.46 528.35,-753.34 528.61,-760.33\"/>\n",
"</g>\n",
"<!-- jellynut&#45;seed -->\n",
"<g id=\"node22\" class=\"node\">\n",
"<title>jellynut&#45;seed</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"118.5\" cy=\"-681.69\" rx=\"70.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"118.5\" y=\"-677.99\" font-family=\"Times,serif\" font-size=\"14.00\">jellynut&#45;seed</text>\n",
"</g>\n",
"<!-- jellynut&#45;&gt;jellynut&#45;seed -->\n",
"<g id=\"edge56\" class=\"edge\">\n",
"<title>jellynut&#45;&gt;jellynut&#45;seed</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M300.1,-749.26C269.45,-734.7 216.92,-713.2 176.21,-698.26\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"177.25,-694.92 166.66,-694.8 174.87,-701.5 177.25,-694.92\"/>\n",
"</g>\n",
"<!-- jelly&#45;&gt;spoilage -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>jelly&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M558.84,-738.19C544.9,-714.67 519.71,-672.13 503.32,-644.47\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"506.24,-642.52 498.13,-635.7 500.21,-646.09 506.24,-642.52\"/>\n",
"</g>\n",
"<!-- bioflux -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>bioflux</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"689.34\" cy=\"-581.92\" rx=\"42.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"689.34\" y=\"-578.22\" font-family=\"Times,serif\" font-size=\"14.00\">bioflux</text>\n",
"</g>\n",
"<!-- jelly&#45;&gt;bioflux -->\n",
"<g id=\"edge57\" class=\"edge\">\n",
"<title>jelly&#45;&gt;bioflux</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M580.74,-738.37C601.9,-707.89 646.5,-643.64 671.46,-607.68\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"674.53,-609.4 677.35,-599.19 668.78,-605.4 674.53,-609.4\"/>\n",
"</g>\n",
"<!-- rocket&#45;fuel -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>rocket&#45;fuel</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"782.12\" cy=\"-667.75\" rx=\"60.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"782.12\" y=\"-664.05\" font-family=\"Times,serif\" font-size=\"14.00\">rocket&#45;fuel</text>\n",
"</g>\n",
"<!-- jelly&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge64\" class=\"edge\">\n",
"<title>jelly&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M594.27,-744.92C629.43,-730.48 693.66,-704.09 737.11,-686.24\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"738.67,-689.38 746.59,-682.34 736.01,-682.91 738.67,-689.38\"/>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;spoilage -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M533.82,-656.75C527.87,-651.76 521.3,-646.24 515.02,-640.96\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"517.21,-638.23 507.3,-634.48 512.7,-643.59 517.21,-638.23\"/>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;bioflux -->\n",
"<g id=\"edge58\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;bioflux</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M579.69,-657.12C601.91,-641.88 634.47,-619.55 658.34,-603.18\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"660.43,-605.99 666.7,-597.45 656.47,-600.21 660.43,-605.99\"/>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;nutrients -->\n",
"<g id=\"edge75\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;nutrients</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M545.29,-656.12C524.71,-616.35 475.56,-521.36 451.39,-474.66\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"454.48,-473 446.77,-465.73 448.26,-476.22 454.48,-473\"/>\n",
"</g>\n",
"<!-- plastic&#45;bar -->\n",
"<g id=\"node32\" class=\"node\">\n",
"<title>plastic&#45;bar</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"878.31\" cy=\"-576.99\" rx=\"59.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"878.31\" y=\"-573.29\" font-family=\"Times,serif\" font-size=\"14.00\">plastic&#45;bar</text>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;plastic&#45;bar -->\n",
"<g id=\"edge67\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;plastic&#45;bar</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M601.74,-660.13C661.48,-642.17 764.21,-611.29 826.24,-592.64\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"827.27,-595.99 835.84,-589.76 825.25,-589.29 827.27,-595.99\"/>\n",
"</g>\n",
"<!-- carbon&#45;fiber -->\n",
"<g id=\"node44\" class=\"node\">\n",
"<title>carbon&#45;fiber</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"494.29\" cy=\"-941.19\" rx=\"66.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"494.29\" y=\"-937.49\" font-family=\"Times,serif\" font-size=\"14.00\">carbon&#45;fiber</text>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;carbon&#45;fiber -->\n",
"<g id=\"edge62\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;carbon&#45;fiber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M550.53,-692.62C540.16,-738.44 513.07,-858.16 500.66,-913\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"497.18,-912.54 498.39,-923.07 504.01,-914.08 497.18,-912.54\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;iron&#45;bacteria -->\n",
"<g id=\"edge70\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;iron&#45;bacteria</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M693.65,-563.62C706.58,-508.69 745.11,-344.98 760.73,-278.65\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"764.23,-279.05 763.11,-268.51 757.41,-277.44 764.23,-279.05\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;copper&#45;bacteria -->\n",
"<g id=\"edge72\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;copper&#45;bacteria</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M713.99,-596.73C767.28,-628.74 893.46,-704.53 956.52,-742.42\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"954.97,-745.57 965.35,-747.72 958.58,-739.57 954.97,-745.57\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;spoilage -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M649.96,-588.95C619.31,-594.42 576.4,-602.08 542.39,-608.15\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"541.37,-604.78 532.14,-609.98 542.6,-611.67 541.37,-604.78\"/>\n",
"</g>\n",
"<!-- agricultural&#45;science&#45;pack -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>agricultural&#45;science&#45;pack</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"517.26\" cy=\"-469.29\" rx=\"126.98\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"517.26\" y=\"-465.59\" font-family=\"Times,serif\" font-size=\"14.00\">agricultural&#45;science&#45;pack</text>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;agricultural&#45;science&#45;pack -->\n",
"<g id=\"edge59\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;agricultural&#45;science&#45;pack</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M666.13,-566.73C637.08,-547.71 587.01,-514.94 553.03,-492.71\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"554.62,-489.57 544.34,-487.02 550.79,-495.42 554.62,-489.57\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;nutrients -->\n",
"<g id=\"edge76\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;nutrients</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M662.87,-567.82C617.95,-543.9 526.7,-495.31 475.15,-467.86\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"476.78,-464.76 466.31,-463.15 473.49,-470.94 476.78,-464.76\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge63\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M707.23,-598.47C720.95,-611.16 740.1,-628.88 755.6,-643.22\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"753.61,-646.14 763.33,-650.37 758.37,-641.01 753.61,-646.14\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;plastic&#45;bar -->\n",
"<g id=\"edge66\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;plastic&#45;bar</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M731.75,-580.81C754.32,-580.22 782.67,-579.49 808.4,-578.82\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"808.58,-582.31 818.49,-578.55 808.4,-575.31 808.58,-582.31\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;sulfur -->\n",
"<g id=\"edge68\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;sulfur</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M681.28,-564.11C678.74,-558.5 675.87,-552.18 673.11,-546.08\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"676.23,-544.5 668.92,-536.83 669.86,-547.38 676.23,-544.5\"/>\n",
"</g>\n",
"<!-- pentapod&#45;egg -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>pentapod&#45;egg</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"491.39\" cy=\"-263.92\" rx=\"74.19\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"491.39\" y=\"-260.22\" font-family=\"Times,serif\" font-size=\"14.00\">pentapod&#45;egg</text>\n",
"</g>\n",
"<!-- pentapod&#45;egg&#45;&gt;pentapod&#45;egg -->\n",
"<g id=\"edge50\" class=\"edge\">\n",
"<title>pentapod&#45;egg&#45;&gt;pentapod&#45;egg</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M560.86,-270.35C574.11,-269.58 583.48,-267.44 583.48,-263.92 583.48,-261.39 578.64,-259.58 571,-258.47\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"571.15,-254.97 560.86,-257.49 570.48,-261.93 571.15,-254.97\"/>\n",
"</g>\n",
"<!-- danger -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>danger</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"388.26\" cy=\"-18\" rx=\"43.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"388.26\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">danger</text>\n",
"</g>\n",
"<!-- pentapod&#45;egg&#45;&gt;danger -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>pentapod&#45;egg&#45;&gt;danger</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M483.8,-245.84C465.88,-203.1 420.82,-95.65 399.62,-45.09\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"402.81,-43.65 395.72,-35.78 396.36,-46.35 402.81,-43.65\"/>\n",
"</g>\n",
"<!-- pentapod&#45;egg&#45;&gt;agricultural&#45;science&#45;pack -->\n",
"<g id=\"edge60\" class=\"edge\">\n",
"<title>pentapod&#45;egg&#45;&gt;agricultural&#45;science&#45;pack</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M493.68,-282.15C498.21,-318.07 508.31,-398.26 513.7,-441.08\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"510.24,-441.63 514.97,-451.11 517.19,-440.75 510.24,-441.63\"/>\n",
"</g>\n",
"<!-- biochamber -->\n",
"<g id=\"node43\" class=\"node\">\n",
"<title>biochamber</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"613.59\" cy=\"-231.94\" rx=\"65.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"613.59\" y=\"-228.24\" font-family=\"Times,serif\" font-size=\"14.00\">biochamber</text>\n",
"</g>\n",
"<!-- pentapod&#45;egg&#45;&gt;biochamber -->\n",
"<g id=\"edge47\" class=\"edge\">\n",
"<title>pentapod&#45;egg&#45;&gt;biochamber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M541.8,-250.73C546.56,-249.48 551.41,-248.21 556.23,-246.95\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"557.26,-250.3 566.05,-244.38 555.49,-243.53 557.26,-250.3\"/>\n",
"</g>\n",
"<!-- agricultural&#45;science&#45;pack&#45;&gt;spoilage -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>agricultural&#45;science&#45;pack&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M513.62,-487.52C508.53,-513.04 499.23,-559.65 493.23,-589.69\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"489.79,-589.06 491.27,-599.56 496.65,-590.43 489.79,-589.06\"/>\n",
"</g>\n",
"<!-- nutrients&#45;&gt;spoilage -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>nutrients&#45;&gt;spoilage</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M438.42,-465.94C444.12,-495.85 461.39,-555.64 474.14,-590.66\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"470.96,-592.14 477.77,-600.26 477.5,-589.67 470.96,-592.14\"/>\n",
"</g>\n",
"<!-- nutrients&#45;&gt;pentapod&#45;egg -->\n",
"<g id=\"edge49\" class=\"edge\">\n",
"<title>nutrients&#45;&gt;pentapod&#45;egg</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M442.76,-429.84C452.18,-397.71 471.97,-330.18 483.18,-291.92\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"486.65,-292.54 486.1,-281.96 479.93,-290.57 486.65,-292.54\"/>\n",
"</g>\n",
"<!-- artificial&#45;yumako&#45;soil -->\n",
"<g id=\"node40\" class=\"node\">\n",
"<title>artificial&#45;yumako&#45;soil</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"193.71\" cy=\"-365.32\" rx=\"107.48\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"193.71\" y=\"-361.62\" font-family=\"Times,serif\" font-size=\"14.00\">artificial&#45;yumako&#45;soil</text>\n",
"</g>\n",
"<!-- nutrients&#45;&gt;artificial&#45;yumako&#45;soil -->\n",
"<g id=\"edge34\" class=\"edge\">\n",
"<title>nutrients&#45;&gt;artificial&#45;yumako&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M399.41,-434.92C359.65,-421.47 296.84,-400.21 251.08,-384.73\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"252.18,-381.41 241.58,-381.52 249.94,-388.04 252.18,-381.41\"/>\n",
"</g>\n",
"<!-- artificial&#45;jellynut&#45;soil -->\n",
"<g id=\"node41\" class=\"node\">\n",
"<title>artificial&#45;jellynut&#45;soil</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"214.22\" cy=\"-461.49\" rx=\"106.68\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"214.22\" y=\"-457.79\" font-family=\"Times,serif\" font-size=\"14.00\">artificial&#45;jellynut&#45;soil</text>\n",
"</g>\n",
"<!-- nutrients&#45;&gt;artificial&#45;jellynut&#45;soil -->\n",
"<g id=\"edge37\" class=\"edge\">\n",
"<title>nutrients&#45;&gt;artificial&#45;jellynut&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M384.3,-451.07C366.34,-452.17 345.58,-453.44 324.86,-454.71\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"324.47,-451.23 314.7,-455.33 324.9,-458.21 324.47,-451.23\"/>\n",
"</g>\n",
"<!-- nutrients&#45;&gt;biochamber -->\n",
"<g id=\"edge46\" class=\"edge\">\n",
"<title>nutrients&#45;&gt;biochamber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M451.91,-430.14C483.01,-392.02 556.52,-301.9 592.72,-257.53\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"595.62,-259.51 599.23,-249.54 590.2,-255.08 595.62,-259.51\"/>\n",
"</g>\n",
"<!-- wood -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>wood</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"975.1\" cy=\"-112\" rx=\"35.19\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"975.1\" y=\"-108.3\" font-family=\"Times,serif\" font-size=\"14.00\">wood</text>\n",
"</g>\n",
"<!-- carbon&#45;&gt;carbon&#45;fiber -->\n",
"<g id=\"edge61\" class=\"edge\">\n",
"<title>carbon&#45;&gt;carbon&#45;fiber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M422.88,-898.66C433.53,-905 446.18,-912.54 457.86,-919.49\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"456.17,-922.56 466.55,-924.67 459.75,-916.55 456.17,-922.56\"/>\n",
"</g>\n",
"<!-- coal -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>coal</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"1110.25\" cy=\"-112\" rx=\"29.5\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1110.25\" y=\"-108.3\" font-family=\"Times,serif\" font-size=\"14.00\">coal</text>\n",
"</g>\n",
"<!-- solid&#45;fuel -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>solid&#45;fuel</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"805.3\" cy=\"-817\" rx=\"53.09\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"805.3\" y=\"-813.3\" font-family=\"Times,serif\" font-size=\"14.00\">solid&#45;fuel</text>\n",
"</g>\n",
"<!-- rocket&#45;part -->\n",
"<g id=\"node37\" class=\"node\">\n",
"<title>rocket&#45;part</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1024.42\" cy=\"-624.25\" rx=\"62.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1024.42\" y=\"-620.55\" font-family=\"Times,serif\" font-size=\"14.00\">rocket&#45;part</text>\n",
"</g>\n",
"<!-- rocket&#45;fuel&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge29\" class=\"edge\">\n",
"<title>rocket&#45;fuel&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M834.1,-658.42C871.32,-651.73 921.65,-642.7 961.2,-635.6\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"962.05,-639 971.27,-633.79 960.81,-632.11 962.05,-639\"/>\n",
"</g>\n",
"<!-- nuclear&#45;fuel -->\n",
"<g id=\"node20\" class=\"node\">\n",
"<title>nuclear&#45;fuel</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"1052.64\" cy=\"-206\" rx=\"65.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1052.64\" y=\"-202.3\" font-family=\"Times,serif\" font-size=\"14.00\">nuclear&#45;fuel</text>\n",
"</g>\n",
"<!-- yumako&#45;seed&#45;&gt;yumako -->\n",
"<g id=\"edge51\" class=\"edge\">\n",
"<title>yumako&#45;seed&#45;&gt;yumako</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M94.51,-543.58C130.68,-565.73 201.3,-603.42 247.17,-625.33\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"245.74,-628.52 256.27,-629.62 248.72,-622.19 245.74,-628.52\"/>\n",
"</g>\n",
"<!-- yumako&#45;seed&#45;&gt;artificial&#45;yumako&#45;soil -->\n",
"<g id=\"edge35\" class=\"edge\">\n",
"<title>yumako&#45;seed&#45;&gt;artificial&#45;yumako&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M85.04,-508.48C106.61,-480.07 148.85,-424.41 173.84,-391.49\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"176.85,-393.33 180.1,-383.24 171.27,-389.09 176.85,-393.33\"/>\n",
"</g>\n",
"<!-- jellynut&#45;seed&#45;&gt;jellynut -->\n",
"<g id=\"edge52\" class=\"edge\">\n",
"<title>jellynut&#45;seed&#45;&gt;jellynut</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M146.75,-698.3C180.13,-713.94 236.19,-736.67 276.63,-751.16\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"275.69,-754.54 286.29,-754.56 278.02,-747.94 275.69,-754.54\"/>\n",
"</g>\n",
"<!-- jellynut&#45;seed&#45;&gt;artificial&#45;jellynut&#45;soil -->\n",
"<g id=\"edge38\" class=\"edge\">\n",
"<title>jellynut&#45;seed&#45;&gt;artificial&#45;jellynut&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M126.33,-663.67C143.09,-625.11 182.53,-534.38 202.38,-488.73\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"205.63,-490.02 206.41,-479.45 199.21,-487.23 205.63,-490.02\"/>\n",
"</g>\n",
"<!-- tree&#45;seed -->\n",
"<g id=\"node23\" class=\"node\">\n",
"<title>tree&#45;seed</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"570.95\" cy=\"-159\" rx=\"53.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"570.95\" y=\"-155.3\" font-family=\"Times,serif\" font-size=\"14.00\">tree&#45;seed</text>\n",
"</g>\n",
"<!-- biter&#45;egg -->\n",
"<g id=\"node24\" class=\"node\">\n",
"<title>biter&#45;egg</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"758.3\" cy=\"-112\" rx=\"53.09\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"758.3\" y=\"-108.3\" font-family=\"Times,serif\" font-size=\"14.00\">biter&#45;egg</text>\n",
"</g>\n",
"<!-- stone -->\n",
"<g id=\"node25\" class=\"node\">\n",
"<title>stone</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"156.24\" cy=\"-74.61\" rx=\"36.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"156.24\" y=\"-70.91\" font-family=\"Times,serif\" font-size=\"14.00\">stone</text>\n",
"</g>\n",
"<!-- landfill -->\n",
"<g id=\"node26\" class=\"node\">\n",
"<title>landfill</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"349.52\" cy=\"-255.76\" rx=\"42.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"349.52\" y=\"-252.06\" font-family=\"Times,serif\" font-size=\"14.00\">landfill</text>\n",
"</g>\n",
"<!-- stone&#45;&gt;landfill -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>stone&#45;&gt;landfill</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M173.39,-90.69C207.6,-122.75 284.46,-194.78 324.38,-232.2\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"322.16,-234.91 331.85,-239.19 326.95,-229.8 322.16,-234.91\"/>\n",
"</g>\n",
"<!-- landfill&#45;&gt;artificial&#45;yumako&#45;soil -->\n",
"<g id=\"edge33\" class=\"edge\">\n",
"<title>landfill&#45;&gt;artificial&#45;yumako&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M327.53,-271.22C301.42,-289.58 257.6,-320.4 227.25,-341.74\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"224.85,-339.14 218.68,-347.76 228.88,-344.87 224.85,-339.14\"/>\n",
"</g>\n",
"<!-- landfill&#45;&gt;artificial&#45;jellynut&#45;soil -->\n",
"<g id=\"edge36\" class=\"edge\">\n",
"<title>landfill&#45;&gt;artificial&#45;jellynut&#45;soil</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M337.99,-273.3C314.24,-309.4 259.78,-392.22 231.68,-434.93\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"228.68,-433.13 226.11,-443.41 234.53,-436.97 228.68,-433.13\"/>\n",
"</g>\n",
"<!-- landfill&#45;&gt;agricultural&#45;tower -->\n",
"<g id=\"edge39\" class=\"edge\">\n",
"<title>landfill&#45;&gt;agricultural&#45;tower</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M384.3,-266.11C433.83,-280.86 525.45,-308.14 586.47,-326.31\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"585.78,-329.76 596.36,-329.26 587.78,-323.05 585.78,-329.76\"/>\n",
"</g>\n",
"<!-- landfill&#45;&gt;biochamber -->\n",
"<g id=\"edge43\" class=\"edge\">\n",
"<title>landfill&#45;&gt;biochamber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M391.07,-252.01C431.21,-248.39 492.84,-242.83 541.08,-238.48\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"541.51,-241.95 551.15,-237.57 540.88,-234.98 541.51,-241.95\"/>\n",
"</g>\n",
"<!-- steel&#45;plate -->\n",
"<g id=\"node28\" class=\"node\">\n",
"<title>steel&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"929.14\" cy=\"-338.81\" rx=\"59.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"929.14\" y=\"-335.11\" font-family=\"Times,serif\" font-size=\"14.00\">steel&#45;plate</text>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;steel&#45;plate -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;steel&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M849.76,-188.52C865.4,-218.13 896.62,-277.25 914.9,-311.86\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"911.93,-313.72 919.69,-320.93 918.12,-310.45 911.93,-313.72\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit -->\n",
"<g id=\"node31\" class=\"node\">\n",
"<title>electronic&#45;circuit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"920.52\" cy=\"-273.5\" rx=\"89.08\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"920.52\" y=\"-269.8\" font-family=\"Times,serif\" font-size=\"14.00\">electronic&#45;circuit</text>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;electronic&#45;circuit -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;electronic&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M853.86,-187.98C866.59,-204.3 885.74,-228.88 900.26,-247.51\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"897.65,-249.86 906.56,-255.59 903.18,-245.56 897.65,-249.86\"/>\n",
"</g>\n",
"<!-- sulfuric&#45;acid -->\n",
"<g id=\"node34\" class=\"node\">\n",
"<title>sulfuric&#45;acid</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"831.37\" cy=\"-371.27\" rx=\"67.69\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"831.37\" y=\"-367.57\" font-family=\"Times,serif\" font-size=\"14.00\">sulfuric&#45;acid</text>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge30\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M839.44,-188.68C837.89,-223.75 834.47,-301.01 832.62,-342.91\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"829.12,-342.85 832.17,-352.99 836.11,-343.16 829.12,-342.85\"/>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;biochamber -->\n",
"<g id=\"edge44\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;biochamber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M797.35,-182.14C761.38,-191.88 709.73,-205.88 670.35,-216.56\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"669.35,-213.2 660.61,-219.19 671.18,-219.96 669.35,-213.2\"/>\n",
"</g>\n",
"<!-- low&#45;density&#45;structure -->\n",
"<g id=\"node36\" class=\"node\">\n",
"<title>low&#45;density&#45;structure</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1107.95\" cy=\"-528.29\" rx=\"110.48\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1107.95\" y=\"-524.59\" font-family=\"Times,serif\" font-size=\"14.00\">low&#45;density&#45;structure</text>\n",
"</g>\n",
"<!-- steel&#45;plate&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge26\" class=\"edge\">\n",
"<title>steel&#45;plate&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M945.64,-356.3C977.41,-389.97 1047.19,-463.92 1084.05,-502.97\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1081.56,-505.43 1090.96,-510.3 1086.65,-500.62 1081.56,-505.43\"/>\n",
"</g>\n",
"<!-- steel&#45;plate&#45;&gt;agricultural&#45;tower -->\n",
"<g id=\"edge40\" class=\"edge\">\n",
"<title>steel&#45;plate&#45;&gt;agricultural&#45;tower</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M869.43,-340.02C835.43,-340.71 791.85,-341.59 752.33,-342.39\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"752.04,-338.9 742.11,-342.6 752.18,-345.89 752.04,-338.9\"/>\n",
"</g>\n",
"<!-- copper&#45;cable -->\n",
"<g id=\"node30\" class=\"node\">\n",
"<title>copper&#45;cable</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1209.66\" cy=\"-350.02\" rx=\"69.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1209.66\" y=\"-346.32\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;cable</text>\n",
"</g>\n",
"<!-- copper&#45;plate&#45;&gt;copper&#45;cable -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>copper&#45;plate&#45;&gt;copper&#45;cable</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1300.5,-539.05C1283,-502.64 1243.35,-420.13 1222.71,-377.17\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1225.86,-375.63 1218.37,-368.13 1219.55,-378.66 1225.86,-375.63\"/>\n",
"</g>\n",
"<!-- copper&#45;plate&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge24\" class=\"edge\">\n",
"<title>copper&#45;plate&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1248.51,-548.39C1233.56,-546.25 1217.21,-543.91 1201.11,-541.61\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1201.53,-538.14 1191.13,-540.19 1200.54,-545.07 1201.53,-538.14\"/>\n",
"</g>\n",
"<!-- copper&#45;cable&#45;&gt;electronic&#45;circuit -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>copper&#45;cable&#45;&gt;electronic&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1160.94,-337.12C1112.46,-324.29 1037.79,-304.53 984.54,-290.44\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"985.42,-287.05 974.86,-287.88 983.63,-293.82 985.42,-287.05\"/>\n",
"</g>\n",
"<!-- advanced&#45;circuit -->\n",
"<g id=\"node33\" class=\"node\">\n",
"<title>advanced&#45;circuit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1080.93\" cy=\"-386.97\" rx=\"87.18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1080.93\" y=\"-383.27\" font-family=\"Times,serif\" font-size=\"14.00\">advanced&#45;circuit</text>\n",
"</g>\n",
"<!-- copper&#45;cable&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>copper&#45;cable&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1162.82,-363.46C1155.91,-365.45 1148.69,-367.52 1141.54,-369.57\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1140.51,-366.23 1131.86,-372.35 1142.44,-372.96 1140.51,-366.23\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge19\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M945.23,-290.98C972.86,-310.53 1017.74,-342.27 1048.25,-363.86\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1046.27,-366.74 1056.45,-369.66 1050.31,-361.02 1046.27,-366.74\"/>\n",
"</g>\n",
"<!-- processing&#45;unit -->\n",
"<g id=\"node35\" class=\"node\">\n",
"<title>processing&#45;unit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"1015.78\" cy=\"-425.25\" rx=\"82.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"1015.78\" y=\"-421.55\" font-family=\"Times,serif\" font-size=\"14.00\">processing&#45;unit</text>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge22\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M931.82,-291.5C948.51,-318.08 979.84,-368 999.15,-398.76\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"996.21,-400.66 1004.49,-407.27 1002.14,-396.94 996.21,-400.66\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;agricultural&#45;tower -->\n",
"<g id=\"edge41\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;agricultural&#45;tower</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M865.61,-287.78C821.73,-299.2 760.06,-315.25 713.51,-327.36\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"712.61,-323.98 703.81,-329.88 714.37,-330.75 712.61,-323.98\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;biochamber -->\n",
"<g id=\"edge45\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;biochamber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M846.22,-263.44C796.53,-256.71 731.59,-247.91 682.96,-241.33\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"683.22,-237.83 672.84,-239.96 682.28,-244.77 683.22,-237.83\"/>\n",
"</g>\n",
"<!-- plastic&#45;bar&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge20\" class=\"edge\">\n",
"<title>plastic&#45;bar&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M896.65,-559.79C932.69,-525.99 1012.87,-450.8 1054.58,-411.69\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1057,-414.21 1061.9,-404.82 1052.21,-409.11 1057,-414.21\"/>\n",
"</g>\n",
"<!-- plastic&#45;bar&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge25\" class=\"edge\">\n",
"<title>plastic&#45;bar&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M927.29,-566.61C957.26,-560.25 996.27,-551.98 1030.37,-544.75\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1031.26,-548.14 1040.31,-542.64 1029.8,-541.29 1031.26,-548.14\"/>\n",
"</g>\n",
"<!-- advanced&#45;circuit&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge23\" class=\"edge\">\n",
"<title>advanced&#45;circuit&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1051.79,-404.09C1051.64,-404.18 1051.5,-404.26 1051.35,-404.35\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1051.7,-400.09 1044.85,-408.17 1055.25,-406.12 1051.7,-400.09\"/>\n",
"</g>\n",
"<!-- sulfuric&#45;acid&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge21\" class=\"edge\">\n",
"<title>sulfuric&#45;acid&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M876.95,-384.61C900.97,-391.64 930.73,-400.35 956.52,-407.9\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"955.61,-411.28 966.19,-410.73 957.58,-404.56 955.61,-411.28\"/>\n",
"</g>\n",
"<!-- processing&#45;unit&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge28\" class=\"edge\">\n",
"<title>processing&#45;unit&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1016.56,-443.26C1018.07,-478.03 1021.4,-554.6 1023.2,-596.14\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1019.71,-596.3 1023.64,-606.13 1026.7,-595.99 1019.71,-596.3\"/>\n",
"</g>\n",
"<!-- low&#45;density&#45;structure&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge27\" class=\"edge\">\n",
"<title>low&#45;density&#45;structure&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M1092.24,-546.34C1079.32,-561.18 1060.87,-582.37 1046.48,-598.91\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"1043.71,-596.76 1039.78,-606.61 1048.99,-601.36 1043.71,-596.76\"/>\n",
"</g>\n",
"<!-- sulfur&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge31\" class=\"edge\">\n",
"<title>sulfur&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M679.5,-503.08C709.45,-477.09 768.61,-425.74 803.59,-395.37\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"806.26,-397.7 811.51,-388.5 801.67,-392.41 806.26,-397.7\"/>\n",
"</g>\n",
"<!-- water -->\n",
"<g id=\"node39\" class=\"node\">\n",
"<title>water</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"693.44\" cy=\"-427.8\" rx=\"37.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"693.44\" y=\"-424.1\" font-family=\"Times,serif\" font-size=\"14.00\">water</text>\n",
"</g>\n",
"<!-- water&#45;&gt;pentapod&#45;egg -->\n",
"<g id=\"edge48\" class=\"edge\">\n",
"<title>water&#45;&gt;pentapod&#45;egg</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M674.06,-412.09C638.5,-383.25 562.64,-321.71 520.73,-287.72\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"522.79,-284.88 512.82,-281.3 518.38,-290.32 522.79,-284.88\"/>\n",
"</g>\n",
"<!-- water&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge65\" class=\"edge\">\n",
"<title>water&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M700.1,-445.84C715.51,-487.54 753.7,-590.85 772.01,-640.4\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"768.75,-641.66 775.5,-649.83 775.31,-639.24 768.75,-641.66\"/>\n",
"</g>\n",
"<!-- water&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge32\" class=\"edge\">\n",
"<title>water&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M722.35,-415.95C740.5,-408.51 764.32,-398.75 785.07,-390.24\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"786.42,-393.47 794.35,-386.44 783.77,-386.99 786.42,-393.47\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.graphs.Digraph at 0x7f92703941a0>"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nodes = game_state.item_inventory.get_all_items()\n",
"edges = list()\n",
"for recipe_label, recipe in game_state.recipe_inventory.recipe_map.items():\n",
" for in_item in recipe.ingredients:\n",
" for out_item in recipe.products:\n",
" edges.append((in_item.item, out_item.item))\n",
"\n",
"draw_graph(nodes, edges)"
]
},
{
"cell_type": "markdown",
"id": "1e2628d1-c580-47a1-b27a-beb637ecc5ef",
"metadata": {},
"source": [
"As you can see, it's a mess. To see the whole picture, shift+right click for the browser menu, then open in new tab. Time for topological sort to get the insight we're after. Or something like that, since topological sort works on trees and we have loops. Maybe that's why I struggled to sort the Gleba out. "
]
},
{
"cell_type": "markdown",
"id": "13875764-b26e-470d-ac93-2b1083b47117",
"metadata": {},
"source": [
"## Organizing Requirements\n",
"\n",
"So, let's get organized. What you see here is a result of plenty refactorings, it was quite the hot mess before. \n",
"\n",
"We need to calculate requirements. We also have some stop items we don't want to process automatically. We need to do this iteratively as we discover more and more stuff we need. \n",
"\n",
"In the output section, we're watching the number of stations needed and power requirements. These pretty much define the factory, how to wire them up without throughput issues will be decided on the ground.\n",
"\n",
"A political decision I did is to count with all of the machines producing at full output all the time. This has at least one issue - if you just don't need that many items, you'd be overproducing ingredients. \n",
"\n",
"Example: Rocket parts. They consist of low-densities, processing units and rocket fuel. A single rocket silo chucks a rocket part in three seconds. This approach would REQUIRE that you produce enough low-densities, processing units and rocket fuel to sustain this speed of production. That means even though you might need fewer rockets than one silo can produce, you would still be crafting enough intermediaries to sustain full production."
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "8287e72f-0981-475e-828b-f051a2e12a8d",
"metadata": {},
"outputs": [],
"source": [
"@dataclass\n",
"class StationReq:\n",
" station: Station\n",
" count: int\n",
" power: int\n",
" modules: list[Module]\n",
" beacons: Module\n",
"\n",
" def to_dict(self):\n",
" return {\n",
" \"station\": self.station.name, \n",
" \"count\": self.count,\n",
" \"power\": self.power, \n",
" \"modules\": \", \".join([x.name for x in self.modules]), \n",
" \"beacons\": self.beacons\n",
" }\n",
" \n",
"\n",
"class RequirementCache:\n",
" def __init__(self, game_state:GameState, stop_items=stop_items):\n",
" self.user_requirements = defaultdict(float)\n",
" self.user_station_requirements = dict()\n",
" self.internal_requirements = dict()\n",
" self.user_required_power = 0\n",
" \n",
" self.crafting_processor = CraftingProcessor(game_state, stop_items)\n",
" self.game_state=game_state\n",
" self.stop_items = stop_items\n",
" self.internal_requirements = defaultdict(float)\n",
" self.raw_requirements = defaultdict(float)\n",
" self.station_requirements = dict()\n",
"\n",
" def set_user_requirement(self, item, count, time_interval_s):\n",
" # it's a trick, we're normalizing anyway - pray the precision holds well\n",
" self.user_requirements[item] = count/time_interval_s\n",
" \n",
" def add_to_user_requirement(self, item, count, time_interval_s):\n",
" # since we're normalizing when setting, now we can do this:\n",
" if item not in self.user_requirements:\n",
" self.set_user_requirement(item, count, time_interval_s)\n",
" else:\n",
" self.user_requirements[item] += count/time_interval_s\n",
"\n",
" def get_user_requirement(self, item):\n",
" if item in self.user_requirements:\n",
" return self.user_requirements[item]\n",
" else:\n",
" return None\n",
"\n",
" def set_user_station_requirement(self, label, station_req: StationReq):\n",
" self.user_station_requirements[label] = station_req\n",
"\n",
" def get_user_station_requirement(self, label):\n",
" return self.user_station_requirements.get(label, None)\n",
"\n",
" def set_user_required_power(self, power):\n",
" self.user_required_power = power\n",
"\n",
" def add_to_user_required_power(self, power):\n",
" self.user_required_power += power\n",
"\n",
" def get_user_required_power(self, power):\n",
" return self.user_required_power\n",
" \n",
" def get_station_requirements(self):\n",
" out_dict = dict()\n",
" for x, req in self.station_requirements.items():\n",
" out_dict[x] = req\n",
" for x, req in self.user_station_requirements.items():\n",
" out_dict[\"user_\"+x] = req\n",
" return out_dict\n",
"\n",
" def get_production_requirements(self):\n",
" out_dict = dict()\n",
" for x, req in self.internal_requirements.items():\n",
" out_dict[x] = req\n",
" return out_dict\n",
" \n",
" def find_required_graph(self):\n",
" nodes = list()\n",
" edges = list()\n",
" # required graph is generated from user requirements, so we craft only what we really need\n",
" for item in self.user_requirements:\n",
" if item not in self.stop_items:\n",
" new_nodes, new_edges = self.game_state.recipe_inventory.find_chain_for_item(item)\n",
" nodes += new_nodes\n",
" edges += new_edges\n",
" # build graph\n",
" nodes = list(set(nodes))\n",
" edges = list(set(edges))\n",
" return nodes, edges\n",
"\n",
" def approximate_number_of_stations(self, item):\n",
" # select the recipe\n",
" recipe = self.crafting_processor.picking_recipes_strategy(item, game_state.recipe_inventory.find_recipes_for(item))\n",
" # select the station\n",
" crafting_station_name = self.crafting_processor.picking_stations_strategy(recipe)\n",
" crafting_station = self.game_state.station_inventory.get_station_by_name(crafting_station_name)\n",
" # check modules\n",
" modules = self.game_state.module_inventory.get_modules_from_plan(recipe.name, crafting_station_name)\n",
" beacons = self.game_state.module_inventory.get_beacons_from_plan(recipe.name, crafting_station_name)\n",
" # increase the number of parallel stations until we hit our limit\n",
" station_counter = 0\n",
" crafted_rate = 0\n",
" while crafted_rate+self.crafted[item] < self.internal_requirements[item]:\n",
" station_counter += 1\n",
" ingredients, products, time_req, power_req = self.crafting_processor.run_recipe_in_multiple_parallel_stations(\n",
" recipe, \n",
" crafting_station, \n",
" station_counter, \n",
" modules, \n",
" beacons)\n",
" crafted_rate = next(filter(lambda x:x.item==item, products)).quantity/time_req\n",
" station_req = StationReq(crafting_station, station_counter, power_req/time_req, [x for x in modules], beacons) \n",
" return ingredients, products, time_req, station_req\n",
"\n",
"\n",
" def calc_internal_requirements(self):\n",
" self.clear_internal_requirements()\n",
" for x in self.user_requirements:\n",
" if x not in self.stop_items:\n",
" self.internal_requirements[x] = self.user_requirements[x]\n",
" else:\n",
" self.raw_requirements[x] = self.user_requirements[x]\n",
" # find chains\n",
" nodes, edges = self.find_required_graph()\n",
" edges = [(x[1], x[0]) for x in edges] # turn the arrows around\n",
" G = nx.DiGraph()\n",
" G.add_nodes_from(nodes)\n",
" G.add_edges_from(edges)\n",
" # toposort\n",
" sorted_nodes = [x for x in nx.topological_sort(G)]\n",
" # calc\n",
" for item in sorted_nodes:\n",
" if item in self.stop_items:\n",
" continue\n",
" ingredients, products, time_req, station_req = self.approximate_number_of_stations(item)\n",
" for p in products:\n",
" self.crafted[p.item]+=p.quantity/time_req\n",
" for i in ingredients:\n",
" self.internal_requirements[i.item]+=i.quantity/time_req\n",
" self.station_requirements[item] = station_req\n",
"\n",
" def clear_internal_requirements(self):\n",
" self.internal_requirements = defaultdict(float)\n",
" self.raw_requirements = defaultdict(float)\n",
" self.station_requirements = dict()\n",
" self.crafted = defaultdict(float)\n",
"\n",
"rc = RequirementCache(game_state)"
]
},
{
"cell_type": "markdown",
"id": "48ddca23-77ef-4a1e-a429-a2ee244f19e9",
"metadata": {},
"source": [
"Ok, this needs a couple tests. Let's get back to iron smelting and green circuits."
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "934ab47c-bc58-4bc0-aa83-aca90c04616e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\">15 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">45 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">15 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">15 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">22.5</td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">22.5</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 6</td><td>2.25 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 24</td><td>4.32 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 9</td><td>3.375 MW</td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36</td><td>6.48 MW </td><td> </td><td>No Effect</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"assembling-machine-3: 375000.0\n",
"electric-furnace: 180000.0\n",
"assembling-machine-3: 375000.0\n",
"electric-furnace: 180000.0\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\">15 </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">15 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">90 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">45 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">90 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">22.5</td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">22.5</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 120</td><td>21.6 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 6</td><td>2.25 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 144</td><td>25.92 MW</td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 9</td><td>3.375 MW</td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36</td><td>6.48 MW </td><td> </td><td>No Effect</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"rc_test = RequirementCache(game_state, stop_items)\n",
"rc_test.set_user_requirement('electronic-circuit', 15, 1)\n",
"rc_test.calc_internal_requirements()\n",
"display_table(dict_to_table(rc_test.get_production_requirements()))\n",
"s = rc_test.get_station_requirements()\n",
"render_station_requirements(s)\n",
"# check if we get the original crafting station power requirements\n",
"for item in s:\n",
" print(s[item].station.name+\": \"+str(s[item].power/s[item].count))\n",
"# say I want an additional yellow belt of steel with no productivity bonuses\n",
"rc_test.set_user_requirement('steel-plate', 15, 1)\n",
"game_state.set_productivity_research_value('steel-plate', 0)\n",
"rc_test.calc_internal_requirements()\n",
"display_table(dict_to_table(rc_test.get_production_requirements()))\n",
"s = rc_test.get_station_requirements()\n",
"render_station_requirements(s)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "c07faba0-79a9-4266-a010-1d683d3988bc",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4.375 </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 21.25 </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.75 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 54.1667 </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7.91667</td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.66667</td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5.6 </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36 </td></tr>\n",
"<tr><td>water <img src=\"https://wiki.factorio.com/images/thumb/Water.png/32px-Water.png\" alt=\"water\" title=\"water\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">124 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 75 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 32.25 </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5 </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 23 </td></tr>\n",
"<tr><td>spoilage <img src=\"https://wiki.factorio.com/images/thumb/Spoilage.png/32px-Spoilage.png\" alt=\"spoilage\" title=\"spoilage\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 10 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 32.5 </td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 54.375 </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6 </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8 </td></tr>\n",
"<tr><td>jellynut-seed <img src=\"https://wiki.factorio.com/images/thumb/Jellynut_seed.png/32px-Jellynut_seed.png\" alt=\"jellynut-seed\" title=\"jellynut-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.12 </td></tr>\n",
"<tr><td>yumako-seed <img src=\"https://wiki.factorio.com/images/thumb/Yumako_seed.png/32px-Yumako_seed.png\" alt=\"yumako-seed\" title=\"yumako-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.16 </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# flush this, let's look at rocket parts\n",
"rc_test = RequirementCache(game_state, stop_items)\n",
"rc_test.set_user_requirement('rocket-part', 1, 1)\n",
"rc_test.calc_internal_requirements()\n",
"display_table(dict_to_table(rc_test.get_production_requirements()))"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "ff63f867-8887-42db-b19c-d50f156ea046",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>12.0 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 7</td><td>2.625 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 10</td><td>3.75 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>2.0 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 9</td><td>3.375 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 14</td><td>2.52 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 9</td><td>3.375 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>1.0 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>1.0 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 15</td><td>5.625 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 52</td><td>9.36 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>1.5 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 87</td><td>15.66 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>1.5 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>2.0 MW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36</td><td>76.596 kW </td><td> </td><td>No Effect</td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 48</td><td>102.128 kW</td><td> </td><td>No Effect</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"s = rc_test.get_station_requirements()\n",
"render_station_requirements(s)"
]
},
{
"cell_type": "markdown",
"id": "477259fe-d0ef-47a5-af60-9e92f64dd66f",
"metadata": {},
"source": [
"As a nice side-effect, we can now draw the required items graph with raw items required:"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "17c84caa-51d7-4294-8933-098bff2b722c",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.43.0 (0)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1096pt\" height=\"548pt\"\n",
" viewBox=\"0.00 0.00 1095.88 548.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 544)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#232323\" stroke=\"transparent\" points=\"-4,4 -4,-544 1091.88,-544 1091.88,4 -4,4\"/>\n",
"<!-- copper&#45;ore -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>copper&#45;ore</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"140.14\" cy=\"-450\" rx=\"60.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"140.14\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;ore</text>\n",
"</g>\n",
"<!-- copper&#45;plate -->\n",
"<g id=\"node20\" class=\"node\">\n",
"<title>copper&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"140.14\" cy=\"-378\" rx=\"68.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"140.14\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;plate</text>\n",
"</g>\n",
"<!-- copper&#45;ore&#45;&gt;copper&#45;plate -->\n",
"<g id=\"edge34\" class=\"edge\">\n",
"<title>copper&#45;ore&#45;&gt;copper&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M140.14,-431.7C140.14,-423.98 140.14,-414.71 140.14,-406.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"143.64,-406.1 140.14,-396.1 136.64,-406.1 143.64,-406.1\"/>\n",
"</g>\n",
"<!-- low&#45;density&#45;structure -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>low&#45;density&#45;structure</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"320.14\" cy=\"-162\" rx=\"110.48\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"320.14\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">low&#45;density&#45;structure</text>\n",
"</g>\n",
"<!-- rocket&#45;part -->\n",
"<g id=\"node27\" class=\"node\">\n",
"<title>rocket&#45;part</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"320.14\" cy=\"-18\" rx=\"62.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"320.14\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">rocket&#45;part</text>\n",
"</g>\n",
"<!-- low&#45;density&#45;structure&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>low&#45;density&#45;structure&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M320.14,-143.87C320.14,-119.67 320.14,-75.21 320.14,-46.39\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"323.64,-46.19 320.14,-36.19 316.64,-46.19 323.64,-46.19\"/>\n",
"</g>\n",
"<!-- rocket&#45;fuel -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>rocket&#45;fuel</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"756.14\" cy=\"-234\" rx=\"60.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"756.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">rocket&#45;fuel</text>\n",
"</g>\n",
"<!-- rocket&#45;fuel&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge21\" class=\"edge\">\n",
"<title>rocket&#45;fuel&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M729.63,-217.77C697.62,-199.56 642,-168.49 593.14,-144 512.69,-103.68 416.6,-60.9 362.55,-37.31\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"363.84,-34.05 353.28,-33.27 361.05,-40.47 363.84,-34.05\"/>\n",
"</g>\n",
"<!-- water -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>water</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"430.14\" cy=\"-306\" rx=\"37.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"430.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">water</text>\n",
"</g>\n",
"<!-- water&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>water&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M464.5,-298.04C524.07,-285.94 644.19,-261.43 686.14,-252 691.13,-250.88 696.3,-249.68 701.48,-248.47\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"702.47,-251.83 711.39,-246.11 700.85,-245.02 702.47,-251.83\"/>\n",
"</g>\n",
"<!-- sulfuric&#45;acid -->\n",
"<g id=\"node22\" class=\"node\">\n",
"<title>sulfuric&#45;acid</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"516.14\" cy=\"-162\" rx=\"67.69\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"516.14\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">sulfuric&#45;acid</text>\n",
"</g>\n",
"<!-- water&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>water&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M431.74,-287.72C434.15,-268.84 440.04,-238.32 454.14,-216 461.62,-204.17 472.56,-193.58 483.18,-185.03\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"485.36,-187.76 491.17,-178.9 481.11,-182.21 485.36,-187.76\"/>\n",
"</g>\n",
"<!-- advanced&#45;circuit -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>advanced&#45;circuit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"104.14\" cy=\"-162\" rx=\"87.18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"104.14\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">advanced&#45;circuit</text>\n",
"</g>\n",
"<!-- processing&#45;unit -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>processing&#45;unit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"157.14\" cy=\"-90\" rx=\"82.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"157.14\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">processing&#45;unit</text>\n",
"</g>\n",
"<!-- advanced&#45;circuit&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>advanced&#45;circuit&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M116.97,-144.05C123.35,-135.63 131.19,-125.28 138.24,-115.97\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"141.19,-117.87 144.43,-107.79 135.61,-113.65 141.19,-117.87\"/>\n",
"</g>\n",
"<!-- yumako -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>yumako</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"684.14\" cy=\"-450\" rx=\"46.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"684.14\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">yumako</text>\n",
"</g>\n",
"<!-- yumako&#45;mash -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>yumako&#45;mash</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"701.14\" cy=\"-378\" rx=\"74.99\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"701.14\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">yumako&#45;mash</text>\n",
"</g>\n",
"<!-- yumako&#45;&gt;yumako&#45;mash -->\n",
"<g id=\"edge25\" class=\"edge\">\n",
"<title>yumako&#45;&gt;yumako&#45;mash</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M688.26,-432.05C690.15,-424.26 692.44,-414.82 694.57,-406.08\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"697.99,-406.82 696.95,-396.28 691.19,-405.17 697.99,-406.82\"/>\n",
"</g>\n",
"<!-- agricultural&#45;science&#45;pack -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>agricultural&#45;science&#45;pack</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"961.14\" cy=\"-234\" rx=\"126.98\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"961.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">agricultural&#45;science&#45;pack</text>\n",
"</g>\n",
"<!-- iron&#45;plate -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>iron&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"309.14\" cy=\"-306\" rx=\"55.79\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"309.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">iron&#45;plate</text>\n",
"</g>\n",
"<!-- steel&#45;plate -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>steel&#45;plate</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"309.14\" cy=\"-234\" rx=\"59.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"309.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">steel&#45;plate</text>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;steel&#45;plate -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;steel&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M309.14,-287.7C309.14,-279.98 309.14,-270.71 309.14,-262.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"312.64,-262.1 309.14,-252.1 305.64,-262.1 312.64,-262.1\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>electronic&#45;circuit</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"104.14\" cy=\"-234\" rx=\"89.08\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"104.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">electronic&#45;circuit</text>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;electronic&#45;circuit -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;electronic&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M272.02,-292.32C239.96,-281.38 193.25,-265.43 157.24,-253.13\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"157.98,-249.68 147.38,-249.77 155.72,-256.31 157.98,-249.68\"/>\n",
"</g>\n",
"<!-- iron&#45;plate&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge37\" class=\"edge\">\n",
"<title>iron&#45;plate&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M331.05,-289.39C356.26,-271.48 398.99,-241.32 436.14,-216 451.54,-205.51 468.74,-194.08 483.24,-184.52\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"485.45,-187.26 491.88,-178.84 481.6,-181.41 485.45,-187.26\"/>\n",
"</g>\n",
"<!-- processing&#45;unit&#45;&gt;rocket&#45;part -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>processing&#45;unit&#45;&gt;rocket&#45;part</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M192.92,-73.64C217.87,-62.92 251.28,-48.57 277.61,-37.27\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"279.15,-40.41 286.96,-33.25 276.39,-33.98 279.15,-40.41\"/>\n",
"</g>\n",
"<!-- copper&#45;cable -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>copper&#45;cable</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"104.14\" cy=\"-306\" rx=\"69.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"104.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">copper&#45;cable</text>\n",
"</g>\n",
"<!-- copper&#45;cable&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>copper&#45;cable&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M59.09,-292.29C39.2,-284.18 17.73,-271.44 6.14,-252 -2.05,-238.26 -2.05,-229.74 6.14,-216 15.29,-200.65 30.6,-189.48 46.43,-181.47\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"48.18,-184.51 55.76,-177.11 45.22,-178.17 48.18,-184.51\"/>\n",
"</g>\n",
"<!-- copper&#45;cable&#45;&gt;electronic&#45;circuit -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>copper&#45;cable&#45;&gt;electronic&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M104.14,-287.7C104.14,-279.98 104.14,-270.71 104.14,-262.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"107.64,-262.1 104.14,-252.1 100.64,-262.1 107.64,-262.1\"/>\n",
"</g>\n",
"<!-- jellynut -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>jellynut</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"830.14\" cy=\"-450\" rx=\"46.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"830.14\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">jellynut</text>\n",
"</g>\n",
"<!-- jelly -->\n",
"<g id=\"node28\" class=\"node\">\n",
"<title>jelly</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"826.14\" cy=\"-378\" rx=\"30.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"826.14\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">jelly</text>\n",
"</g>\n",
"<!-- jellynut&#45;&gt;jelly -->\n",
"<g id=\"edge30\" class=\"edge\">\n",
"<title>jellynut&#45;&gt;jelly</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M829.16,-431.7C828.71,-423.98 828.18,-414.71 827.69,-406.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"831.19,-405.89 827.12,-396.1 824.2,-406.29 831.19,-405.89\"/>\n",
"</g>\n",
"<!-- plastic&#45;bar -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>plastic&#45;bar</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"523.14\" cy=\"-234\" rx=\"59.59\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"523.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">plastic&#45;bar</text>\n",
"</g>\n",
"<!-- plastic&#45;bar&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge22\" class=\"edge\">\n",
"<title>plastic&#45;bar&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M485.44,-220C454.31,-209.26 409.72,-193.89 374.7,-181.81\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"375.69,-178.45 365.09,-178.5 373.4,-185.07 375.69,-178.45\"/>\n",
"</g>\n",
"<!-- plastic&#45;bar&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge33\" class=\"edge\">\n",
"<title>plastic&#45;bar&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M471.81,-224.72C408.24,-214.43 296.65,-196.23 201.14,-180 193.62,-178.72 185.77,-177.37 177.93,-176.01\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"178.5,-172.56 168.04,-174.3 177.3,-179.46 178.5,-172.56\"/>\n",
"</g>\n",
"<!-- yumako&#45;seed -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>yumako&#45;seed</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"679.14\" cy=\"-522\" rx=\"71.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"679.14\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">yumako&#45;seed</text>\n",
"</g>\n",
"<!-- yumako&#45;seed&#45;&gt;yumako -->\n",
"<g id=\"edge36\" class=\"edge\">\n",
"<title>yumako&#45;seed&#45;&gt;yumako</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M680.38,-503.7C680.93,-495.98 681.59,-486.71 682.21,-478.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"685.7,-478.33 682.92,-468.1 678.72,-477.83 685.7,-478.33\"/>\n",
"</g>\n",
"<!-- pentapod&#45;egg -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>pentapod&#45;egg</title>\n",
"<ellipse fill=\"springgreen\" stroke=\"springgreen\" cx=\"961.14\" cy=\"-306\" rx=\"74.19\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"961.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">pentapod&#45;egg</text>\n",
"</g>\n",
"<!-- pentapod&#45;egg&#45;&gt;agricultural&#45;science&#45;pack -->\n",
"<g id=\"edge27\" class=\"edge\">\n",
"<title>pentapod&#45;egg&#45;&gt;agricultural&#45;science&#45;pack</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M961.14,-287.7C961.14,-279.98 961.14,-270.71 961.14,-262.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"964.64,-262.1 961.14,-252.1 957.64,-262.1 964.64,-262.1\"/>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;plastic&#45;bar -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;plastic&#45;bar</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M698.92,-359.96C695.48,-340.14 687.03,-307.64 667.14,-288 653.76,-274.78 611.32,-260.02 575.96,-249.44\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"576.78,-246.03 566.2,-246.57 574.81,-252.75 576.78,-246.03\"/>\n",
"</g>\n",
"<!-- carbon&#45;fiber -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>carbon&#45;fiber</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"591.14\" cy=\"-306\" rx=\"66.89\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"591.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">carbon&#45;fiber</text>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;carbon&#45;fiber -->\n",
"<g id=\"edge31\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;carbon&#45;fiber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M675.91,-360.94C660.71,-351.27 641.17,-338.83 624.68,-328.34\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"626.2,-325.16 615.88,-322.74 622.44,-331.07 626.2,-325.16\"/>\n",
"</g>\n",
"<!-- bioflux -->\n",
"<g id=\"node25\" class=\"node\">\n",
"<title>bioflux</title>\n",
"<ellipse fill=\"green\" stroke=\"green\" cx=\"756.14\" cy=\"-306\" rx=\"42.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"756.14\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">bioflux</text>\n",
"</g>\n",
"<!-- yumako&#45;mash&#45;&gt;bioflux -->\n",
"<g id=\"edge23\" class=\"edge\">\n",
"<title>yumako&#45;mash&#45;&gt;bioflux</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M714.46,-360.05C721.24,-351.42 729.62,-340.76 737.08,-331.27\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"739.91,-333.33 743.33,-323.31 734.4,-329.01 739.91,-333.33\"/>\n",
"</g>\n",
"<!-- jellynut&#45;seed -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>jellynut&#45;seed</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"839.14\" cy=\"-522\" rx=\"70.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"839.14\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">jellynut&#45;seed</text>\n",
"</g>\n",
"<!-- jellynut&#45;seed&#45;&gt;jellynut -->\n",
"<g id=\"edge35\" class=\"edge\">\n",
"<title>jellynut&#45;seed&#45;&gt;jellynut</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M836.92,-503.7C835.93,-495.98 834.74,-486.71 833.63,-478.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"837.09,-477.58 832.34,-468.1 830.15,-478.47 837.09,-477.58\"/>\n",
"</g>\n",
"<!-- steel&#45;plate&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge38\" class=\"edge\">\n",
"<title>steel&#45;plate&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M311.86,-215.7C313.08,-207.98 314.53,-198.71 315.88,-190.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"319.36,-190.53 317.46,-180.1 312.45,-189.44 319.36,-190.53\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;advanced&#45;circuit -->\n",
"<g id=\"edge24\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;advanced&#45;circuit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M104.14,-215.7C104.14,-207.98 104.14,-198.71 104.14,-190.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"107.64,-190.1 104.14,-180.1 100.64,-190.1 107.64,-190.1\"/>\n",
"</g>\n",
"<!-- electronic&#45;circuit&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge26\" class=\"edge\">\n",
"<title>electronic&#45;circuit&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M56.72,-218.66C38.18,-210.47 18.84,-198.12 8.14,-180 0.01,-166.22 -1.08,-157.07 8.14,-144 23.73,-121.92 49.35,-108.98 74.99,-101.42\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"76.06,-104.76 84.8,-98.78 74.23,-98 76.06,-104.76\"/>\n",
"</g>\n",
"<!-- copper&#45;plate&#45;&gt;low&#45;density&#45;structure -->\n",
"<g id=\"edge29\" class=\"edge\">\n",
"<title>copper&#45;plate&#45;&gt;low&#45;density&#45;structure</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M155.38,-359.99C164.04,-349.91 174.79,-336.66 183.14,-324 213.05,-278.71 203.72,-256.24 240.14,-216 251.15,-203.84 265.52,-193.2 279.04,-184.7\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"281.01,-187.6 287.76,-179.43 277.39,-181.61 281.01,-187.6\"/>\n",
"</g>\n",
"<!-- copper&#45;plate&#45;&gt;copper&#45;cable -->\n",
"<g id=\"edge28\" class=\"edge\">\n",
"<title>copper&#45;plate&#45;&gt;copper&#45;cable</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M131.43,-360.05C127.29,-352.01 122.25,-342.2 117.63,-333.23\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"120.71,-331.57 113.03,-324.28 114.49,-334.77 120.71,-331.57\"/>\n",
"</g>\n",
"<!-- sulfur -->\n",
"<g id=\"node21\" class=\"node\">\n",
"<title>sulfur</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"639.14\" cy=\"-234\" rx=\"38.19\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"639.14\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">sulfur</text>\n",
"</g>\n",
"<!-- sulfur&#45;&gt;sulfuric&#45;acid -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>sulfur&#45;&gt;sulfuric&#45;acid</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M615.72,-219.67C597.87,-209.51 572.96,-195.34 552.52,-183.7\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"554.2,-180.63 543.78,-178.73 550.74,-186.72 554.2,-180.63\"/>\n",
"</g>\n",
"<!-- sulfuric&#45;acid&#45;&gt;processing&#45;unit -->\n",
"<g id=\"edge39\" class=\"edge\">\n",
"<title>sulfuric&#45;acid&#45;&gt;processing&#45;unit</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M466.07,-149.71C457.12,-147.75 447.86,-145.78 439.14,-144 367.78,-129.42 285.94,-114.2 228.87,-103.84\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"229.33,-100.36 218.87,-102.02 228.08,-107.25 229.33,-100.36\"/>\n",
"</g>\n",
"<!-- carbon -->\n",
"<g id=\"node23\" class=\"node\">\n",
"<title>carbon</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"566.14\" cy=\"-378\" rx=\"42.49\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"566.14\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">carbon</text>\n",
"</g>\n",
"<!-- carbon&#45;&gt;carbon&#45;fiber -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>carbon&#45;&gt;carbon&#45;fiber</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M572.2,-360.05C575.01,-352.18 578.42,-342.62 581.57,-333.79\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"584.91,-334.87 584.97,-324.28 578.31,-332.52 584.91,-334.87\"/>\n",
"</g>\n",
"<!-- spoilage -->\n",
"<g id=\"node24\" class=\"node\">\n",
"<title>spoilage</title>\n",
"<ellipse fill=\"gold\" stroke=\"gold\" cx=\"531.14\" cy=\"-450\" rx=\"49.29\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"531.14\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">spoilage</text>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;sulfur -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;sulfur</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M522.86,-431.79C509.04,-400.36 485.59,-332.77 515.14,-288 520.21,-280.32 565.82,-262.08 600.27,-249.15\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"601.5,-252.43 609.64,-245.66 599.05,-245.87 601.5,-252.43\"/>\n",
"</g>\n",
"<!-- spoilage&#45;&gt;carbon -->\n",
"<g id=\"edge32\" class=\"edge\">\n",
"<title>spoilage&#45;&gt;carbon</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M539.62,-432.05C543.7,-423.89 548.69,-413.91 553.23,-404.82\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"556.41,-406.3 557.75,-395.79 550.15,-403.17 556.41,-406.3\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M756.14,-287.7C756.14,-279.98 756.14,-270.71 756.14,-262.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"759.64,-262.1 756.14,-252.1 752.64,-262.1 759.64,-262.1\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;agricultural&#45;science&#45;pack -->\n",
"<g id=\"edge20\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;agricultural&#45;science&#45;pack</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M788.18,-294.06C819.39,-283.4 867.52,-266.97 905.08,-254.14\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"906.55,-257.34 914.88,-250.8 904.29,-250.72 906.55,-257.34\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;plastic&#45;bar -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;plastic&#45;bar</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M722.69,-294.82C715.27,-292.57 707.44,-290.2 700.14,-288 657.47,-275.13 608.98,-260.62 573.56,-250.04\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"574.52,-246.67 563.93,-247.17 572.51,-253.38 574.52,-246.67\"/>\n",
"</g>\n",
"<!-- bioflux&#45;&gt;sulfur -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>bioflux&#45;&gt;sulfur</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M732.75,-291C715.02,-280.39 690.46,-265.7 670.94,-254.03\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"672.48,-250.87 662.1,-248.73 668.88,-256.87 672.48,-250.87\"/>\n",
"</g>\n",
"<!-- iron&#45;ore -->\n",
"<g id=\"node26\" class=\"node\">\n",
"<title>iron&#45;ore</title>\n",
"<ellipse fill=\"lightgray\" stroke=\"lightgray\" cx=\"309.14\" cy=\"-378\" rx=\"47.39\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"309.14\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">iron&#45;ore</text>\n",
"</g>\n",
"<!-- iron&#45;ore&#45;&gt;iron&#45;plate -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>iron&#45;ore&#45;&gt;iron&#45;plate</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M309.14,-359.7C309.14,-351.98 309.14,-342.71 309.14,-334.11\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"312.64,-334.1 309.14,-324.1 305.64,-334.1 312.64,-334.1\"/>\n",
"</g>\n",
"<!-- jelly&#45;&gt;rocket&#45;fuel -->\n",
"<g id=\"edge19\" class=\"edge\">\n",
"<title>jelly&#45;&gt;rocket&#45;fuel</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M825.28,-359.99C823.73,-341.34 819.37,-311.02 807.14,-288 801.31,-277.01 792.52,-266.71 783.88,-258.16\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"786.09,-255.43 776.4,-251.13 781.29,-260.53 786.09,-255.43\"/>\n",
"</g>\n",
"<!-- jelly&#45;&gt;bioflux -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>jelly&#45;&gt;bioflux</title>\n",
"<path fill=\"none\" stroke=\"white\" d=\"M811.3,-362.15C802,-352.85 789.82,-340.67 779.27,-330.12\"/>\n",
"<polygon fill=\"white\" stroke=\"white\" points=\"781.49,-327.39 771.94,-322.8 776.54,-332.34 781.49,-327.39\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.graphs.Digraph at 0x7f927049e350>"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rc_test = RequirementCache(game_state, stop_items)\n",
"rc_test.set_user_requirement('agricultural-science-pack',1,1)\n",
"rc_test.set_user_requirement('rocket-part',1,1)\n",
"rc_test.set_user_requirement('carbon-fiber',1,1)\n",
"nodes, edges = rc_test.find_required_graph()\n",
"draw_graph(nodes, edges, 'dot')"
]
},
{
"cell_type": "markdown",
"id": "8d0a7d03-9599-4481-a1a8-347bf4740995",
"metadata": {},
"source": [
"# Finally Some Design\n",
"\n",
"We should define our production targets so that we are able to fulfill them. Duh. This is a good time to note down our global production research levels again:"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "4b552cf1-f42c-43a2-8708-44c72ec9c057",
"metadata": {},
"outputs": [],
"source": [
"game_state.set_productivity_research_value('steel-plate', 5)\n",
"game_state.set_productivity_research_value('low-density-structure', 2)\n",
"game_state.set_productivity_research_value('processing-unit', 2)"
]
},
{
"cell_type": "markdown",
"id": "6c8ae1b1-d660-41d9-b054-2c11ca6a7b89",
"metadata": {},
"source": [
"My base revolves around 2 science per second. Ok, let's start with that as the baseline. \n",
"Let's just plop some additional numbers for bioflux and carbon fiber, since I know I'll need those exported."
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "b9bb8ae3-d4dd-44ce-8df9-89be6c0aadeb",
"metadata": {},
"outputs": [],
"source": [
"prod_targets_per_hour = {\n",
" \"agricultural-science-pack\":7200,\n",
" \"carbon-fiber\":280,\n",
" \"bioflux\":240,\n",
"}\n",
"\n",
"for k,v in prod_targets_per_hour.items():\n",
" rc.set_user_requirement(k,v,3600)\n",
"rc.calc_internal_requirements()"
]
},
{
"cell_type": "markdown",
"id": "ef0a2fbb-8d17-4dd6-9b76-4a1822b5209d",
"metadata": {},
"source": [
"## Interplanetary Logistics\n",
"\n",
"Look, I need to figure out how to get all of this material off this planet. I also need to design my ships in a way that they can keep travelling through with nearly zero downtime with exactly zero damage. \n",
"\n",
"Automated ship design is something I don't want to do. For the Gleba <-> Nauvis route, yellow bullets and gun turrets are enough, observe the consumption a bit and scale production accordingly. Here's my winning design (sorry for the crude edits, it's loooong), it can handle even Fulgora routes. So far without incident (of course, stock up on repair packs, platforms, walls etc.)."
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "8deafd5c-a385-47d0-8477-e177c7d0d919",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"https://nook.miloslavhomer.cz/public/ghost_up_mk2.png\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Image(url=\"https://nook.miloslavhomer.cz/public/ghost_up_mk2.png\")"
]
},
{
"cell_type": "markdown",
"id": "6137f0b0-8ad2-4c67-8fb0-d2f78409d2fb",
"metadata": {},
"source": [
"The ship's flying physics are a bit wonky, for some reason the speed depends on thrust and width of the ship, not weight. I guess the rationale is that since you meet so many asteroids they act similarly to atmosphere. The result is: there is a maximum speed you can achieve and you can hold onto that speed for the majority of the trip. For the ship above, it's just north of 300km/s.\n",
"\n",
"Another variable to consider here is the loading/unloading speed. Due to the productivity researches, we're drowning in rocket parts, so I'd say that loading time shouldn't exceed 60s. It's a good idea to set this timer exactly, as it gives the ship much needed downtime to replenish fuel and bullets."
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "7b54783d-c3c9-4118-a2fc-19b24ef28bb3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"To sustain 0.06666666666666667 bioflux/s we need to transport 11.333333333333334 resources over 170.0s\n",
"To sustain 0.07777777777777778 carbon-fiber/s we need to transport 13.222222222222223 resources over 170.0s\n",
"To sustain 2.0 agricultural-science-pack/s we need to transport 340.0 resources over 170.0s\n"
]
}
],
"source": [
"def calculate_required_rocket_parts(\n",
" rc,\n",
" exports = ['bioflux', 'carbon-fiber', 'agricultural-science-pack'],\n",
" ship_speed = 300, # km/s\n",
" trip_length = 15000, # km\n",
" loading_time = 60 # s\n",
"):\n",
" trip_time = trip_length / ship_speed # s\n",
" full_trip_time = 2*loading_time+trip_time\n",
" rocket_parts = 0.0\n",
"\n",
" for export in exports:\n",
" eps = rc.get_user_requirement(export)\n",
" ship_throughput = eps*full_trip_time\n",
" print(f\"To sustain {eps} {export}/s we need to transport {ship_throughput} resources over {full_trip_time}s\")\n",
" rocket_parts += 50*eps/rc.game_state.item_inventory.get_item_by_name(export).rocket_capacity\n",
" rc.set_user_requirement('rocket-part', rocket_parts, 1)\n",
" rc.calc_internal_requirements()\n",
" \n",
"calculate_required_rocket_parts(rc)"
]
},
{
"cell_type": "markdown",
"id": "85fdb2ef-480f-47bf-824e-827b57f98766",
"metadata": {},
"source": [
"Realize that one silo is able to produce more rockets that we need, so we need to artificially slow it down. Let's use the beacon effect for this, it's the cleanest solution I was able to come up with."
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "154757e4-3e07-46a5-9d29-fb6ed235e757",
"metadata": {},
"outputs": [],
"source": [
"rc.game_state.module_inventory.add_module_plan('r_rocket-part', 'rocket-silo', [], Module('beacons', speed=-(2/3)))"
]
},
{
"cell_type": "markdown",
"id": "9c73b9d0-1e7c-4254-a774-224b03bf160c",
"metadata": {},
"source": [
"Let's first take a look at the items:"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "a90530b2-1f6a-4676-badf-7a937aaef992",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2 </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.0777778</td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4.96667 </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.5 </td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.4 </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 23 </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>spoilage <img src=\"https://wiki.factorio.com/images/thumb/Spoilage.png/32px-Spoilage.png\" alt=\"spoilage\" title=\"spoilage\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12 </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.625 </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3.33333 </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.25 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 13.3333 </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.66667 </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.333333 </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 18 </td></tr>\n",
"<tr><td>water <img src=\"https://wiki.factorio.com/images/thumb/Water.png/32px-Water.png\" alt=\"water\" title=\"water\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">106 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 16.6667 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7.25 </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7.5 </td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 13.75 </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8 </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4 </td></tr>\n",
"<tr><td>yumako-seed <img src=\"https://wiki.factorio.com/images/thumb/Yumako_seed.png/32px-Yumako_seed.png\" alt=\"yumako-seed\" title=\"yumako-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.16 </td></tr>\n",
"<tr><td>jellynut-seed <img src=\"https://wiki.factorio.com/images/thumb/Jellynut_seed.png/32px-Jellynut_seed.png\" alt=\"jellynut-seed\" title=\"jellynut-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.08 </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"rc.calc_internal_requirements()\n",
"display_table(dict_to_table(rc.get_production_requirements()))"
]
},
{
"cell_type": "markdown",
"id": "c035a5b4-fa86-4bcf-aef8-ffe64abca373",
"metadata": {},
"source": [
"Then we can take a look at the station/power requirements:"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "d63ae3e2-9cff-4d2f-a3bf-2c7611a0e5dc",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>500.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>1.0 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>500.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>500.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>1.0 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>2.0 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>1.0 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 48</td><td>102.128 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 24</td><td>51.064 kW </td><td> </td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "3d07b90a-9841-453d-86a3-764ae90598bf",
"metadata": {},
"source": [
"### Efficiency Modules help with nutrients\n",
"\n",
"Ok, these numbers aren't so bad. That gives me an idea though - how about we stack the biochambers with efficiency modules? We are saving ourselves some of the headache of nutrients, as we don't need to supply that many. "
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "f422677b-4255-4513-8cb8-f03d4874341a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2 </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.0777778</td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4.96667 </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.5 </td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.4 </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 23 </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.111111 </td></tr>\n",
"<tr><td>spoilage <img src=\"https://wiki.factorio.com/images/thumb/Spoilage.png/32px-Spoilage.png\" alt=\"spoilage\" title=\"spoilage\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12 </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.625 </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3.33333 </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.25 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 13.3333 </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.66667 </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.333333 </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 18 </td></tr>\n",
"<tr><td>water <img src=\"https://wiki.factorio.com/images/thumb/Water.png/32px-Water.png\" alt=\"water\" title=\"water\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">106 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 16.6667 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7.25 </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7.5 </td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 13.75 </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8 </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4 </td></tr>\n",
"<tr><td>yumako-seed <img src=\"https://wiki.factorio.com/images/thumb/Yumako_seed.png/32px-Yumako_seed.png\" alt=\"yumako-seed\" title=\"yumako-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.16 </td></tr>\n",
"<tr><td>jellynut-seed <img src=\"https://wiki.factorio.com/images/thumb/Jellynut_seed.png/32px-Jellynut_seed.png\" alt=\"jellynut-seed\" title=\"jellynut-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.08 </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def efficiency_modules_bio(rc):\n",
" biorecipes = [\n",
" \"r_agricultural-science-pack\",\n",
" \"r_bioflux\",\n",
" \"r_yumako-mash\",\n",
" \"r_jelly\",\n",
" \"r_carbon-fiber\",\n",
" \"r_burnt_spoilage\",\n",
" \"r_rocket-fuel_from_jelly\",\n",
" \"r_bioplastic\",\n",
" \"r_biosulfur\",\n",
" 'r_pentapod-egg',\n",
" 'r_nutrients_from_bioflux',\n",
" 'r_cult_copper-bacteria',\n",
" 'r_cult_iron-bacteria',\n",
" ]\n",
"\n",
" for recipe in biorecipes:\n",
" if rc.game_state.module_inventory.get_modules_from_plan(recipe, 'biochamber') == []:\n",
" rc.game_state.module_inventory.add_module_plan(recipe, 'biochamber', ['efficiency-module-2', 'efficiency-module-2'])\n",
"\n",
"efficiency_modules_bio(rc)\n",
"rc.calc_internal_requirements()\n",
"display_table(dict_to_table(rc.get_production_requirements()))"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "7289ef3f-dd7d-4d01-8684-c392bb2d1e24",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>400.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 48</td><td>102.128 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 24</td><td>51.064 kW </td><td> </td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "c5a60fb2-b1d6-41ee-8c73-94db5b6ab41d",
"metadata": {},
"source": [
"### Bacteria cultivation setup\n",
"\n",
"Sadly, we can't grab bacteria from thin air. But we can cultivate them. This costs bacteria, nutrients and bioflux in biochambers. From the table above we have the requirements for hourly bacteria amount:"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "967901c6-c33e-4305-aeef-1a1f1e41fe49",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5</td><td>500.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 72</td><td>153.191 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36</td><td>76.596 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>user_iron-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Iron_bacteria.png/32px-Iron_bacteria.png\" alt=\"iron-bacteria\" title=\"iron-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_copper-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Copper_bacteria.png/32px-Copper_bacteria.png\" alt=\"copper-bacteria\" title=\"copper-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def bacteria(rc):\n",
" prod_requirements = rc.get_production_requirements()\n",
" iron_bacteria_per_s_req = prod_requirements['iron-ore']\n",
" copper_bacteria_per_s_req = prod_requirements['copper-ore']\n",
"\n",
" iron_bacteria_recipe = rc.game_state.recipe_inventory.get_recipe_by_name('r_cult_iron-bacteria')\n",
" copper_bacteria_recipe = rc.game_state.recipe_inventory.get_recipe_by_name('r_cult_copper-bacteria') # F this, the recipes are the same\n",
" biochamber_station = rc.game_state.station_inventory.get_station_by_name('biochamber')\n",
" \n",
" cultivation_modules = rc.game_state.module_inventory.get_modules_from_plan('r_cult_iron-bacteria', 'biochamber')\n",
" cultivation_beacons = rc.game_state.module_inventory.get_beacons_from_plan('r_cult_iron-bacteria', 'biochamber')\n",
"\n",
" sp_ingredients, sp_products, single_time_req, sp_power_req = rc.crafting_processor.run_recipe(\n",
" iron_bacteria_recipe,\n",
" biochamber_station,\n",
" modules = cultivation_modules,\n",
" beacons = cultivation_beacons\n",
" )\n",
" single_bacteria_gain = next(filter(lambda x: x.item==\"iron-bacteria\", sp_products)).quantity\n",
" single_cost_bioflux = next(filter(lambda x: x.item==\"bioflux\", sp_ingredients)).quantity\n",
" usable_bacteria = single_bacteria_gain - next(filter(lambda x: x.item==\"iron-bacteria\", sp_ingredients)).quantity\n",
"\n",
" iron_cycles_per_s_needed = iron_bacteria_per_s_req / usable_bacteria\n",
" copper_cycles_per_s_needed = copper_bacteria_per_s_req / usable_bacteria\n",
"\n",
" # now onto bioflux\n",
" bioflux_needed = single_cost_bioflux*(iron_cycles_per_s_needed+copper_cycles_per_s_needed)\n",
" \n",
" rc.add_to_user_requirement('bioflux', bioflux_needed, 1)\n",
" \n",
" # and stations\n",
" iron_machines_needed = math.ceil(iron_cycles_per_s_needed*single_time_req)\n",
" iron_power_req = iron_machines_needed*sp_power_req\n",
" iron_user_station_req = StationReq(\n",
" station=biochamber_station,\n",
" count=iron_machines_needed,\n",
" power=iron_power_req/single_time_req,\n",
" modules = cultivation_modules,\n",
" beacons=cultivation_beacons,\n",
" )\n",
" \n",
" copper_machines_needed = math.ceil(copper_cycles_per_s_needed*single_time_req)\n",
" copper_power_req = copper_machines_needed*sp_power_req\n",
" copper_user_station_req = StationReq(\n",
" station=biochamber_station,\n",
" count=copper_machines_needed,\n",
" power=copper_power_req/single_time_req,\n",
" modules = cultivation_modules,\n",
" beacons=cultivation_beacons,\n",
" )\n",
" \n",
" rc.set_user_station_requirement('iron-bacteria', iron_user_station_req)\n",
" rc.set_user_station_requirement('copper-bacteria', copper_user_station_req)\n",
" rc.calc_internal_requirements()\n",
"\n",
"bacteria(rc)\n",
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "38c6f30c-88c3-447a-b45b-b145f2a72714",
"metadata": {},
"source": [
"Not gonna lie, that is way less than I thought. The true MVP here is the productivity bonus of biochambers that is netting us 5 bacteria in 2 seconds."
]
},
{
"cell_type": "markdown",
"id": "1b4e0e4a-35d9-4784-9e67-8766165e29e1",
"metadata": {},
"source": [
"### Rocket Fueled Power\n",
"\n",
"We also need electricity. I want to roll the heating tower and I want it fueled by rocket fuel. This decision is solely made for cool reasons. Rocked fueled factory go!!! That means we need additional rocket fuel. How much though? \n",
"\n",
"Side note: Since we're rolling steam, instead of accumulators we'll get steam tanks (this shouldn't work, but it does).\n",
"\n",
"We also need to power the defenses. The tesla turrents are awesome, but hungry. And I thought that laser turrets were bad (they are). Say we'll deploy 4 tesla turrets per station and 12 laser turrets per station. I imagine this goes something like:"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "2bbc00b3-6727-43f9-9d7e-332ede4cfdc1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'34.56 MW'"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"turrets = [\"tesla-turret\", \"laser-turret\"]\n",
"defense_req_per_bp = {\n",
" \"tesla-turret\":4,\n",
" \"laser-turret\":12\n",
"}\n",
"defense_blueprints = 6\n",
"\n",
"defense_drain = {\n",
" \"tesla-turret\": { # min drain is 1MW, max drain is 7MW\n",
" \"active\":7000000, \n",
" \"passive\":1000000\n",
" },\n",
" \"laser-turret\": { # min drain is just 24kW, max drain with all upgrades is a ridiculous 3.8MW\n",
" \"active\":3800000,\n",
" \"passive\":24000\n",
" }\n",
"}\n",
"\n",
"# to account for downtime (I don't expect to be attacked often) let's say that the defenses work 2% of the time\n",
"active_defense=0.02\n",
"\n",
"defense_W = defense_blueprints*sum([(defense_drain[turret][\"passive\"]+active_defense*defense_drain[turret][\"active\"])*defense_req_per_bp[turret] for turret in turrets])\n",
"get_unit(defense_W, \"W\")"
]
},
{
"cell_type": "markdown",
"id": "aef72a9f-e7c7-4354-8eca-0b2731414b3d",
"metadata": {},
"source": [
"That's a lot of power. It dwarfs the rest of the production needed, and I'll be producing plenty of things to counterbalance this. Let's save it for when we have rocket turrets and let's reconsider this.\n",
"\n",
"How much power we need with the heating tower:"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "efc27a8e-9800-4845-8ba4-e4728c8a49c3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5</td><td>500.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 72</td><td>153.191 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 36</td><td>76.596 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>user_iron-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Iron_bacteria.png/32px-Iron_bacteria.png\" alt=\"iron-bacteria\" title=\"iron-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_copper-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Copper_bacteria.png/32px-Copper_bacteria.png\" alt=\"copper-bacteria\" title=\"copper-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def power(rc, defense_blueprints=6, active_defense=0.02):\n",
" turrets = [\"tesla-turret\", \"laser-turret\"]\n",
" defense_req_per_bp = {\n",
" \"tesla-turret\":4,\n",
" \"laser-turret\":12\n",
" }\n",
" \n",
" defense_drain = {\n",
" \"tesla-turret\": { # min drain is 1MW, max drain is 7MW\n",
" \"active\":7000000, \n",
" \"passive\":1000000\n",
" },\n",
" \"laser-turret\": { # min drain is just 24kW, max drain with all upgrades is a ridiculous 3.8MW\n",
" \"active\":3800000,\n",
" \"passive\":24000\n",
" }\n",
" }\n",
" defense_W = defense_blueprints*sum([(defense_drain[turret][\"passive\"]+active_defense*defense_drain[turret][\"active\"])*defense_req_per_bp[turret] for turret in turrets])\n",
" \n",
" power_sources = {\n",
" \"heating-tower\":{\n",
" \"energy_usage_W\":16000000,\n",
" \"energy_source\":[\n",
" \"wood\",\n",
" \"coal\",\n",
" \"solid-fuel\",\n",
" \"rocket-fuel\",\n",
" \"nuclear-fuel\",\n",
" \"yumako\",\n",
" \"yumako-mash\",\n",
" \"yumako-seed\",\n",
" \"jelly\",\n",
" \"jellynut\",\n",
" \"jellynut-seed\",\n",
" \"spoilage\",\n",
" \"pentapod-egg\",\n",
" \"tree-seed\",\n",
" \"biter-egg\"\n",
" ],\n",
" \"fluid_support\":False,\n",
" \"energy_output_W\":40000000,\n",
" }\n",
" }\n",
" stations = rc.get_station_requirements()\n",
"\n",
" total_req = sum([val.power for x,val in stations.items() if val.station.name != \"biochamber\"])+defense_W\n",
" tower_req = total_req*power_sources[\"heating-tower\"][\"energy_usage_W\"]/power_sources[\"heating-tower\"][\"energy_output_W\"]\n",
" rocket_fuel_req = rc.game_state.item_inventory.convert_fuel(tower_req,\"rocket-fuel\")\n",
" rc.set_user_requirement('rocket-fuel',rocket_fuel_req,1)\n",
" rc.calc_internal_requirements()\n",
"\n",
"power(rc)\n",
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "068db223-8283-4a89-8080-4061b20e0311",
"metadata": {},
"source": [
"Honestly, I've expected worse. Let's just add it and construct the base around this:"
]
},
{
"cell_type": "markdown",
"id": "1d092120-d997-4c07-8f86-3477ac6f7040",
"metadata": {},
"source": [
"### Pentapod Eggs\n",
"\n",
"This is a funny ingredient. \n",
"\n",
" - It's obtainable only by killing enemies (rafts and stompers) so any failures here will require a manual restart,\n",
" - It's a catalytic recipe, meaning we use the same ingredient and the [productivity bonus only applies to profit](https://www.reddit.com/r/factorio/comments/1gjz0x2/pentapod_egg_production_math/),\n",
" - Second ingredient is nutrients - you'd need quite a lot of them in fact (30),\n",
" - The eggs spoil to enemies on quite a timer (15min) so I'd recommend not transporting them anywhere far,\n",
" - The crafting time is somewhat long (15s).\n",
"\n",
"First time I was doing this, I completely forgot about them. Fortunately, I crossed the critical threshold and I was able to improvise it on the spot."
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "553588a2-c371-4f12-92b4-7d2b9b1f48ac",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>nutrients <img src=\"https://wiki.factorio.com/images/thumb/Nutrients.png/32px-Nutrients.png\" alt=\"nutrients\" title=\"nutrients\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>400.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 96</td><td>204.255 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 48</td><td>102.128 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>user_iron-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Iron_bacteria.png/32px-Iron_bacteria.png\" alt=\"iron-bacteria\" title=\"iron-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_copper-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Copper_bacteria.png/32px-Copper_bacteria.png\" alt=\"copper-bacteria\" title=\"copper-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def pentapod_eggs(rc):\n",
" prod_requirements = rc.get_production_requirements()\n",
" required_eggs = prod_requirements[\"pentapod-egg\"]\n",
"\n",
" pp_recipe = rc.game_state.recipe_inventory.get_recipe_by_name('r_pentapod-egg')\n",
" biochamber_station = rc.game_state.station_inventory.get_station_by_name('biochamber')\n",
"\n",
" egg_cultivation_modules = rc.game_state.module_inventory.get_modules_from_plan('r_pentapod-egg', 'biochamber')\n",
" egg_cultivation_beacons = rc.game_state.module_inventory.get_beacons_from_plan('r_pentapod-egg', 'biochamber')\n",
"\n",
" pp_ingredients, pp_products, pp_time_req, pp_power_req = rc.crafting_processor.run_recipe(\n",
" pp_recipe,\n",
" biochamber_station,\n",
" modules = egg_cultivation_modules,\n",
" beacons = egg_cultivation_beacons,\n",
" )\n",
" gained_eggs = next(filter(lambda x: x.item==\"pentapod-egg\", pp_products)).quantity\n",
" usable_eggs = gained_eggs - next(filter(lambda x: x.item==\"pentapod-egg\", pp_ingredients)).quantity\n",
" cycles_per_s_needed = required_eggs / usable_eggs\n",
" machines_needed = math.ceil(cycles_per_s_needed*pp_time_req)\n",
" pentapod_egg_station_req = StationReq(\n",
" station=biochamber_station,\n",
" count=machines_needed,\n",
" power=pp_power_req*machines_needed/pp_time_req,\n",
" modules = egg_cultivation_modules,\n",
" beacons=egg_cultivation_beacons,\n",
" )\n",
" rc.set_user_station_requirement('pentapod-egg', pentapod_egg_station_req)\n",
"\n",
" nutrients_needed = next(filter(lambda x: x.item==\"nutrients\", pp_ingredients)).quantity*cycles_per_s_needed\n",
" rc.set_user_requirement('nutrients', nutrients_needed, 1)\n",
"\n",
" water_needed = next(filter(lambda x: x.item==\"water\", pp_ingredients)).quantity*cycles_per_s_needed\n",
" rc.set_user_requirement('water', nutrients_needed, 1)\n",
"\n",
" rc.calc_internal_requirements()\n",
"\n",
"pentapod_eggs(rc)\n",
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "6d5d1f6a-14ed-4a24-8f8c-fe4ce616e4da",
"metadata": {},
"source": [
"### The Tyranny of Nutrients\n",
"\n",
"Now's a good time figuring out how many nutrients from bioflux we need. Another headache here is to calculate fuel needed to produce our fuel. That's easier said than done, since we need more fuel to produce ingredients for our fuel (bioflux) as well as more ingredients to produce ingredients for our fuel (the fruit) and to produce those we need even more fuel. This to me is the hard part of Gleba."
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "89f218b8-e37a-4c7d-9a22-d0764c47e2a5",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Producing 60.0 nutrients/s to cover 30.0 nutrients/s + 2.4499999999999993 nutrients/s\n"
]
}
],
"source": [
"def calc_biopower_nutrients(rc):\n",
" rc.calc_internal_requirements()\n",
" stations = rc.get_station_requirements()\n",
" bio_power = sum([x.power for k,x in stations.items() if x.station.name==\"biochamber\"])\n",
" nutrients_needed = rc.game_state.item_inventory.convert_fuel(bio_power,\"nutrients\")\n",
" return nutrients_needed\n",
"\n",
"def iterative_nutrients(rc):\n",
" # let's just add stations until we have enough\n",
" done = False\n",
" prod_requirements = rc.get_production_requirements()\n",
" stations = rc.get_station_requirements()\n",
" stations_included = stations[\"nutrients\"].count\n",
" additional_station_counter = 0\n",
" req_nutrients = prod_requirements[\"nutrients\"]\n",
" recipe = rc.game_state.recipe_inventory.get_recipe_by_name(\"r_nutrients_from_bioflux\")\n",
" biochamber_station = rc.game_state.station_inventory.get_station_by_name(\"biochamber\")\n",
" modules = rc.game_state.module_inventory.get_modules_from_plan(\"r_nutrients_from_bioflux\", \"biochamber\")\n",
" beacons = rc.game_state.module_inventory.get_beacons_from_plan(\"r_nutrients_from_bioflux\", \"biochamber\")\n",
" while not done:\n",
" station_counter = stations_included+additional_station_counter\n",
" ingredients, products, time_req, power_req = rc.crafting_processor.run_recipe_in_multiple_parallel_stations(\n",
" recipe,\n",
" biochamber_station,\n",
" station_counter,\n",
" modules,\n",
" beacons\n",
" )\n",
" nutrients_crafted = next(filter(lambda x:x.item==\"nutrients\", products)).quantity \n",
" nutrients_station_req = StationReq(\n",
" station=biochamber_station,\n",
" count=additional_station_counter,\n",
" power=power_req*(additional_station_counter/station_counter)/time_req,\n",
" modules = modules,\n",
" beacons=beacons,\n",
" )\n",
" if additional_station_counter != 0:\n",
" rc.set_user_station_requirement('nutrients', nutrients_station_req)\n",
" nutrients_needed = calc_biopower_nutrients(rc)\n",
" print(f\"Producing {nutrients_crafted} nutrients/s to cover {req_nutrients} nutrients/s + {nutrients_needed} nutrients/s\")\n",
" if nutrients_crafted >= req_nutrients+nutrients_needed:\n",
" done=True\n",
" else:\n",
" additional_station_counter += 1\n",
"\n",
"\n",
"iterative_nutrients(rc)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "3d796f37-b485-41e4-84bb-19557b954b4c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>nutrients <img src=\"https://wiki.factorio.com/images/thumb/Nutrients.png/32px-Nutrients.png\" alt=\"nutrients\" title=\"nutrients\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>4.0 MW </td><td> </td><td>Module(name=\"beacons\", speed=-0.6666666666666666, energy=0, quality=0, productivity=0)</td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 1</td><td>375.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>360.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 2</td><td>750.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12</td><td>2.16 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22</td><td>3.96 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>400.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 96</td><td>204.255 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 48</td><td>102.128 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>user_iron-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Iron_bacteria.png/32px-Iron_bacteria.png\" alt=\"iron-bacteria\" title=\"iron-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_copper-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Copper_bacteria.png/32px-Copper_bacteria.png\" alt=\"copper-bacteria\" title=\"copper-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 6</td><td>600.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"<tr><td>user_pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 8</td><td>800.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>No Effect </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"stations = rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "4391db99-2cd5-44d8-8a11-6c3f54399361",
"metadata": {},
"source": [
"## The Schema\n",
"\n",
"Using the table above, I was able to implement my Gleba base. It carried me all the way to victory. It's surprisingly resilitent, it can even handle some choking on spoilage. The schema is taken from [my star](https://factorio.com/galaxy/Iron%20I:%20Epsilon7-2.D2V2) in [Galaxy of Fame](https://factorio.com/galaxy/) (a fantastic feature).\n",
"\n",
"When I was building this according to this sheet I've completely forgotten about the pentapod eggs. But I was able to upscale it a bit using speed modules. Also, the original sheet used to build this had issues, namely I was always short on copper (now I see why) and it seems that I could do with more Yumako, but it wasn't an issue really. \n",
"\n",
"Also, I wasn't really using exports of carbon fiber and bioflux until the very end of the game. Yes, I am desperately trying to explain the discrepancies, but alas, I don't know. \n",
"\n",
"The lowest belt is the spoilage belt, goes slightly up to the heating towers, which is near rocket fuels and turbines. The rest of the base is to the right, with some belts going to farms. "
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "46ba7166-195a-4be4-9063-f4dcbfcd4e5d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"https://nook.miloslavhomer.cz/public/small_gleba_scheme.png\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Image(url=\"https://nook.miloslavhomer.cz/public/small_gleba_scheme.png\")"
]
},
{
"cell_type": "markdown",
"id": "9f43c653-9349-4400-833b-f14efc2992d6",
"metadata": {},
"source": [
"# Megabase calculations\n",
"\n",
"Now that we've completed the tutorial, let's crank it up to 22.5 agri science per second. We'll also need some goodies for the promethium science. As we're targeting 22.5 promethium science per second, we also need biter eggs and carbon fiber for quantum processors.\n",
"\n",
"We need 1 quantum processor per 10 promethium science, which means we need 2.25 carbon fibre per second.\n",
"\n",
"We need 10 biter eggs per 10 promethium science. One spawner produces 0.5 eggs/s and eats 1 bioflux in a minute. That brings us to:"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "f57b8f27-5370-4a75-b8b2-1656a01be994",
"metadata": {},
"outputs": [],
"source": [
"prod_targets_per_s = {\n",
" \"agricultural-science-pack\":22.5,\n",
" \"carbon-fiber\": 2.25,\n",
" \"bioflux\":(22.5/0.5)/60\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "f556dd09-0fb1-41f6-845d-77ce28283894",
"metadata": {},
"source": [
"But, we have some serious productivity researches done. Let's set those:"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "1f975246-263b-4381-af96-2d63215036a6",
"metadata": {},
"outputs": [],
"source": [
"mega_game_state = GameState()\n",
"mega_game_state.init_this_dataset()\n",
"mega_game_state.set_productivity_research_value('steel-plate', 10)\n",
"mega_game_state.set_productivity_research_value('low-density-structure', 10)\n",
"mega_game_state.set_productivity_research_value('processing-unit', 10)\n",
"mega_game_state.set_productivity_research_value('rocket-fuel', 10)\n",
"mega_game_state.set_productivity_research_value('rocket-part', 8)\n",
"mega_game_state.set_productivity_research_value('plastic-bar', 10)\n",
"\n",
"mega_crafting_processor = CraftingProcessor(game_state, stop_items)\n",
"mega_rc = RequirementCache(mega_game_state)"
]
},
{
"cell_type": "markdown",
"id": "b047a5d9-36e8-490c-bfb2-146bb419e0e1",
"metadata": {},
"source": [
"## Module plans\n",
"\n",
"Same as before, let's make our biochambers efficient:"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "f8e019e0-5189-4a03-a361-796898f0bef6",
"metadata": {},
"outputs": [],
"source": [
"efficiency_modules_bio(mega_rc)"
]
},
{
"cell_type": "markdown",
"id": "59d88299-ffa9-4850-8e20-5bf1db8670b4",
"metadata": {},
"source": [
"One change I'd like to make is to stuff the rocket silo with speed modules lvl3 to speed-up the process:"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "f03cd597-738b-4000-ba2c-25303c21ecd0",
"metadata": {},
"outputs": [],
"source": [
"mega_rc.game_state.module_inventory.add_module_plan('r_rocket-part', 'rocket-silo', ['speed-module-3', 'speed-module-3', 'speed-module-3', 'speed-module-3'])"
]
},
{
"cell_type": "markdown",
"id": "db5223cf-a66d-469d-b7af-787c5fb307cc",
"metadata": {},
"source": [
"Also, let's align the furnaces to 1 plate per second using speed modules. "
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "e3285c30-7980-4e78-a7ec-3b4779ee00e1",
"metadata": {},
"outputs": [],
"source": [
"mega_rc.game_state.module_inventory.add_module_plan('r_iron-plate', 'electric-furnace', ['speed-module-2', 'speed-module-2'])\n",
"mega_rc.game_state.module_inventory.add_module_plan('r_copper-plate', 'electric-furnace', ['speed-module-2', 'speed-module-2'])\n",
"mega_rc.game_state.module_inventory.add_module_plan('r_steel-plate', 'electric-furnace', ['speed-module-2', 'speed-module-2'])"
]
},
{
"cell_type": "markdown",
"id": "37899daf-6ee2-4635-bd3d-dbc416968163",
"metadata": {},
"source": [
"It's unfortunate that producing nutrients with bioflux gets you 40 every odd iteration and 80 every even iteration. That's kinda hard to manage, so I've tried to imbalance this with prod modules a bit. Since these make the stations rather nutrient hungry, I've deployed some beacons:"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "11cc8cd5-d60e-46d4-b54e-d69825228f92",
"metadata": {},
"outputs": [],
"source": [
"mega_rc.game_state.module_inventory.add_module_plan(\n",
" 'r_nutrients_from_bioflux', \n",
" 'biochamber', \n",
" ['speed-module-3', 'productivity-module-3', 'productivity-module-3', 'efficiency-module-3'],\n",
" Module('beacons', energy=-2.6) # that's three beacons stuffed with efficency 3s\n",
")"
]
},
{
"cell_type": "markdown",
"id": "75694883-f87c-43ef-8fd3-c59dc09e3c1e",
"metadata": {},
"source": [
"Plus I've fiddled a bit with modules of pentapod eggs, since I really wanted 1 egg chamber per sci chamber."
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "30560db3-7a68-44d2-8157-e3849c0e37b5",
"metadata": {},
"outputs": [],
"source": [
"mega_rc.game_state.module_inventory.add_module_plan('r_pentapod-egg', 'biochamber', ['efficiency-module-3', 'speed-module-3', 'speed-module-3', 'speed-module-3'])"
]
},
{
"cell_type": "markdown",
"id": "c4147f43-36f6-436c-9439-6adb3718db9e",
"metadata": {},
"source": [
"## Run it again!\n",
"\n",
"I've made sure that the playbook is replayable. So let's do all of the above again. "
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "50611a6d-5013-4412-b0a7-76f767fdca3b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"To sustain 0.75 bioflux/s we need to transport 127.5 resources over 170.0s\n",
"To sustain 2.25 carbon-fiber/s we need to transport 382.5 resources over 170.0s\n",
"To sustain 22.5 agricultural-science-pack/s we need to transport 3825.0 resources over 170.0s\n",
"Producing 272.0 nutrients/s to cover 300.0 nutrients/s + 26.299999999999994 nutrients/s\n",
"Producing 340.0 nutrients/s to cover 300.0 nutrients/s + 26.349999999999994 nutrients/s\n"
]
}
],
"source": [
"mega_rc.clear_internal_requirements()\n",
"for k,v in prod_targets_per_s.items():\n",
" mega_rc.set_user_requirement(k,v,1)\n",
"mega_rc.calc_internal_requirements()\n",
"calculate_required_rocket_parts(mega_rc)\n",
"mega_rc.calc_internal_requirements()\n",
"bacteria(mega_rc)\n",
"power(mega_rc)\n",
"pentapod_eggs(mega_rc)\n",
"iterative_nutrients(mega_rc)"
]
},
{
"cell_type": "markdown",
"id": "fb372951-90cc-479d-b82d-333838c66a0b",
"metadata": {},
"source": [
"Last thing to do - let's take a look:"
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "88edb4e7-9faf-426e-8b8e-23749dc18c4d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tbody>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 22.5 </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2.25 </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 53.95 </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.3875 </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.32958</td></tr>\n",
"<tr><td>nutrients <img src=\"https://wiki.factorio.com/images/thumb/Nutrients.png/32px-Nutrients.png\" alt=\"nutrients\" title=\"nutrients\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">300 </td></tr>\n",
"<tr><td>pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 15 </td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.6 </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">155 </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>spoilage <img src=\"https://wiki.factorio.com/images/thumb/Spoilage.png/32px-Spoilage.png\" alt=\"spoilage\" title=\"spoilage\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 17 </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2.5 </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 12.0833 </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 32.5 </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4.58333</td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1 </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">126 </td></tr>\n",
"<tr><td>water <img src=\"https://wiki.factorio.com/images/thumb/Water.png/32px-Water.png\" alt=\"water\" title=\"water\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\">118 </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 41.6667 </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 16.5 </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 5 </td></tr>\n",
"<tr><td>iron-ore <img src=\"https://wiki.factorio.com/images/thumb/Iron_ore.png/32px-Iron_ore.png\" alt=\"iron-ore\" title=\"iron-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 17 </td></tr>\n",
"<tr><td>copper-ore <img src=\"https://wiki.factorio.com/images/thumb/Copper_ore.png/32px-Copper_ore.png\" alt=\"copper-ore\" title=\"copper-ore\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 33 </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 52 </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 22 </td></tr>\n",
"<tr><td>yumako-seed <img src=\"https://wiki.factorio.com/images/thumb/Yumako_seed.png/32px-Yumako_seed.png\" alt=\"yumako-seed\" title=\"yumako-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1.04 </td></tr>\n",
"<tr><td>jellynut-seed <img src=\"https://wiki.factorio.com/images/thumb/Jellynut_seed.png/32px-Jellynut_seed.png\" alt=\"jellynut-seed\" title=\"jellynut-seed\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 0.44 </td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display_table(dict_to_table(mega_rc.get_production_requirements()))"
]
},
{
"cell_type": "markdown",
"id": "12f30f17-0094-4bd9-9e90-a40c6ede29d4",
"metadata": {},
"source": [
"And stations:"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "f5a99b36-6dfd-4f85-a04c-e81c9f7cbe5e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<thead>\n",
"<tr><th>id </th><th>station </th><th style=\"text-align: right;\"> count</th><th>power </th><th>modules </th><th>beacons </th></tr>\n",
"</thead>\n",
"<tbody>\n",
"<tr><td>nutrients <img src=\"https://wiki.factorio.com/images/thumb/Nutrients.png/32px-Nutrients.png\" alt=\"nutrients\" title=\"nutrients\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>400.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Productivity_module_3.png/32px-Productivity_module_3.png\" alt=\"productivity-module-3\" title=\"productivity-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Productivity_module_3.png/32px-Productivity_module_3.png\" alt=\"productivity-module-3\" title=\"productivity-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_3.png/32px-Efficiency_module_3.png\" alt=\"efficiency-module-3\" title=\"efficiency-module-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>Module(name=\"beacons\", speed=0, energy=-2.6, quality=0, productivity=0)</td></tr>\n",
"<tr><td>agricultural-science-pack <img src=\"https://wiki.factorio.com/images/thumb/Agricultural_science_pack.png/32px-Agricultural_science_pack.png\" alt=\"agricultural-science-pack\" title=\"agricultural-science-pack\" decoding=\"async\" width=\"32\" height=\"32\"></td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 30</td><td>3.0 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>carbon-fiber <img src=\"https://wiki.factorio.com/images/thumb/Carbon_fiber.png/32px-Carbon_fiber.png\" alt=\"carbon-fiber\" title=\"carbon-fiber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 4</td><td>400.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-part <img src=\"https://wiki.factorio.com/images/thumb/Rocket_part.png/32px-Rocket_part.png\" alt=\"rocket-part\" title=\"rocket-part\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Rocket_silo.png/32px-Rocket_silo.png\" alt=\"rocket-silo\" title=\"rocket-silo\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>15.2 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>carbon <img src=\"https://wiki.factorio.com/images/thumb/Carbon.png/32px-Carbon.png\" alt=\"carbon\" title=\"carbon\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7</td><td>700.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>processing-unit <img src=\"https://wiki.factorio.com/images/thumb/Processing_unit.png/32px-Processing_unit.png\" alt=\"processing-unit\" title=\"processing-unit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 4</td><td>1.5 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>low-density-structure <img src=\"https://wiki.factorio.com/images/thumb/Low_density_structure.png/32px-Low_density_structure.png\" alt=\"low-density-structure\" title=\"low-density-structure\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 6</td><td>2.25 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>rocket-fuel <img src=\"https://wiki.factorio.com/images/thumb/Rocket_fuel.png/32px-Rocket_fuel.png\" alt=\"rocket-fuel\" title=\"rocket-fuel\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>300.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>advanced-circuit <img src=\"https://wiki.factorio.com/images/thumb/Advanced_circuit.png/32px-Advanced_circuit.png\" alt=\"advanced-circuit\" title=\"advanced-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 5</td><td>1.875 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfuric-acid <img src=\"https://wiki.factorio.com/images/thumb/Sulfuric_acid.png/32px-Sulfuric_acid.png\" alt=\"sulfuric-acid\" title=\"sulfuric-acid\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Chemical_plant.png/32px-Chemical_plant.png\" alt=\"chemical-plant\" title=\"chemical-plant\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>210.0 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>steel-plate <img src=\"https://wiki.factorio.com/images/thumb/Steel_plate.png/32px-Steel_plate.png\" alt=\"steel-plate\" title=\"steel-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 3</td><td>1.188 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>electronic-circuit <img src=\"https://wiki.factorio.com/images/thumb/Electronic_circuit.png/32px-Electronic_circuit.png\" alt=\"electronic-circuit\" title=\"electronic-circuit\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 5</td><td>1.875 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>plastic-bar <img src=\"https://wiki.factorio.com/images/thumb/Plastic_bar.png/32px-Plastic_bar.png\" alt=\"plastic-bar\" title=\"plastic-bar\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>sulfur <img src=\"https://wiki.factorio.com/images/thumb/Sulfur.png/32px-Sulfur.png\" alt=\"sulfur\" title=\"sulfur\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 2</td><td>200.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>copper-cable <img src=\"https://wiki.factorio.com/images/thumb/Copper_cable.png/32px-Copper_cable.png\" alt=\"copper-cable\" title=\"copper-cable\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Assembling_machine_3.png/32px-Assembling_machine_3.png\" alt=\"assembling-machine-3\" title=\"assembling-machine-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td style=\"text-align: right;\"> 9</td><td>3.375 MW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>iron-plate <img src=\"https://wiki.factorio.com/images/thumb/Iron_plate.png/32px-Iron_plate.png\" alt=\"iron-plate\" title=\"iron-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 17</td><td>6.732 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>bioflux <img src=\"https://wiki.factorio.com/images/thumb/Bioflux.png/32px-Bioflux.png\" alt=\"bioflux\" title=\"bioflux\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 27</td><td>2.7 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>copper-plate <img src=\"https://wiki.factorio.com/images/thumb/Copper_plate.png/32px-Copper_plate.png\" alt=\"copper-plate\" title=\"copper-plate\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Electric_furnace.png/32px-Electric_furnace.png\" alt=\"electric-furnace\" title=\"electric-furnace\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 33</td><td>13.068 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_2.png/32px-Speed_module_2.png\" alt=\"speed-module-2\" title=\"speed-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako-mash <img src=\"https://wiki.factorio.com/images/thumb/Yumako_mash.png/32px-Yumako_mash.png\" alt=\"yumako-mash\" title=\"yumako-mash\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 26</td><td>2.6 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>jelly <img src=\"https://wiki.factorio.com/images/thumb/Jelly.png/32px-Jelly.png\" alt=\"jelly\" title=\"jelly\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 11</td><td>1.1 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>yumako <img src=\"https://wiki.factorio.com/images/thumb/Yumako.png/32px-Yumako.png\" alt=\"yumako\" title=\"yumako\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 312</td><td>663.83 kW </td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>jellynut <img src=\"https://wiki.factorio.com/images/thumb/Jellynut.png/32px-Jellynut.png\" alt=\"jellynut\" title=\"jellynut\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Agricultural_tower.png/32px-Agricultural_tower.png\" alt=\"agricultural-tower\" title=\"agricultural-tower\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 132</td><td>280.851 kW</td><td> </td><td>No Effect </td></tr>\n",
"<tr><td>user_iron-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Iron_bacteria.png/32px-Iron_bacteria.png\" alt=\"iron-bacteria\" title=\"iron-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 7</td><td>700.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>user_copper-bacteria <img src=\"https://wiki.factorio.com/images/thumb/Copper_bacteria.png/32px-Copper_bacteria.png\" alt=\"copper-bacteria\" title=\"copper-bacteria\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 14</td><td>1.4 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_2.png/32px-Efficiency_module_2.png\" alt=\"efficiency-module-2\" title=\"efficiency-module-2\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>user_pentapod-egg <img src=\"https://wiki.factorio.com/images/thumb/Pentapod_egg.png/32px-Pentapod_egg.png\" alt=\"pentapod-egg\" title=\"pentapod-egg\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 30</td><td>39.0 MW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_3.png/32px-Efficiency_module_3.png\" alt=\"efficiency-module-3\" title=\"efficiency-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td>No Effect </td></tr>\n",
"<tr><td>user_nutrients <img src=\"https://wiki.factorio.com/images/thumb/Nutrients.png/32px-Nutrients.png\" alt=\"nutrients\" title=\"nutrients\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td><img src=\"https://wiki.factorio.com/images/thumb/Biochamber.png/32px-Biochamber.png\" alt=\"biochamber\" title=\"biochamber\" decoding=\"async\" width=\"32\" height=\"32\"> </td><td style=\"text-align: right;\"> 1</td><td>100.0 kW </td><td><img src=\"https://wiki.factorio.com/images/thumb/Speed_module_3.png/32px-Speed_module_3.png\" alt=\"speed-module-3\" title=\"speed-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Productivity_module_3.png/32px-Productivity_module_3.png\" alt=\"productivity-module-3\" title=\"productivity-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Productivity_module_3.png/32px-Productivity_module_3.png\" alt=\"productivity-module-3\" title=\"productivity-module-3\" decoding=\"async\" width=\"32\" height=\"32\"><img src=\"https://wiki.factorio.com/images/thumb/Efficiency_module_3.png/32px-Efficiency_module_3.png\" alt=\"efficiency-module-3\" title=\"efficiency-module-3\" decoding=\"async\" width=\"32\" height=\"32\"></td><td>Module(name=\"beacons\", speed=0, energy=-2.6, quality=0, productivity=0)</td></tr>\n",
"</tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"stations = mega_rc.get_station_requirements()\n",
"render_station_requirements(stations)"
]
},
{
"cell_type": "markdown",
"id": "1c6d1a2b-a29a-48dd-891e-635ef2907cb0",
"metadata": {},
"source": [
"That's a lot of biochambers. I'd also need some overgrowth soil so I can expand my farms. It'd take 8 yumako farms and 3 jellynut farms. Which... isn't that bad. Also, we'll need cliff explosives and some serious belt deliveries. "
]
},
{
"cell_type": "markdown",
"id": "88031958-e0b2-42e6-b951-938de097c5f9",
"metadata": {},
"source": [
"## Schematic\n",
"\n",
"So, here's the schematic of the base as implemented by the design (almost). I've bumped a bit some numbers to have good alignments. Also, I am missing some overgrowth soil, so the farms should expand some more to have full capacity. And yes, I am missing some defences (and I expect an attack soon, yay)."
]
},
{
"cell_type": "code",
"execution_count": 52,
"id": "e1d76314-5b6d-4286-984c-0d9e46654232",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"https://nook.miloslavhomer.cz/public/megagleba.png\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Image(url=\"https://nook.miloslavhomer.cz/public/megagleba.png\")"
]
},
{
"cell_type": "markdown",
"id": "904bdfdc-af44-48b6-b103-eb75b2d98a5c",
"metadata": {},
"source": [
"That being said, it works as intended (as noted above, it still needs some more input fruit):"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "3bef2790-d9f6-44d9-b7e2-1c9944ee4373",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"https://nook.miloslavhomer.cz/public/megagleba_production.png\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Image(url=\"https://nook.miloslavhomer.cz/public/megagleba_production.png\")"
]
},
{
"cell_type": "markdown",
"id": "a1c44170-3304-4c1d-bf3b-5f302968fa89",
"metadata": {},
"source": [
"## Other practical tips and tricks\n",
"\n",
" - Since eggs spoil to enemies, I won't be transporting them anywhere and I'll just setup a closed perimeter where I manufacture all of the relevant products.\n",
" - To defend the base and the farms I'll use lasers and teslas. Instead of acumulators I'll use the storage tanks with steam. I think that no walls are needed, those things walk over them anyway.\n",
" - Don't be afraid of circuit network.\n",
" - Those damn pentapod eggs take forever to cultivate.\n",
" - Nutrients are a great source of spoilage - you get a lot of them and they spoil fast.\n",
" - Don't forget the trash flushing system - one heating tower can handle a lot of spoilage, but you need to belt it up properly.\n",
" - I recommend having recyclers for bacteries - be prepared to throw away the full production. This actually keeps the system alive, because if it chokes, bacteria turn into ore and then you have nothing to cultivate."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment