Combinators and the Circuit and Logistic Networks

Combinators and the Circuit and Logistic Networks

The Logistics Network:


Combinators and the Circuit and Logistic Networks image 1

Combinators and the Circuit and Logistic Networks image 2

How the logistics network is definedThe logistics network is a 50x50 area around a roboport where logistics and construction robots can interact with chests (construction robots operate out to 100x100, but if you want them to pick up or drop off items from chests the chests have to be in the 50x50 area). All logistics (passive/active provider, requester and storage) chests and smart inserters in the area are automatically linked into the network and they can give or recieve signals to and from the network. It essentially acts an internet, but the data being amount of items in the network. By placing another roboport so that the logistics network areas overlap or touch the ports will link and share the same network.

3 Roboports connected to form a relatively large logistics Network

Moving items in the NetworkItems are moved around in the network by logistics robots, being collected from provider and storage chests and being carried to storage chests (from active provider chests) and requester chests (both types of requester chests and storage chests). Bots do have a limited capacity, but research can increase this. Since smart inserters do link to the network they can also be used to carry out controlled movement of items where bots may not be appropriate

I'm going to rip up my iron and copper conveyors, these bots are that good!NO! Bots are good for short distance medium through put or medium distance low throughput. A good example is advanced circuits, where you need at most 200 on you at a time, or moving processing units and modules around, such as crafting T2 and T3 modules. Think small and compact. That is where the logistics system is best, where running a conveyor line would give you a headache. 1000's of bots each shifting 1 iron plate will kill your power gen, whilst taking a lot longer to do anything (an express tranport belt is a lot faster and smart inserters cost a fraction of the energy demand).

A good use of the logistics system

The Circuit Network

Want to exercise extreme control over your factory? Want to have 500 of X on hand unless you have less than 200 of ingrediant Y available? Or maybe you just want to make a Rube Golberg device that eventually makes some lamps do a scrolling smiley face ( :) )? Then combinators and the circuit network allows you do all of these things with a bit of work and (some to extreme) knowledge of the circuit system.

What is the Circuit NetworkThe Circuit network is a basic version of the logistic network, as in no robots to handle inventories (inserters only, I'm afraid) and items have to be connected individually, unlike the logistics network where they are automatically connected. However the circuit network has it's advantages being: it is completely separate from the logistics system, there can be two separate circuit networks operating in the same space at the same time, and it is considerably cheaper.

Connecting Objects to the networksTo connect an object to the circuit network use either green or red wire. These wires are completely separate, like conveyors, signals never cross. So signals on the red cricuit are separate from those on the green, which is useful in compact situations. To actually connect items click on a nearby electric pole (the object has to be in the electric supply area discussed above for this to work) and then click on the object, you can also directly connect machines, though this can lead to parts of a network not acutally be connected. Connecting electric poles with wire will allow your circuit network to reach over a larger area and transmit it's signals. Currently the logistics system can connect only to smart and logistics chests, smart inserters and a few other items. Chests need no special interaction after being connected, they just transmit their contents to the full network, however smart inserters need to be told what conditions to operate under. All items can be connected to both colour circuits at the same time, for circumstances where that is wanted.

List of objects that can be connected to the circuit network:Smart and logistics chests

Smart inserters

Combinators

Lamps

Fluid Storage Tanks

Electric Pumps

Pretty much everything

Conditons:


Combinators and the Circuit and Logistic Networks image 20

These are what tell a machine when to operate and are based around IF. The three conditons for the IF logic in the game are: <,=,> (less than, equal to, greater than). So for a smart inserter with the condition of (batteries<500) it would only operate when the number of batteries in the circuit network is less than 500. Not equal to, not more. This can be useful for maintaining a chest far away from the production site without having hundreds of items on your belts (a massive waste of resources).

Conditions can also be set for lamps and electric pumps, telling them when to switch on, allowing for warning lights or extreme control over fluids, not just items.

An example in a combinator

Combinators:


Combinators and the Circuit and Logistic Networks image 25

Combinators can be used to set up logic gates that can help your factory decide what to do in certain circumstances. Or create a neon sign. But clever use of the combinators can allow you to program, in a rudimentary sense.

Two decider combinators

Also arithmatic and decider combinators take up two tiles for a reason. These two tiles are separate, one is the input, the other the output and signals only signals set as an output are passed from the input to the output. The sloped side is the input and the connectors on a metal bar are the output.

The three types of combinators: Decider

Arithmatic

Constant

Constant combinatorsConstant combinators output a constant signal, which is completely separate from an inventory, as such they can output "unreal" signals (signals that aren't tied to an item, such as red or 'signal 1', these are basically signals that can't be interferred with by accidently tying a chest into the network). Think of them as defining a variable in a program with a value. Or in Python:

Signal 1 = 23

Decider combinatorsThese are the IF logic in factorio. If variable X </=/> variable Y, output variable Z. X,Y and Z can be real or 'unreal' signals and don't have to be for the same item/ number/ colour. It's based on the numerical value carried by the signal. Or in Python:X=15 Y=17 If X == Y: Z = 23 Else: Z = 0

This would output 0. In Factorio the decider combinator always outputs 0 if it's condition is false and a signal carrying a 0 is not shown when an object carrying the signal is highlighted.

Arithmatic combinatorThis carries out basic maths operations: +, -, x, /. Pretty self explanatory however once again in python:X=40 Y=2 print (X+Y) print (X-Y) print (X*Y) print (X/Y) This would ouptut: 42 ,38,80 and 20. Again, simple.

A simple setup limiting the number of processing units and advanced circuits. As long as the number of processors - 20 < than thenumber of advanced circuits, the smart inserter pulls them out of the chest.

Logic Gates:


Combinators and the Circuit and Logistic Networks image 39

Disclaimer: I am NOT a programming expert! I have a slight familliarity with Python and Lua (Minecraft's Computercraft only) but that's as far as it goes. Help and refinement would be great.

IF logic gates are in the game in the form of decider combinators, which is nice as it saves a whole lot of headache. As for NOT, AND, OR and all the more complex gates, your on your own. Half the setups I'm going to discuss I have only thought of in my head, and will probably need to be tweaked if to they are to be used. (Read the disclaimer above).

Here's how this is going to work: all CAPITAL letters are going to be my variables. At any point when I refer to these, these are my variables. Signal 1 = A and so on. I recommend using 'unreal' signals as these variables and having them carry 1's and 0's as TRUE and FALSE respectively.

For a step by step guide: signal 1(1) means a 1 being broadcast on "signal 1"

NOT GateIn programming NOT takes a input of TRUE or FAlSE and provides the opposite (TRUE becomes FALSE and vice versa).

How to create one:Decider combinator takes whatever signal comes in from your factory and converts it into signal 1 (1 or 0) depending on the conditions set.

Another decider combinator set so that if signal 1 = 0 then signal 1 = 1.

X = 533 if X > 500: A = True else: A = False if A == True: A = False Else: A = True If the input condition is above a set value then the output is false or 0, otherwise it is true or 1.

InputOutput0110

AND GateIn programming AND takes two inputs and only outputs a TRUE output if both inputs are TRUE.

How to create one: Same as above however one decider combinator for each input converting it into signal 1(1). Use conditions appropiate to what you want.

Since each signal 1 is added when both conditions are true your output network should read signal 1(2). You can keep your networks separate by not joing electric poles.

Use a decider combinator set so that if signal 1 = 2 then signal 2 = 1.

X = 533 Y = 676 if X > 500: A = 1 else: A = 0 if Y > 500: A = 1 else: A = 0 (Factorio signal logic will combine those two A variables. Not exactly correct but hey it simplifies it. So by now A = 2) if A = 2: B = TRUE else: B = FALSE If both input conditions are true (greater than 500) then B (signal 2) = TRUE (1).

AND gate

Input 1Input 2Output000100010111

OR gatesIn programming OR is used to mean that as long as 1 input is TRUE then the output is TRUE. All the others can be false, just as long as that one input is TRUE.

Follow the same steps as above however for the second combinator have it be set to > 0. That way it will only be active for numbers greater than 0, but not 0 itself, the idea behind OR.

if A >= 1: B = TRUE else: B = False The last part of the AND rewritten to serve as an OR

OR gate

Input 1Input 2Output000101011111

An OR gate. The smart inserter in the very top left (just visible) is set up like the final decider combinator, due to the fact that they use the same condition system.

More advanced GatesI'm not going to write out how to do a NAND or a NOR, as the output of a AND or a OR can be put into a NOT to produce NAND or NOR respectively. I'm going to do one more gate and then the more advanced gates can be built by you from the basic gates

XORExclusive OR. In programming this outputs TRUE if one and only one input is TRUE.

How to create one(assuming 2 inputs):Create a OR gate for your two inputs, as discribed above with signal 2 as the output.

Create a NAND gate using the same two inputs, as discribed above with signal 2 as the output.

Now connect a decider combinator up to the outputs of your OR and NAND. Set it so that if signal 2 = 2 signal 4 = 1.

OR gate

Input 1Input 2Output000101011111

NAND Gate

Input 1Input 2Output001101011110

Total

Input 1Input 2ORNANDSignal 2Output000110101121011121111010

X = 533 Y = 673 if X > 500: A = 1 Else: A = 0 if Y > 500: A = 1 Else: A = 0 #(Same as before I know real life doesn't work like this!) if A == 2: B = 0 Else: B = 1 if A >=1: B = 1 else: B = 0 #(Again factorio will add the B varible) If B == 2: C = 1 Else: C = 0

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=643629703					

More Factorio guilds