Proposal: Factory Metrics

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Hermitude
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Jul 05, 2017 8:13 am
Contact:

Proposal: Factory Metrics

Post by Hermitude »

This is an idea thread for a mod project. It's open to thoughts or contributions from everyone.

The basic premise is that most people have only a few ways to "measure" their factory's operations. Usually it's SPM or rockets or some other item production rate. If you like building megabases, then UPS is a technical benchmark.

But what about factory efficiency? Is there a way to build a factory that is lean and efficient? Here are some ideas, feel free to add more:
  • Theoretical production capacity versus actual consumption. This would be a measure of how much excess infrastructure you dedicate to a given item production, usually ores but not limited to those.
  • Train idle time as a percentage. Logistic bot idle time as a percentage. These are also "excess" measures targeted toward transport machines.
  • Rail segment contention (1): for each rail segment, add any occupant train's acceleration or decelleration into an accumulator. Use a low-pass filter on that, then render accumulator values overlaid on the rail network to view which stops are causing trains to slow down / speed up.
  • Rail segment contention (2): for each rail segment, if it goes from green to red, add 1 to an accumulator. Again, use a low-pass filter to get a finite score. Render accumulator values as with (1).
  • Bottleneck identification: can this be done with Lua over transport belt segments, inserters, loaders, splitters, etc?
  • Space efficiency(1): given for each item; take its production rate and divide by the total space occupied by all your factory's structures. This gives a vector of "spatial efficiencies" one for each item. You can also take weighted combinations of these to get a family of factory space efficiency metrics.
  • Space efficiency(2): similar to the (1), but divide by the space of the convex hull of your factory. (Not for factories with numerous satellites.)
I'll revise these as I think of new metrics -- I just don't have the time to start writing the mod for a few weeks yet, and don't want to forget these before then.
Last edited by Hermitude on Mon Nov 18, 2019 7:49 pm, edited 3 times in total.

Amarula
Filter Inserter
Filter Inserter
Posts: 509
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Re: Proposal: Factory Metrics

Post by Amarula »

I am all about the data (and visualizing that data!) This is a great start.
While not directly related to efficiency, metrics on pollution would be a very useful addition to this suite of metrics.
My own personal Factorio super-power - running out of power.

pleegwat
Filter Inserter
Filter Inserter
Posts: 255
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Proposal: Factory Metrics

Post by pleegwat »

Average distance any item is transported in its lifetime.

Hermitude
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Jul 05, 2017 8:13 am
Contact:

Re: Proposal: Factory Metrics

Post by Hermitude »

Amarula wrote:
Mon Nov 18, 2019 3:44 pm
I am all about the data (and visualizing that data!) This is a great start.
While not directly related to efficiency, metrics on pollution would be a very useful addition to this suite of metrics.
This is a neat one. My initial impression is that it's difficult to expand on the existing pollution map. It's also difficult for a user to control pollution since it is always directly proportional to each crafting machine's products. So, a base that produces x products then produces c*x pollution. The only factors that a player controls outside of x are the layout, the belt buses, the logistics, and circuit logic etc. These factors aren't big contributors to pollution (to my knowledge, I could be wrong) so it's hard to see how a user would be able to use this information.

Mostly I'm trying to derive metrics that a player could use to optimize their factory. So it should be something they can control directly without simply producing at a slower rate.

Hermitude
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Jul 05, 2017 8:13 am
Contact:

Re: Proposal: Factory Metrics

Post by Hermitude »

pleegwat wrote:
Mon Nov 18, 2019 4:56 pm
Average distance any item is transported in its lifetime.
This is a great one. It might be difficult to implement since the "life" of an item is difficult to define when it enters a stack. Maybe a way to implement this would be to measure the paths between the assemblers in a supply chain.

pleegwat
Filter Inserter
Filter Inserter
Posts: 255
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Proposal: Factory Metrics

Post by pleegwat »

Hermitude wrote:
Mon Nov 18, 2019 11:37 pm
pleegwat wrote:
Mon Nov 18, 2019 4:56 pm
Average distance any item is transported in its lifetime.
This is a great one. It might be difficult to implement since the "life" of an item is difficult to define when it enters a stack. Maybe a way to implement this would be to measure the paths between the assemblers in a supply chain.
I don't think you actually want to keep track for each item separately - just aggregate it per type, and divide by production, consumption, or the average of those. Not doable in lua since you don't have the events (and performance would be horrible if you did). In C++, trains should be easy enough and inserters are trivial especially if you ignore any chasing in the metric, but belts might be tricky.

Post Reply

Return to “Modding discussion”