Skip to content
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

Edges in visualizer shared between states. #14

Closed
allensanborn opened this issue Jun 11, 2014 · 6 comments
Closed

Edges in visualizer shared between states. #14

allensanborn opened this issue Jun 11, 2014 · 6 comments

Comments

@allensanborn
Copy link

I'm working on creating a state machine with Automatonymous and I'm running into an issues with the visualizer. I'd like to run the graph by the client but the graph doesn't really make any sense since the Events/transitions are being shared between states in the graph.

For example, State 1 and state 2 transition to state 3 but they both use the same event which then appears as its own node on the graph. Not to0 big of an issue with 3 states and 1 transition since it only results in 4 vertexes and 3 edges but I have ~30 states and 8 events and the graph then has 130 edges in the edge collection and turns it into a soup of lines that aren't very useful since you can't tell the state->event->state relationships. I'd like to conceptually make each transition appear to be unique in the graph. This would essentially just make the event a 'label' and not a full blown state with no outline in the graph.

I'm looking at modifying the graphing code to make the edges unique but I just wanted to make sure that I'm not totally off-base in regards to this being a problem. It seems like the graphing would break down on any moderately large state machine and that I may not have been the first person to run into this.

Any suggestions?
state

@allensanborn
Copy link
Author

The best example of the problem is in the bottom right where there are many ways to submit the item to the customer for review. There are lots of in out edges and there is no way to tell what's tied to what. Which state and transition will lead to state 'State_CustomerReview_None'?

@allensanborn
Copy link
Author

What I would like it to look like is this minus the ids I added to the events to make them unique. btw i just generated the code with a spreadsheet since this is still all in flux
state

@phatboyg
Copy link
Member

I've noticed some strange issues for sure, particularly in how multiple edges are created between nodes. I'll take a look at your better graph and see what I can do with the next update.

@allensanborn
Copy link
Author

Thanks. I started looking through the graph visualizer and quickgraph/graphviz but it was a lot to take in. Hopefully once I get the code working I'll be able to circle back around and give you some more info... stupid deadlines.

@allensanborn
Copy link
Author

http://www.graphviz.org/content/fsm

Here's what I was looking for from the visualizer. The events should all be added as labels instead of states.

http://www.graphviz.org/Gallery/directed/fsm.gv.txt
digraph finite_state_machine {
rankdir=LR;
size="8,5"
node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
node [shape = circle];
LR_0 -> LR_2 [ label = "SS(B)" ];
LR_0 -> LR_1 [ label = "SS(S)" ];
LR_1 -> LR_3 [ label = "S($end)" ];
LR_2 -> LR_6 [ label = "SS(b)" ];
LR_2 -> LR_5 [ label = "SS(a)" ];
LR_2 -> LR_4 [ label = "S(A)" ];
LR_5 -> LR_7 [ label = "S(b)" ];
LR_5 -> LR_5 [ label = "S(a)" ];
LR_6 -> LR_6 [ label = "S(b)" ];
LR_6 -> LR_5 [ label = "S(a)" ];
LR_7 -> LR_8 [ label = "S(b)" ];
LR_7 -> LR_5 [ label = "S(a)" ];
LR_8 -> LR_6 [ label = "S(b)" ];
LR_8 -> LR_5 [ label = "S(a)" ];
}

@phatboyg
Copy link
Member

I just fixed this in the mt3 branch, which is going to released as yet another prerelease version shortly (3.0.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants