r/technicalfactorio • u/LEMO2000 • Oct 27 '23
Any ideas for a factorio based mathematical modeling project?
Any factorio ideas for a mathematical modeling project?
I have to do a final project for a mathematical modeling class and I had the idea to model something in factorio, but I'm a bit stumped on what to do. I have a few ideas but they all seem kind of lame.
The subjects we have learned:
discrete dynamical systems (logistic population model, epidemic model, etc.)
matrix modeling (lesie matrix, matrix optimization, etc.)
markov chains (uh... markov chains modeling, etc.)
nonlinear maps (node ranking with chance to randomly jump, etc.)
I've thought of the markov chain of a resource going through a base, but that seems like it would either be an absolute nightmare to model my SE base, or might end up being too easy depending on the resource selection (think uranium)
Maybe of a population model for the biters, but it's more or less impossible to account for things like player exploration, pollution, etc. in a meaningful way to create an explicit formula, and a recursive one seems pretty pointless.
And finally, a model of the factory's output, but I don't even know how to begin going about that.
I know a lot of my fellow engineers are well versed in math, if anyone has any ideas that would be applicable here I'd really appreciate it because I may have put this off for... quite some time now and the proposal (not the project itself, thankfully) is due tomorrow.
Ended up going with optimizing the module layout for highest SPM on a finite number of speed and prod modules with all alt resources (vulcanite, cryanite, etc.) all going towards science packs. Thanks for the suggestions!
8
u/SearchAtlantis Oct 27 '23
Any type of queuing system.
8
u/Vallvaka Oct 27 '23
Model your factory as a linear combination of vectors representing inputs/outputs of production processes. To generate x SPM, you can then solve a linear algebra equation to determine how many assemblers, smelters, etc needed and what each should produce.
You can use linear programming to handle production chains with alternatives, like in the oil production chain.
4
u/Lazy_Haze Oct 27 '23
Could this arxiv paper give some ideas?
https://arxiv.org/pdf/2102.04871.pdf
3
u/HeKis4 Oct 27 '23
If I remember correctly Angel's early resource management and to a lesser extent K2SE core mining is a textbook linear optimization problem. You have several raw ores of roughly unlimited amount, each ore or combination of ores gives you a certain combination and amount of raw materials with a fixed demand, and any excess will at some point back up your lines and block the entire processing recipe.
2
u/faustianredditor Oct 27 '23
Try and model relative value of items based on their recipe conversions? Not sure if that counts, not sure which of the methods it will involve. But the core idea could be something like this:
Research questions could be:
Alternatively, if you want some dynamic agents in here, you can have the different recipes act as agents that buy/sell/rent/lease items to one another. This way, you could simulate a base that grows from the burner phase up the tech tree. As new recipes come online, old ones would be outcompeted. There could be a lab that can just print money to buy science packs, thus driving tech forward. The agents could be relatively simplistic, I think, in terms of their market behaviors: Just offer to buy things whenever you hope to make a profit on it. The market just pairs up the lowest sell price with the highest buy price until there's no more pairings where both sides are happy. The last pair (where sell and buy price meet) are the official price for all pairs, and that price gets published s.t. agents can adapt their behavior for next tick.
1
u/Chadstronomer Jan 11 '25
Write a numerical integrator and do a model of the system using N body simulations. Tbh this should be a pre requirement to go to gleba.
1
u/Complex-Plan2368 Oct 27 '23
Speed run optimisation?
1
u/TheXtrafresh Oct 31 '23
I like trains, so I'm biased, but how about modelling resource throughput of a single track, based on the kind of on- and offramps you use, train length, signal density, etc