Commit 22574c49 authored by Fedja Beader's avatar Fedja Beader
Browse files

biofuel: unfinished skeleton + more todos

parent 0de6c79b
......@@ -147,6 +147,9 @@ end
-- DONE: distribute output of N machines evenly into M machines
-- TODO: Individual outputs can differ (greatly). Prefer taking items from where they are relatively more abundant
-- TODO: Free slots of destinations can also differ greatly. E.g. a ladder autocrafter (24) versus refinery (9)
-- TODO: Some machines have only one input slot (furnace)
-- TODO: Some machines have take more than one item to produce an output item (autocrafters,alloyers).
-- Ensure that the number of different input items is equal (so that the machines's input is empty when it stops processing).
-- TODO: Prioritise destinations with lowest amount of input and sources with highest amount of output
-- TODO: item consumption rates of different machines can also differ greatly. Give more to faster machines.
-- TODO: Some in destinations may not have C/M space left
......@@ -165,7 +168,9 @@ end
-- from_invlist and to_locations_list are lists of ItemLocations, one for each node
-- This function attempts to set up an evenly spread item move,
-- using full itemstacks from sources and empty locations in destinations (for now)
local function setup_multimove(from_locations_list, to_locations_list)
local function setup_multimove(from_locations_list, to_locations_list, item_name)
local item_stack = ItemStack(item_name)
local stack_max = item_stack:get_stack_max() or 99
local input_stacks = 0
local sources = {}
-- count available stacks of items
......@@ -249,10 +254,11 @@ local function setup_machine_network(from_positions, to_positions, item_name)
local destinations = {}
for i,pos in pairs(to_positions) do
local to = ItemLocations:new()
--to:collect(pos, "src", item_name)
to:collect(pos, "src", "")
table.insert(destinations, to)
setup_multimove(sources, destinations)
setup_multimove(sources, destinations, item_name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment