Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better gate creation sequence for IC assembler #115

Closed

Conversation

evg-zhabotinsky
Copy link
Contributor

Example implementation for #114
I guess it is highly suboptimal (sorts all the gates when it chooses the next one to create), but computations still take miserable amount of time. If you start too many (like thousands) assemblers simultaneously, it might lag quite a bit.

Might also have placed some code in the wrong file.

Feel free to reject it.

@Victorious3
Copy link
Owner

Sorting every time it picks a new target is indeed suboptimal. I was thinking about implementing a proper algorithm there but decided to skip it as I wanted to get a first release out at that time. In general, a spiral doesn't look all that bad, but there is the problem that turning takes longer than etching which may result in your circuits being assembled slower with more lasers for certain designs.

Calculate the path of every laser before it starts running and cache it, if you want to improve this. Have a look at this algorithm: http://en.wikipedia.org/wiki/Nearest_neighbour_algorithm

Sidenote: Bonus points for moving it to a new thread, doesn't have to cause tick lags 😉

@evg-zhabotinsky
Copy link
Contributor Author

Do you mean that the laser has limited angular speed and not something else?
I didn't really try to understand all the math involved.

As a side note, this "nearest neighbour algorithm" is more or less what I have implemented.
I just choose the "nearest" neighbour by sorting them by distance. (Yes, it is dumb)
And also looks like I got "distance" wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants