Conversation
| RotatedGadget(Square(), 3), RotatedGadget(Cane(), 0), | ||
| RotatedGadget(Cane(), 1), RotatedGadget(Cane(), 2), | ||
| RotatedGadget(Cane(), 3), RotatedGadget(ReflectedGadget(Cane(), "y"),0), | ||
| RotatedGadget(ReflectedGadget(Cane(), "y"),1), |
There was a problem hiding this comment.
we need a function to generate all non-equivalent transformations automatically.
|
Good job, @minhthin1028 , it looks like you are on the right track. So that we can merge some part of the work, it will make it easier to review too. |
| corresponding layout of new condensed graph | ||
| """ | ||
| # execute | ||
| function udg(locs::Vector{Tuple{Int, Int}}, unit::Real) |
There was a problem hiding this comment.
we have a unitdisk_graph function for this purpose. I think this is the same one?
| end | ||
|
|
||
| # move node n to a new position new_pos | ||
| function move_node(n::UNode, node_list::Vector{UNode}, candidates::Vector{Tuple{Int, Int}}) |
There was a problem hiding this comment.
It is a good first try! In my opinion, this algorithm can be implemented shorter (meaning simpler and less error prone). But this is not a serious issue. What is EXTREMELY important is
You need to write tests...
You must convince your self writing unit tests, otherwise I can not convince myself to believe any code you wrote is correct.
There was a problem hiding this comment.
Thank you for looking it over; I will write tests to make sure that the new graph is the same as original (edges, nodes, maintain udg requirement), and I will clean up the code too
There was a problem hiding this comment.
Good, but “ the new graph is the same as original” is a system test, I think unit test is more important, https://en.m.wikipedia.org/wiki/Unit_testing
Co-authored-by: Leo <cacate0129@gmail.com>
Co-authored-by: Leo <cacate0129@gmail.com>
Co-authored-by: Leo <cacate0129@gmail.com>
Co-authored-by: Leo <cacate0129@gmail.com>
|
We have #23 now. |
No description provided.