-
Notifications
You must be signed in to change notification settings - Fork 8
[NMF] Correctness of the solution #16
Comments
Now I've tried the RouteSensor query, and there NMF doesn't find any match in the models 1, 2, 4, and 8. Eventually, in the 16 model, it finds twelve matches. The correct numbers would be 7, 8, 15, 28, 58. The PosLength, SwitchSet, and SwitchSensor queries seem to be correct. At least the number of matches are the same as with the reference java solution, and always 10 are fixed when using the fixed changeset. |
Hi Tassilo, you are right. There is a small bug in the pattern that of course affects both the incremental and the batch version as both of them use the same pattern: I must have overread the clause that route1 != route2. Now, it does not find any match, anymore :) The reason for this, as well as for the RouteSensor pattern is that both patterns use the rc.Routes property. Thus, they only consider routes that are contained directly in the railway container. I exchanged rc.Routes with rc.Descendants.OfType and get the expected results. However, Descendents() is a very expensive operation in NMF, so this degrades the performance a bit. I will update the repository and the SHARE demo. Maybe I find a better solution than querying Descendents(). Georg |
The fact that route1 == route2 was allowed in the SemaphoreNeighbor query also leads to the rather strange behavior that you mentioned. The problem is that many many more than just 10 matches will be repaired if route2.Entry = route1.Exit. If route1 == route2, this yields a match for each and every track element in this route. All of them are "repaired" by setting the entry of this route to its exit. I still don't know why it was alternating, but I will investigate. The current patterns that I am using now are the following:
|
Ok, thanks. |
Hi @georghinkel,
I think the NMF solution is not correct. In the output the transformation prints the
rss
values should be the number of matches. When I run the NMF solution with the SemaphoreNeighbor query on the model of size 1, the first check finds 94 matches with both the incremental and the batch version. The correct number of matches is just 1.Same with model 2: NMF finds again 94 matches, the correct number is 5.
And with model 4: NMF initially finds 409 matches whereas the correct number is 10. And then it's getting stranger. In the first re-check, it finds only 1 match (which would mean it repaired more than the 10 matches [this is the fixed strategy]). In the second re-check, it finds again 314 matches. Well, then 1 again, then 314 again, etc.
Model 8: NMF finds 996 initial matches, the correct number is 15. And during the re-checks, the numbers are 275, 164, 4, 898, 4, 898, 4, 898, 155, 164.
Well, there seems to be something pretty wrong. It always finds way too many matches, it repairs not just 10 in the fixed strategy, and how on earth can it be that the number of matches increases again after repairing elements?
The text was updated successfully, but these errors were encountered: