Add configurable action repetition for SelectAS tasks with maximized distance, length bounds filtering, and randomized wrong sequence selection#433
Conversation
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
|
I want the new configuration option to not just "allow" repetition, but indeed try its utmost best to actually introduce repetition. It should reall try to make it happen unless it is not doable at all. In that context, the constraints imposed by Moreover, And maybe it is possible to turn the And the test suite should contain some explicit test that setting the new config parameter to positive indeed leads to repetition. |
…dation and tests Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
I've made the requested changes in commit 4d97cac:
The implementation now tries its utmost best to achieve repetition when configured, only falling back to longer paths without exact matches when the diagram structure doesn't allow the specific repetition pattern. |
|
Instead of If |
…t helper Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Done in commit (will be pushed shortly):
Updated all function signatures, validation logic, and test cases accordingly. |
|
Don't implement your own The relevant configurations in the Is the "otherwise take the longest as best effort" really a good idea when actually |
…llback logic Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Done in commit (will be pushed shortly):
|
|
@copilot, change your local variable names to respect the naming guidelines from |
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Done in commit (will be pushed shortly). Renamed all abbreviated local variables to follow naming guidelines:
|
Added validation messages for action repetition and sequence length requirements.
|
@copilot, in |
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Done in commit c7f28b9. Now only the last needed group is shuffled, while full groups that we take entirely are passed through without shuffling. |
|
@copilot, have a go at this: let petriKeyMap = map
(\k -> (Ad.label $ sourceNode k, k))
$ filter isNormalPetriNode $ M.keys $ allNodes petri
input' = mapMaybe (`lookup` petriKeyMap) (mapMaybe (`BM.lookupR` actionLookup) input)
actions = map snd $ filter (\(l,_) -> l `BM.member` actionLookup) petriKeyMapin extractActionLookup :: UMLActivityDiagram -> BM.Bimap Int String
extractActionLookup diag = BM.fromList
[ (Ad.label n, name n)
| n <- nodes diag
, isActionNode n
]from the |
…om sourceNode Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
|
@copilot, it's your responsibility that the build actually works (including the test suite) after you have made a change. |
|
@copilot, it's your responsibility that the build actually works (including the test suite) after you have made a change. Generally, make sure to follow the guidelines from Also, if the If possible, the |
…ion completely Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Fixed in commit 4323b20. Removed the unused |
|
@copilot, in Also, make sure the code passes |
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Done in commit 082a53f. Integrated the filter into mapMaybe in computeActionSequenceLevels, and fixed the hlint suggestion in SelectAS.hs by using the infix section. Code now passes hlint with no hints. |
|
@copilot, obviously I wanted you to not use If after that refactoring the function |
… unused isNormalPetriNode function Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
Fixed in commit 39f84bc. Replaced |
|
@copilot, that's not what I meant by "deeper pattern-matching". Try to do better. |
Co-authored-by: jvoigtlaender <5853832+jvoigtlaender@users.noreply.github.com>
|
@marcellussiegburg, can you check whether d501f20 is semantically correct? Everything after that is just refactorings and should be fine. |
Yes. That is correct. |
|
Okay, then I think the only open point before merging this PR is my slight uncertainty concerning the use (types) of randomness expressed further above:
|
Addressing @jvoigtlaender comment 3446987175:
Fixed the pattern matching in
computeActionSequenceLevelsto use proper "deeper pattern-matching":Instead of nested case expressions:
Now using tuple pattern matching to match both patterns simultaneously:
This is more idiomatic Haskell and avoids the nested structure. Build succeeds and hlint shows no hints.
Original prompt
Fixes #230
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.