Need to draw finite state machines (Again)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Need to draw finite state machines (Again)

Ralph Boland

Thanks for the responses for my posting on my need to draw finite state
machines.   For example:

> > I am writing an open source project in Squeak for constructing
> > finite state machines from regular expressions.  It contains
> > a large number of algorithms (I am comparing them to determine
> > the best ones).  To help me debug the FSM minimization algorithms
> > and for other reasons I want a package that can draw a finite state
> > machine
> > given the FSM as input.

> Just use the Graphviz package, available on SM. We use it in Gjallar btw
> and let it produce gifs (but it can produce lots of formats, including
>  svg),
etc.

They have made clear that I have not explained my needs very well so
allow me to expand further:

I need smalltalk (Squeak) code that when given a directed labeled graph  (i.e. a
finite state machine)  draws the graph nicely on a window pane within a
running smalltalk image (containing also my application).
In addition, this window pane will have a text area where the user may
put text and then place the cursor anywhere within said text. 

For text   "abc.def",  where the "." indicates the location of the cursor,
my application will instruct the graph drawing package to add attributes
(attributes may be things like color, line thickness, bold text)
to  the state that the FSM is in after reading input  "abc" to indicate
the current state of the FSM. 
If the user moves the cursor (say to the right) my application will send
instructions to the graph drawing package to  remove
the attributes of the previously current state ( " abc.def") and add
attributes to the state the FSM is in for text  "abcd.ef"    

NOTES:
  1) Adding or removing of attributes should not cause the drawing of the
      FSM to change except where the attributes have been added or removed.
  2)  Attributes may be added or removed from the vertices, edges, and
       labels of the graph.
  3) If the FSM is non-deterministic, then there may be many states
      which are attributed concurrently.
  4)  In some cases the vertices may also have labels; in such cases I expect
       a state to be drawn as a label inside a circle, rectangle, or other shape.

There are more things I could describe but you get the picture.

Now, is there a graph drawing package that I can load into my Squeak
image that does (at least some of) what I want and that I can write
an interface to?   Note that, if possible, I need the graph drawing package
to be fast because the user may move the cursor the the left or right
very quickly and I don't want the response time to be slow.

Note that mostly I don't want to be responsible for deciding how the graph
is drawn on the page, i.e. the location of vertices, edges and labels.
The package should have the ability to decide that for itself and do a good
job of it too.

Thanks again

Ralph

P.S.  As I said before,  if there is anyone who would like to implement this
part of my Regular Expression package that would be great. 
I have a text based version of the needed graph drawing package working
already and it works great!  VERY COOL, even if I must toot my own horn.




Reply | Threaded
Open this post in threaded view
|

Re: Need to draw finite state machines (Again)

Göran Krampe
Hi!

> Thanks for the responses for my posting on my need to draw finite state
> machines.   For example:
>
>> > I am writing an open source project in Squeak for constructing
>> > finite state machines from regular expressions.  It contains
>> > a large number of algorithms (I am comparing them to determine
>> > the best ones).  To help me debug the FSM minimization algorithms
>> > and for other reasons I want a package that can draw a finite state
>> > machine
>> > given the FSM as input.
>
>> Just use the Graphviz package, available on SM. We use it in Gjallar btw
>> and let it produce gifs (but it can produce lots of formats, including
>>  svg),
> etc.
>
> They have made clear that I have not explained my needs very well so
> allow me to expand further:
>
> I need smalltalk (Squeak) code that when given a directed labeled graph  (
> i.e. a
> finite state machine)  draws the graph nicely on a window pane within a
> running smalltalk image (containing also my application).
[SNIP]

Ok, then I recommend Connectors by Ned Konz - which perhaps someone
already did. I am unsure about its auto layout capabilities (anyone?) but
IIRC it can actually use Graphviz for that (calling graphvis and reading
back coordinates).

And Connectors is very capable in all other areas.

regards, Göran