Page 1 of 1

Per cable signal

Posted: Fri May 13, 2016 5:11 pm
by y.petremann
The idea is simple, if you have more than one type of cable for input or output for any combinator, you should have the ability to select to which cable it should go, for that I propose that on the signal selection gui, you would have a list of each cables (all, red and blue) and have the ability to select the coresponding cable type. This would permit to do complex systems with the each signal (we can do addition and subtraction easily but not multiplycation and division):

Sending a signal when over a specified step :

Code: Select all

R = Circuit(red)
G = Circuit(green)
O = Circuit(green)

StorageTank(heavy_oil = 1250) => G
StorageTank(light_oil = 1250) => G
StorageTank(petroleum_gas = 1250) => G

Constant(1000 heavy_oil on all, 1500 light_oil on red, 2000 petroleum_gas on red) => R

R;G => Decider(each on green > each on red;each as binary on all) => O

O => Lamp (heavy_oil > 0)
O => Lamp (light_oil > 0)
O => Lamp (petroleum_gas > 0)
As of 0.12.33

Code: Select all

R = Circuit(red)
O = Circuit(red)

StorageTank(heavy_oil = 1250) => O
StorageTank(light_oil = 1250) => O
StorageTank(petroleum_gas = 1250) => O

Constant(1000 heavy_oil, 1500 light_oil, 2000 petroleum_gas) => R

R => Arithmetic(each on all * -1; each on all) => O

O => Lamp (heavy_oil > 0)
O => Lamp (light_oil > 0)
O => Lamp (petroleum_gas > 0)
Linked suggestions :

Re: Per cable signal

Posted: Fri May 13, 2016 6:14 pm
by terror_gnom
Yeah, I had the same suggestion, but no reply :(

Re: Per cable signal

Posted: Fri May 13, 2016 10:28 pm
by ssilk
Can you explain me the difference between

switching a signal to two wires

vs.

switching two signals to one wire

?

Example: Instead of output a signal S either to red or green wire depending on some sort of condition, you can also output a signal S1 or S2 only on a red wire, depending on the same condition.

I mean: There is no technical difference. :) Or do you mean something different?

Re: Per cable signal

Posted: Fri May 13, 2016 10:55 pm
by terror_gnom
It will become very messy if you try to compare all signals in game (like I want for my logistic train network).

There is no (easy) possibility to do "each (green) < each (red) output each" (to find the biggest amount for each item)



I even posted some solution (I probably shouldn´t have posted it, (not to mention coded) with that many beer intus :P ) viewtopic.php?p=156666#p156666

It´s the same like viewtopic.php?p=152756#p152756, so please join them together ;)

Re: Per cable signal

Posted: Sat May 14, 2016 7:00 am
by ssilk
After reading a bit in the linked posts I think there could be reasons for that. But no good reasons. :)
- There will be always a workaround without this feature.
- It's difficult to understand by looking at it. It makes a complex thing even more complex.

Instead I would favor to go into the direction of "specialized combinator types". I think that is more useful, cause it makes the cable clutter much more readable: Others could understand what's going on by looking at the combinator types on a pic.

That is not simply possible with my suggestion. I know, that is also not perfect, but if I need to objectively decide between these two options I would say mine is the better (already explained the reasons). :)

Re: Per cable signal

Posted: Sat May 14, 2016 11:03 am
by y.petremann
ssilk wrote:After reading a bit in the linked posts I think there could be reasons for that. But no good reasons. :)
- There will be always a workaround without this feature.
- It's difficult to understand by looking at it. It makes a complex thing even more complex.

Instead I would favor to go into the direction of "specialized combinator types". I think that is more useful, cause it makes the cable clutter much more readable: Others could understand what's going on by looking at the combinator types on a pic.

That is not simply possible with my suggestion. I know, that is also not perfect, but if I need to objectively decide between these two options I would say mine is the better (already explained the reasons). :)
For my part I managed to make most of my circuits using "each", and one problem thing I can't figure to make is grouped timers (multiples timers on the same combinators with custom on_delay and repeat delay for each) grouped rs latchs (which need to have a diferentiation of each entry)

Also an important part is that for me selecting a signal with cable would give all, red or green option (maybe more if they add cables like blue, for example ...)

Re: Per cable signal

Posted: Sat May 14, 2016 1:42 pm
by ssilk
I think, using "each" as default for the combinators is eventually a good strategy. But how about changing that strategy, if needed/useful?

What hinders you to do so? :)

Re: Per cable signal

Posted: Sat May 14, 2016 4:23 pm
by ratchetfreak
terror_gnom wrote:It will become very messy if you try to compare all signals in game (like I want for my logistic train network).

There is no (easy) possibility to do "each (green) < each (red) output each" (to find the biggest amount for each item)



I even posted some solution (I probably shouldn´t have posted it, (not to mention coded) with that many beer intus :P ) viewtopic.php?p=156666#p156666

It´s the same like viewtopic.php?p=152756#p152756, so please join them together ;)
Currently there is only a single thing you can do which is add the 2 wires together.

With that you can do each(green) + -1*each(red) < 0 output each

Re: Per cable signal

Posted: Sat May 14, 2016 7:44 pm
by y.petremann
ratchetfreak wrote:
terror_gnom wrote:It will become very messy if you try to compare all signals in game (like I want for my logistic train network).

There is no (easy) possibility to do "each (green) < each (red) output each" (to find the biggest amount for each item)



I even posted some solution (I probably shouldn´t have posted it, (not to mention coded) with that many beer intus :P ) viewtopic.php?p=156666#p156666

It´s the same like viewtopic.php?p=152756#p152756, so please join them together ;)
Currently there is only a single thing you can do which is add the 2 wires together.

With that you can do each(green) + -1*each(red) < 0 output each
If fact no this is not the only thing ...
you can create almost every logic gates, and I'm sure because you can do it using only nand or nor based circuits, but this need 4 combinators per nand or nor gate.

Re: Per cable signal

Posted: Mon May 16, 2016 11:41 am
by ratchetfreak
y.petremann wrote:
ratchetfreak wrote:
Currently there is only a single thing you can do which is add the 2 wires together.

With that you can do each(green) + -1*each(red) < 0 output each
If fact no this is not the only thing ...
you can create almost every logic gates, and I'm sure because you can do it using only nand or nor based circuits, but this need 4 combinators per nand or nor gate.
To clarify the only SIMD operation that takes 2 wire inputs that is possible is adding the signals together.

Re: Per cable signal

Posted: Mon May 16, 2016 12:07 pm
by ssilk
Some input: the circuit network is an implementation of tuples.
See mathematical definitions of tuples: https://en.wikipedia.org/wiki/Tuple

The only useful behavior off tuples per se is "join" and in case of scalar they can also be summed. Which is as it is. This is for example, why databases work, as they work (where tuples are used as "relation").

...

There are other useful operations for two separated tuples (two wires): http://www.tutorialspoint.com/python/python_tuples.htm (at the end)
That might have sense. But that are operations. Not behavior!