Nano factory with push down automata

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
gridstop
Inserter
Inserter
Posts: 31
Joined: Sun Jul 17, 2016 1:46 am

Nano factory with push down automata

Post by gridstop » Sun Mar 19, 2017 2:40 pm

So ever since I saw Case's original nano factory viewtopic.php?f=8&t=27349 I wanted to do something like that. And I had been experimenting with state machines for solving train issues, so I figured I'd give a universal nano factory w/ push down automata a try.

This uses a single assembly machine (plus two for barelling, more on that later) to build any item in the game, and automatically compute & build all the intermediates in the same machine. The crafting combinator viewtopic.php?f=93&t=34405 is used to switch recipes and compute intermediate products.
The state machine
The stack
The basic operation is something like this. When idle, if there is something on the stack, pop it off the stack into the temp register. Figure out the sub-components, if we have what we need to build it in storage, go ahead and build it. If we are missing at least one sub-component, push the temp register back onto the stack, then go through each sub-component, and anything we're missing push that on the stack too, and go back to idle.
Example transition rules
The assembler
Fluid handling
You could use the same setup to do all your chemical plant stuff as well. Though if you didn't have separate light oil cracking it would probably spend all its time doing that. So far this is just built in creative mode, I'm trying to decide if it's worth trying to actually build a factory using this. It'll probably depend on if there's anything in 0.15 for handling blueprints earlier. I don't really want to rebuild it all by hand.

Practical? Of course not. But it was a lot of fun and taking on the challenge made me feel good about my theory of computation class in college (anybody need a context free language parsed in factorio?), as well as learning a lot about combinators.

Ratzap
Filter Inserter
Filter Inserter
Posts: 360
Joined: Sun Aug 16, 2015 11:15 pm

Re: Nano factory with push down automata

Post by Ratzap » Mon Mar 20, 2017 5:24 pm

Very nice. The first question that springs to mind is this: how easy would it be (or is it even possible) to fetch open logistics requests from the player which cannot be satisfied from storage and then build them for delivery.

Eg: request 3 pumpjacks, 1 in storage then the nano factory builds the last two and places them in storage.

gridstop
Inserter
Inserter
Posts: 31
Joined: Sun Jul 17, 2016 1:46 am

Re: Nano factory with push down automata

Post by gridstop » Mon Mar 20, 2017 10:33 pm

Ratzap wrote:Very nice. The first question that springs to mind is this: how easy would it be (or is it even possible) to fetch open logistics requests from the player which cannot be satisfied from storage and then build them for delivery.

Eg: request 3 pumpjacks, 1 in storage then the nano factory builds the last two and places them in storage.
Thanks!

I was trying to figure out a way to see if you could get a 'unsatisfied requests' count from the network. I know when bots are in flight sometimes you can see negative numbers in the logistics network's contents, but I'm not sure what that represents precisely, and it doesn't show you simply 'amount of requests'. For instance a network with a requester box asking for 50 copper, but no actual copper in the network just shows no signal from the roboport.

Case
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Tue Jun 28, 2016 9:25 am

Re: Nano factory with push down automata

Post by Case » Tue Mar 21, 2017 9:09 am

Wow ... just wow .. very impressive.

I would like to see this thing in action - so plz :) make a nano factory out of this concept.

Take Care
Case

gridstop
Inserter
Inserter
Posts: 31
Joined: Sun Jul 17, 2016 1:46 am

Re: Nano factory with push down automata

Post by gridstop » Tue Mar 21, 2017 9:51 pm

Case wrote:Wow ... just wow .. very impressive.

I would like to see this thing in action - so plz :) make a nano factory out of this concept.

Take Care
Case
Thanks! Ever since I saw your factory I wanted to build one, but I'm too lazy to sit there and change the recipes to make everything. Hence... this contraption.

gridstop
Inserter
Inserter
Posts: 31
Joined: Sun Jul 17, 2016 1:46 am

Re: Nano factory with push down automata

Post by gridstop » Thu May 11, 2017 10:49 pm

I did actually do this before 15.0 dropped. Got lazy bastard too. Research took a LONG time. Let it run overnight twice.

Here's the final setup. I used the crafted artifacts mod to make the chemical processes more interesting (had to make superconductors). Otherwise all it would ever do is make sulfuric & plastic. And since I wasn't going to run with biters.
nano-4.png
nano-4.png (2.83 MiB) Viewed 5679 times
At this point everything was fully automated, I could put it into 'research mode' where it would automatically queue & construct science packs, and I used the research queue mod to keep it going when I was away.

Victory. I feel bad for running over those 4 trees.
nano-win.png
nano-win.png (265.12 KiB) Viewed 5679 times

kann_
Inserter
Inserter
Posts: 44
Joined: Fri Apr 15, 2016 4:36 pm

Re: Nano factory with push down automata

Post by kann_ » Mon Jul 31, 2017 11:43 am

That is super cool. I was building a very similar setup, but wasn't happy enough with it to post it. very very cool!

You should make a movie and post it on reddit. My plan was to contact the guy with the self expanding mining grid to combine both. https://www.youtube.com/watch?v=xF--1XdcOeM

edit: reading through the description it is fascinating how similar my solution was. I also had a state machine, a stack, the temp register...
My problem was that I tried to do it with less combinators and without bots. -.-

kleopi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Apr 23, 2017 9:01 pm

Re: Nano factory with push down automata

Post by kleopi » Tue Nov 21, 2017 4:31 pm

Is there a save somewhere, or a blueprint? I'd like to learn some stuff (splitting signals, the stack system, etc).
Awesome work!
Creator of the [TKN] Mods.
Check out our Discord for further information:
http://discord.gg/G9QwJWA

Post Reply

Return to “Combinator Creations”