<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Operation</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>Recent changes to Operation</description><atom:link href="https://sourceforge.net/p/steppedstatemachine/wiki/Operation/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 14 Sep 2015 21:04:18 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/steppedstatemachine/wiki/Operation/feed" rel="self" type="application/rss+xml"/><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v34
+++ v35
@@ -181,4 +181,4 @@
 :::python
 dataReturned = dispatch(symbol, associatedData)
 ~~~~~~
-The symbol is compared to the symbols in the transitions associated with the current group.  If a matching symbol exists, then the new state associated with that symbol becomes the current state, and the state function for that state is executed with the associated data passe to it.  Data returned from execution of the state function for the new state is returned to the calling program.  If no matching symbol exists in the transitions, then the symbol is silently ignored.  
+The symbol is compared to the symbols in the transitions dictionary associated with the current group.  If a matching symbol exists, then the new state associated with that symbol becomes the current state, and the state function for that state is executed with the associated data passe to it.  Data returned from execution of the state function for the new state is returned to the calling program.  If no matching symbol exists in the transitions, then the symbol is silently ignored.  
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Mon, 14 Sep 2015 21:04:18 -0000</pubDate><guid>https://sourceforge.netae30143841ba9468e5e259a655ab06880e743a55</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Mon, 14 Sep 2015 21:02:19 -0000</pubDate><guid>https://sourceforge.net6264a0214de8d42f04ae22fdf0f1cd64ce94650c</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v32
+++ v33
@@ -165,7 +165,7 @@

 ## Operate State Machine
-In general terms, a state machine operates by supplying it with a series of symbols, with optional data associate with each symbol, and receiving data back from the state machine in response.  This repeats until the overall processing  is completed.  Before this can begin, the state machine must be initialized to be in the initial state.
+In general terms, a state machine operates by supplying it with a series of symbols, with optional data associated with each symbol, and receiving data back from the state machine in response.  This repeats until the overall processing  is completed.  Before this can begin, the state machine must be initialized to be in the initial state.

 To initialize:

@@ -178,6 +178,7 @@
 To dispatch a symbol to the state machine:

 ~~~~~~
+:::python
 dataReturned = dispatch(symbol, associatedData)
 ~~~~~~
 The symbol is compared to the symbols in the transitions associated with the current group.  If a matching symbol exists, then the new state associated with that symbol becomes the current state, and the state function for that state is executed with the associated data passe to it.  Data returned from execution of the state function for the new state is returned to the calling program.  If no matching symbol exists in the transitions, then the symbol is silently ignored.  
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Mon, 14 Sep 2015 21:01:10 -0000</pubDate><guid>https://sourceforge.netf621bc48a11086c242dc591a0ce9691f6d6b69f4</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v31
+++ v32
@@ -12,9 +12,10 @@

 I will discuss how to define the state machine first, then how to operate the state machine by accessing the state machine code.

-### Define State Machine
-Before a state machine may used, every state in the state machine, along with transitions from this state and and associated state function, must be defined, as described in detail below.
+## Define State Machine
+Before a state machine may used, every state in the state machine must be defined: i.e. the name of the state, transitions from this state and associated state function, must be specified as described in detail below.   Code in the state machine block processes the definitions to generate a data structure representing the state machine.  The decorators described below are coded in the state machine code block.  Consequently, the decorator code block must have a access to the state machine code block to operate properly.

+#### State
 Generic state definition --

 ~~~~~~
@@ -29,16 +30,13 @@
     . . .

     return dataOut
-
 ~~~~~~
-
 Where:
 **stateName** is a string representing the name of the newly defined state.
-**stateFunction** is the function executed when the stateName state is entered.
-**transitions** is a dictionary defining the transitions from this state.  The dictionary contains a plurality of entries, each one containing a string key representing the newly received symbol, and a string value representing the new state to transition to when the symbol is received.
-**dataIn** is data provided by the operating code along with a new symbol.  This data can have any data structure desired
-and able to be handled by the state function.
-**dataOut** is data returned by the state function to the operating code by execution of the state function.
+**stateFunction** is a function which is executed when the stateName state is entered.
+**transitions** is a dictionary defining the transitions from this state.  The dictionary contains a plurality of entries, each one containing a string key representing a newly received symbol, and a string value representing the new state to transition to when the symbol is received.
+**dataIn** is data of any type provided by the operating code along with a new symbol.  This data can have any data structure desired and able to be handled by the state function.
+**dataOut** is data of any type returned by the state function to the operating code by execution of the state function.

 Referring again to **transitions**:
 symbol1 is a string representing an expected input symbol.
@@ -50,9 +48,11 @@
 symbolN is a string representing an expected input symbol.
 newStateN is  string representing the name of the state to transition to when symbol 1 is received.

-A search of Python documentation will reveal other methods of passing transitions to the state decorator.  For example:
+A search of Python documentation will reveal other methods of passing a dictionary of transitions to the state decorator.  For example:
+
 ~~~~~~
-transitions = {"symbol1": "newState1", "symbol2": "newState2", ... "symbolN": "newStateN"
+:::python
+transitions = {"symbol1": "newState1", "symbol2": "newState2", ... "symbolN": "newStateN"}
 @state("stateName", **transitions)

 or
@@ -61,16 +61,32 @@
 ~~~~~~
 Any such techniques may be used according to your situation and personal style.  I like the last one and will use that one in the following discussion.

-**To specify that a state is the initial state, use the decorator @initialState, instead of @state.**
+#### Initial State
+To specify that a state is the initial state, use the decorator @initialState, instead of @state.

-#### Diagram
-It is generally easier to design a state machine using a state diagram.  The definition of states, as described above, may be easily performed by reference to the diagram.
+~~~~~~
+:::python
+#
+# Define initial state "startStateName"
+#
+@initialState("startStateName",  **transitions)
+def startStateFunction(dataIn):
+​
+    . . .
+​
+    return dataOut
+~~~~~~
+
+
+## Diagram
+It is generally easier to design a state machine using a state diagram.  The definition of states, described above, may be easily performed by reference to the diagram.

 ![SM diagram](https://sourceforge.net/p/steppedstatemachine/wiki/Operation/attachment/SM.png "SM diagram")

 Diagram's states definition --

 ~~~~~~
+:::python
 #
 # Define state "Start"
 #
@@ -148,4 +164,20 @@

-### Operate State Machine
+## Operate State Machine
+In general terms, a state machine operates by supplying it with a series of symbols, with optional data associate with each symbol, and receiving data back from the state machine in response.  This repeats until the overall processing  is completed.  Before this can begin, the state machine must be initialized to be in the initial state.
+
+To initialize:
+
+~~~~~~
+:::python
+dataReturned = start(dataPassedIn)
+~~~~~~
+The data passed in is passed to the start state function.  The data returned is returned from the starat state function.
+
+To dispatch a symbol to the state machine:
+
+~~~~~~
+dataReturned = dispatch(symbol, associatedData)
+~~~~~~
+The symbol is compared to the symbols in the transitions associated with the current group.  If a matching symbol exists, then the new state associated with that symbol becomes the current state, and the state function for that state is executed with the associated data passe to it.  Data returned from execution of the state function for the new state is returned to the calling program.  If no matching symbol exists in the transitions, then the symbol is silently ignored.  
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Mon, 14 Sep 2015 20:58:13 -0000</pubDate><guid>https://sourceforge.netba6f5168f6e5e2b5d14d8a5a96edc6612f91e8d5</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v30
+++ v31
@@ -68,7 +68,7 @@

 ![SM diagram](https://sourceforge.net/p/steppedstatemachine/wiki/Operation/attachment/SM.png "SM diagram")

-Diagram states definition --
+Diagram's states definition --

 ~~~~~~
 #
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 20:39:38 -0000</pubDate><guid>https://sourceforge.net5f4a2cbafb2963800b55c0b59145231ac953ee05</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v29
+++ v30
@@ -74,7 +74,7 @@
 #
 # Define state "Start"
 #
-@state('Start', Next='Second', Cancel='End')
+@initialState('Start', Next='Second', Cancel='End')        # INITIAL STATE
 def startFunc(dataIn):

     . . .
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 20:34:00 -0000</pubDate><guid>https://sourceforge.net732b917d6aa37f71a0bd082aaf75f0525af1e3f7</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v28
+++ v29
@@ -60,6 +60,8 @@
 @state("stateName", symbol1="newState1", symbol2="newState2", ... symbolN="newStateN")
 ~~~~~~
 Any such techniques may be used according to your situation and personal style.  I like the last one and will use that one in the following discussion.
+
+**To specify that a state is the initial state, use the decorator @initialState, instead of @state.**

 #### Diagram
 It is generally easier to design a state machine using a state diagram.  The definition of states, as described above, may be easily performed by reference to the diagram.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 20:32:03 -0000</pubDate><guid>https://sourceforge.net32a459e7a2a4539a78e65e97992910593804f094</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v27
+++ v28
@@ -52,7 +52,7 @@

 A search of Python documentation will reveal other methods of passing transitions to the state decorator.  For example:
 ~~~~~~
-transitions = {"symbol1"="newState1", "symbol2"="newState2", ... "symbolN"="newStateN"
+transitions = {"symbol1": "newState1", "symbol2": "newState2", ... "symbolN": "newStateN"
 @state("stateName", **transitions)

 or
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 20:29:14 -0000</pubDate><guid>https://sourceforge.net282f1bf699b41949366c827897eb9abdfffe9996</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v26
+++ v27
@@ -1,18 +1,19 @@
 # State Machine
-This program has been designed to be as easy to use as possible.  There are two steps to define and operate a state machine.  First, the step machine must be defined.  Second, the defined step machine must be operated.
+This program has been designed to be as easy to use as possible.  There are two steps to define and operate a state machine.  First, the state machine must be defined.  Second, the defined state machine must be operated.

-There are three blocks of code require in order to operate a state machine according to this project.  
+Three blocks of code are required to operate a state machine according to this project.  

-The state machine code block found in the files section of this project:
+The state machine code block is found in the files section of this project:
  ![SM diagram](https://sourceforge.net/p/steppedstatemachine/wiki/Operation/attachment/CodeBlock.jpg "SM diagram")
-A definition code block, supplied by the user/developer, to definethe structure of the state machine:
+A definition code block is supplied by the user/developer to define the structure of the state machine:
  ![SM diagram](https://sourceforge.net/p/steppedstatemachine/wiki/Operation/attachment/DefsBlock.jpg "SM diagram")
-An operations code block, supplied by the user/developer, to operate a previously defined state machine:
+An operations code block is supplied by the user/developer to operate a previously defined state machine:
  ![SM diagram](https://sourceforge.net/p/steppedstatemachine/wiki/Operation/attachment/OpsBlock.jpg "SM diagram")

 I will discuss how to define the state machine first, then how to operate the state machine by accessing the state machine code.

 ### Define State Machine
+Before a state machine may used, every state in the state machine, along with transitions from this state and and associated state function, must be defined, as described in detail below.

 Generic state definition --

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 20:25:32 -0000</pubDate><guid>https://sourceforge.net515d6193d499e5b7a454e5595b60da20f9e1ee2e</guid></item><item><title>Operation modified by DNC</title><link>https://sourceforge.net/p/steppedstatemachine/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v25
+++ v26
@@ -12,15 +12,7 @@

 I will discuss how to define the state machine first, then how to operate the state machine by accessing the state machine code.

-
-## Operation
-
-
-
-
 ### Define State Machine
-
-

 Generic state definition --

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DNC</dc:creator><pubDate>Fri, 11 Sep 2015 19:36:55 -0000</pubDate><guid>https://sourceforge.net4d6c46f94f3e07b5049e0c3d39b348f2cee6e78c</guid></item></channel></rss>