ScottJDaley / ada

A Discord bot for the Satisfactory video game.
MIT License
33 stars 5 forks source link

GraphViz edges do not always have the correct value #52

Closed ScottJDaley closed 4 years ago

ScottJDaley commented 4 years ago

The edge value is based on the total amount required by the recipe on the receiving end for an item. If multiple edges are pointing to the same recipe for the same item, they will both have the total instead of the proportional amount.

I don't thinking taking the min of target and source recipe amount works in some edge cases either. May need to add variables or do something complicated here.

ScottJDaley commented 4 years ago

image

Example of multiple inputs and multiple outputs resulting in the issue

ScottJDaley commented 4 years ago

another repro:

produce 60 iron plate and 60 iron rods from 60 resource.* without refineries

ScottJDaley commented 4 years ago

There are two ways to solve this problem. The easy way is to divide sources proportionally across all sinks of that item. But that results in a lot of unnecessary crossing edges in the graphviz.

Another way is to try and match large sources with large sinks, fully consuming them if possible.

ScottJDaley commented 4 years ago

Opted for easy solution for now.