From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Re: From state table to state diagram Date: Sat, 25 Sep 2010 09:40:47 +0200 Message-ID: References: <4af92c2e-de26-4149-bd68-06fd6a0503f0@email.android.com> <878w3vedfz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1706071687==" Return-path: Received: from [140.186.70.92] (port=34889 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzPNK-0006Z0-2S for emacs-orgmode@gnu.org; Sat, 25 Sep 2010 03:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzPNI-0002pG-J5 for emacs-orgmode@gnu.org; Sat, 25 Sep 2010 03:40:49 -0400 Received: from mail-qy0-f176.google.com ([209.85.216.176]:40500) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzPNI-0002p8-Dx for emacs-orgmode@gnu.org; Sat, 25 Sep 2010 03:40:48 -0400 Received: by qyk8 with SMTP id 8so3813813qyk.0 for ; Sat, 25 Sep 2010 00:40:48 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1706071687== Content-Type: multipart/alternative; boundary=00163649a6f51155790491109ddb --00163649a6f51155790491109ddb Content-Type: text/plain; charset=ISO-8859-1 Hi I really like the idea of this conversion from a State Transition Table to a State Transition Diagram as it is much easier to make a table then a graph. Unfortunately I don't know enough of python to help here. Could you please publish your solution here (and on worg) as it would be a very useful addition to org. Cheers, Rainer On Thu, Sep 23, 2010 at 5:02 PM, Gary wrote: > Sorry, I've been rather lax on this :( I got dragged onto other stuff, > went on training courses, and all sorts of other things. > > Eric Schulte wrote: > > Babel does support generating diagrams with graphviz via "dot" code > > blocks. Babel is also capable of converting Org-mode tables to list > > objects in a number of languages, so I'd recommend writing a table->dot > > script in your favorite language, and then using babel to handle the > > coordination and Org-mode integration. > > That's all very easy for you to say :)) > > > I'm happy to help in this regard, the first step would be something like > > the following example which assumes python is your preferred scripting > > language (as you can see I have no idea what your state table may look > > like)... > > Well, wikipedia suggests the following[1] (and goes into further detail > as well[2]) > | Current State -> | State | State | State | > | Input v | A | B | C | > |------------------+-------+-------+-------| > | x | B | ... | ... | > | y | ... | C | ... | > which basically says that when the machine is in State A and receives > 'x' then it transitions to State B, and when it receives a 'y' in State > B it transitions to State C. > > > #+results: state-table > > | 1 | 2 | > > | 3 | 4 | > > > > #+source: table-to-dot > > #+begin_src python :var table=state-table > > python code here > > Okay. What should this python code here do? :) I know, it converts a > table to dot-script, but are there any examples I could look at which > take a table as input and output something (anything), just so I can see > how the python code should expect its input? > > > #+end_src > > > > #+begin_src dot :var text=table-to-dot(table=state-table) > > graph{ > > $text > > } > > #+end_src > > > > Once this is working I think it could make a great addition to the > > library of babel [1] (a collection of generally useful code blocks). > > Sure :) > > [1] > http://en.wikipedia.org/wiki/Finite-state_machine#Concepts_and_vocabulary > [2] http://en.wikipedia.org/wiki/State_transition_table > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com --00163649a6f51155790491109ddb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi

I really like the idea of this conversion from = a State Transition Table to a State Transition Diagram as it is much easier= to make a table then a graph. Unfortunately I don't know enough of pyt= hon to help here.=A0
Could you please publish your solution here (and on worg) as=A0it would be = a very useful addition to org.

Cheers,

Rainer


On Thu, Sep 23,= 2010 at 5:02 PM, Gary <emacs-orgmode@garydjones.name> wrote:
Sorry, I've been rather lax on this :( = I got dragged onto other stuff,
went on training courses, and all sorts of other things.

Eric Schulte wrote:
> Babel does support generating diagrams with graphviz via "dot&quo= t; code
> blocks. =A0Babel is also capable of converting Org-mode tables to list=
> objects in a number of languages, so I'd recommend writing a table= ->dot
> script in your favorite language, and then using babel to handle the > coordination and Org-mode integration.

That's all very easy for you to say :))

> I'm happy to help in this regard, the first step would be somethin= g like
> the following example which assumes python is your preferred scripting=
> language (as you can see I have no idea what your state table may look=
> like)...

Well, wikipedia suggests the following[1] (and goes into further deta= il
as well[2])
=A0 =A0| Current State -> | State | State | State |
=A0 =A0| Input =A0 v =A0 =A0 =A0 =A0| =A0 A =A0 | =A0 B =A0 | =A0 C =A0 |<= br> =A0 =A0|------------------+-------+-------+-------|
=A0 =A0| x =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 B =A0 | ... =A0 | ... =A0 = |
=A0 =A0| y =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| ... =A0 | =A0 C =A0 | ... =A0 = |
which basically says that when the machine is in State A and receives
'x' then it transitions to State B, and when it receives a 'y&#= 39; in State
B it transitions to State C.

> #+results: state-table
> | 1 | 2 |
> | 3 | 4 |
>
> #+source: table-to-dot
> #+begin_src python :var table=3Dstate-table
> =A0 python code here

Okay. What should this python code here do? :) I know, it converts a<= br> table to dot-script, but are there any examples I could look at which
take a table as input and output something (anything), just so I can see how the python code should expect its input?

> #+end_src
>
> #+begin_src dot :var text=3Dtable-to-dot(table=3Dstate-table)
> =A0 graph{
> =A0 =A0 $text
> =A0 }
> #+end_src
>
> Once this is working I think it could make a g= reat addition to the
> library of babel [1] (a collection of generally useful code blocks).
Sure :)

[1] http://en.wikipedia.org/wiki/Finite-state_= machine#Concepts_and_vocabulary
[2] http://en.wikipedia.org/wiki/State_transition_table


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



--
NEW GERMAN = FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (= Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellen= ce for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch UniversityMain Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:= =A0 =A0 =A0 =A0 =A0=A0 +27 - (0)83 9479 042
Fax:=A0 =A0 =A0 =A0 =A0 =A0 = +27 - (0)86 516 2782
Fax:=A0 =A0 =A0 =A0 =A0 =A0 +49 - (0)321 2125 2244
email:=A0 =A0 =A0 =A0= =A0 Rainer@krugs.de

Skype:= =A0 =A0 =A0 =A0 =A0 RMkrug
Google:=A0 =A0 =A0 =A0=A0 R.M.Krug@gmail.com

--00163649a6f51155790491109ddb-- --===============1706071687== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1706071687==--