Page 1 of 1

Signal Sorter

Posted: Mon Jan 02, 2023 1:04 am
by mboxdk
Slow if there are many signals at the input, but it works! :D
It's thread safe and supports negative values. Some letter signals are reserved.
Also I think about much faster solutions..
While I was doing this, I forgot what for.. :D

Capture.PNG
Capture.PNG (1.57 MiB) Viewed 1905 times

Re: Signal Sorter

Posted: Wed Jan 04, 2023 12:03 am
by ickputzdirwech
Before I might think about a use case I would be interested what it actually does?

Re: Signal Sorter

Posted: Wed Jan 04, 2023 1:01 am
by mboxdk
ickputzdirwech wrote:
Wed Jan 04, 2023 12:03 am
Before I might think about a use case I would be interested what it actually does?
It separates and sorts signals

input - one signal: A20 B10 C30
output - three signals: B10, A20, C30

Re: Signal Sorter

Posted: Wed Jan 04, 2023 7:36 am
by DaleStan
I don't understand what you mean by that. Can you post screenshots of the input and output? The tooltips for the input and output power poles seem like they should work well.

Re: Signal Sorter

Posted: Wed Jan 04, 2023 1:18 pm
by mboxdk
You can see everything on the bottom power poles. I'm sorry, I thought I made the interface obvious.
Capture.PNG
Capture.PNG (1.86 MiB) Viewed 1821 times

Re: Signal Sorter

Posted: Wed Jan 04, 2023 9:37 pm
by Nidan
Power pole plus lamp screams output, but a description in plain English is always useful, so we can get a better idea what a circuit does from just reading the post and not having to try it out ingame.

As examples: Adds signal I to the output indicating that this is the Ith lowest number. Signals that must not be in the input (You wrote "Some letter signals are reserved."; at least I by the looks of it.). What happens if multiple signals have the same value? What happens if the are more than 8 inputs? How can you expand it to more than 8 outputs?

And if you want to go the extra mile, a breakdown/overview of what each section of combinators does.

Re: Signal Sorter

Posted: Wed Jan 04, 2023 11:01 pm
by mboxdk
Nidan wrote:
Wed Jan 04, 2023 9:37 pm
Power pole plus lamp screams output, but a description in plain English is always useful, so we can get a better idea what a circuit does from just reading the post and not having to try it out ingame.
I'm sorry, it's more interesting to come up with this than to describe everything in detail. :roll:

Nidan wrote:
Wed Jan 04, 2023 9:37 pm
As examples: Adds signal I to the output indicating that this is the Ith lowest number. Signals that must not be in the input (You wrote "Some letter signals are reserved."; at least I by the looks of it.). What happens if multiple signals have the same value? What happens if the are more than 8 inputs? How can you expand it to more than 8 outputs?
I is just signal index, like index in sorted array.

I forgot what signals I reserved. I need to recheck each combinator to say more.

if multiple signals have the same value they will be sorted anyway to different outputs. I can't predict in what order.

if the are more than 8 inputs the rest of the signals will be discarded.

It's quite easy to expand it, just need to copy the bottom memory section to the right side and assign indexes to these combinators:
Capture.PNG
Capture.PNG (1.5 MiB) Viewed 1788 times
I also know how to make it so that there is no need to write the index manually)
Nidan wrote:
Wed Jan 04, 2023 9:37 pm
And if you want to go the extra mile, a breakdown/overview of what each section of combinators does.
asd.PNG
asd.PNG (1.75 MiB) Viewed 1788 times
Yellow - "thread safe" input memory, that does not allow to break everything if input is updating too fast. Really useful thing in long calculations. :idea:
Red - disassembles the signal into its component parts and looks for the minimum. viewtopic.php?f=193&t=104572
Green - subtracts the found minimum signal from the input and assigns an index to it and writes it to the buffer memory. Then the cycle continues.
Blue - memory block that contains the buffer memory and output memory. When the process is completed, the result is copied from the buffer to the output memory.