Document about a limitation about transitions
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- documentation
Research direction
Read the existing documentation to find where stack automatons, transitions, and actions are explained; the issue does not name a documentation file or test. Add an explanation of the limitation and the described workaround of pushing a target state during an action. Done when the documentation covers the problem and solution clearly.
Written by the indexing model from the issue text.
Description
What is this limitation?
This limitation concerns stack automatons.
Sometimes, a random value must be processed to define the transition to take. However, transitions only accept predefined values (one value for one transition exactly) and do not allow an arbitrary set of values. This is particulary limiting when the number or nature of transitions are not known at the time the state is created.
Example: it is not possible to create a transition taken only if the value respects a certain pattern.
The good news is that there are already methods to get deal with this problem. Here is one:
How to deal with the limitation
Push onto the stack
Instead of creating the transitions at state creation time, push them on the stack when performing an action.
Example:
If the count of transitions is not known, you cannot do something like the following when creating the state:
var target1 = new State();
var target2 = new State();
...
state.SetDefault(defaultState)
state.AddTransition(new Transition<int>(1, target1));
state.AddTransition(new Transition<int>(2, target2));
...
Instead, create an action, link it to the state and push the target state when performing it:
class CustomAction: IAction {
public void Perform() {
...
var target = new State();
automaton.Push(target)
}
}
state.SetDefault(defaultState, new CustomAction())
This issue is to add this problem and some solutions to the documentation.
- Dominant language
- C#
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 1m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Natvs/Nt.Automaton
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Natvs/Nt.Automaton#33 ·
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Natvs/Nt.Automaton#17 ·
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Natvs/Nt.Automaton#27 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Natvs/Nt.Automaton#13 ·
-
Pop multiple statesOpenenhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Natvs/Nt.Automaton#11 ·
All issues in Natvs/Nt.Automaton
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
a-corriger documentation
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
christian-raj/S-Aloha#312 ·
-
ready-for-agent tech-debt
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
DigiBanks99/menlo#640 ·
Maintainers usually reply within 1 day
-
ci
Difficulty 1/5 Under an hour Newbie friendliness 62/100
OpenTabletDriver/OpenTabletDriver#5283 ·
Maintainers usually reply within 3 days
-
area / templates
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bitfoundation/bitplatform#15109 ·
Maintainers usually reply within 1 day