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
SDL 0210 - Mobile Manager Dynamic Menu Cell Updating #637
Comments
Though I like optimizations I'm afraid reordering will not work as proposed. the concern is specific to your example 4 applying your algorithm to it:
I do understand the benefits for simple additions or removals at the end of the list but I don't think the algorithm is accurate. Could you please provide more details to the algorithm? I believe the algorithm is far more complicated as you might expect and without understanding the details we will be trapped when realizing this proposal. |
Hey Kujtim, between the lists ABCD and BADC, A and D are in the same order. So if deleteCommands are sent for B and C, the new menu will be AD. When an AddCommand for B is sent with position 0 and an AddCommand for C is sent with position 3, the menu list will become BADC. Does that follow? The commands don't have to be next to each other in order for them to be marked as remaining. So when looping through the list. A is the first item in list 1. When it is found in list 2, it is unmarked. B is then checked. It is found in list 2, but before A, therefore it remains marked for deletion and addition. Now, this algorithm performs poorly if, for example, we change the list from ABCD to BCDA. Ideally, you would only have to delete and add one item. However, because of how the algorithm works, you have to change 3 items. Any suggestions on improvement on this point are welcome. |
As a human I already understand your approach. What I'm saying is that the algorithm steps are very unclear and vague but your comment helped. So for ABCD -> BADC A and C remain while B and D are deleted (as you wrote in your proposal doc). Also the algorithm has to be recursive for sub menus? Regarding the algorithm I believe you want to reach O(nlogn) but your comment would be O(n^2). While iterating the old list the algorithm should remember the item and index in the new list so that the algorithm could skip items in the new list for the next iteration.
and so on. Above steps would provide O(nlogn) as you skip items you already checked and also mark items to be added with the known position. Regarding the poor performance to change ABCD to BCDA. Any change of multiple Commands (especially with voice recognition) can be a nightmare. Delete commands are no issues but adding them requires computational time for voice grammars. It's even worse if sub menus. Imagine B, C and D to be sub menus with >1 sub command... This worse case can be improved by running the algorithm multiple times and add scores to each run. Every run is with a subset of the old list. Here's an example (no submenus):
Run#2 would win with only 1 addition. For commands the score is 1. For submenus the score is You might think that's more complicated than needed but you need to consider the time needed to compute the voice grammars. Every intelligent algorithm to reduce number of RPCs is beneficial when voice is related. |
The Steering Committee voted to defer this proposal on 2018-12-11 to allow the author time to respond to this comment. |
I apologize, if I misrepresented the algorithm here by saying that B is found in list 2; I meant that it exists in list 2 before A, not that that algorithm finds it before A. That was confusing. If A is found in slot 2 according to my above comments (of BADC), then B would begin searching in slot 3 through to the end, and would not find it. Hence the I'm going to keep thinking on this. |
The increased complexity by running the algorithm multiple times is true. However computational time is still very very low (I assume < 1ms for 100 items worse case but should be confirmed). Compare that with an Every intelligent idea to reduce the number of RPCs is worth being considered. |
Some point of clarification before the meeting:
If we had A,B,C,D,E -> C,B,D,A,E then C,D,E would stay, while we would add B at position 1 and A at position 3 (0 based). If A(3) got added before B(1), then there would be a problem and the resulting menu would be C,B,D,E,A, which is incorrect. |
The Steering Committee voted to accept this proposal with revisions on 2018-12-19. The author is to updated the proposal to include the two points called out in this comment. |
Hello SDL community,
The review of "SDL 0210 - Mobile Manager Dynamic Menu Cell Updating" begins now and runs through December 11, 2018. The proposal is available here:
https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0210-mobile-dynamic-menu-cell-updating.md
Reviews are an important part of the SDL evolution process. All reviews should be sent to the associated Github issue at:
#637
What goes into a review?
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of SDL. When writing your review, here are some questions you might want to answer in your review:
Please state explicitly whether you believe that the proposal should be accepted into SDL.
More information about the SDL evolution process is available at
https://github.com/smartdevicelink/sdl_evolution/blob/master/process.md
Thank you,
Jordyn Mackool
Program Manager - Livio
jordyn@livio.io
The text was updated successfully, but these errors were encountered: