From: MP on
Hi all,
any refs for sites delving into examples of usage and implementaion of
"state machines" in vb?
from what I've read so far(google) seems basically just a select case
statement but I'm sure i'm missing a lot.
thanks
mark


From: Tony Proctor on
You probably need to expand a bit on what you mean by "state machine" mark.
If you mean "finite state machine" or "finite state automaton" then you can
build one of arbitrary complexity in VB and I don't see the relevance of
'select case' which is merely a language element

Tony Proctor

"MP" <NoSpam(a)Thanks.com> wrote in message
news:O6G1Sx55IHA.1204(a)TK2MSFTNGP04.phx.gbl...
> Hi all,
> any refs for sites delving into examples of usage and implementaion of
> "state machines" in vb?
> from what I've read so far(google) seems basically just a select case
> statement but I'm sure i'm missing a lot.
> thanks
> mark
>


From: MP on
Hi Tony,

"Tony Proctor" <tony_proctor(a)aimtechnology_NoMoreSPAM_.com> wrote in message
news:OyUm8CM6IHA.1204(a)TK2MSFTNGP04.phx.gbl...
> You probably need to expand a bit on what you mean by "state machine"
> mark. If you mean "finite state machine"

I guess i mean fsm...following up on suggestions I recvd here to consider
State Machine as solution to a problem I posted ("algorithm headscratcher")
looking up State Machine on google led me to some info that discussed
primarily finite state machines
and the implementations (in simplified form) showed basically a select case
structure testing an event input
Function StateMachine (event) as output
Select Case event
Case event1
StateMachine = output1
...


or "finite state automaton" then you can
> build one of arbitrary complexity in VB and I don't see the relevance of
> 'select case' which is merely a language element

the only relevance was that was the general mechanism I saw used and
conceptually the format seemed to follow the general model of <select case
event>...<generate output>
(in my naive understanding)

obviously much more complexity can be involved than my lame description
indicated
:-)
mark


>
> Tony Proctor
>
> "MP" <NoSpam(a)Thanks.com> wrote in message
> news:O6G1Sx55IHA.1204(a)TK2MSFTNGP04.phx.gbl...
>> Hi all,
>> any refs for sites delving into examples of usage and implementaion of
>> "state machines" in vb?
>> from what I've read so far(google) seems basically just a select case
>> statement but I'm sure i'm missing a lot.
>> thanks
>> mark
>>
>
>


From: Tony Proctor on
Finite State Machines have lots of uses (e.g. parsers, workflow, etc) but
there's no single design paradigm

Basically, a FSM is just a black box that can only exist in a finite number
of states. Inputs to the machine cause transitions from one state to another
before finally exiting. Here's a slightly better description:
http://en.wikipedia.org/wiki/Finite_state_machine

I've written several of these, in several different languages. The main
obstacle in VB is that it's not easy to call an action routine from a table.
Using a Case statement is a poor-mans way of selecting an action and
performing it but most real FSMs have tables of action routines and select
them directly by index. In order to do this (reliably) in a VB program you
would have to step outside of the normal language and run-time support

Tony Proctor

"MP" <NoSpam(a)Thanks.com> wrote in message
news:eSGwqB36IHA.2220(a)TK2MSFTNGP06.phx.gbl...
> Hi Tony,
>
> "Tony Proctor" <tony_proctor(a)aimtechnology_NoMoreSPAM_.com> wrote in
> message news:OyUm8CM6IHA.1204(a)TK2MSFTNGP04.phx.gbl...
>> You probably need to expand a bit on what you mean by "state machine"
>> mark. If you mean "finite state machine"
>
> I guess i mean fsm...following up on suggestions I recvd here to consider
> State Machine as solution to a problem I posted ("algorithm
> headscratcher")
> looking up State Machine on google led me to some info that discussed
> primarily finite state machines
> and the implementations (in simplified form) showed basically a select
> case structure testing an event input
> Function StateMachine (event) as output
> Select Case event
> Case event1
> StateMachine = output1
> ...
>
>
> or "finite state automaton" then you can
>> build one of arbitrary complexity in VB and I don't see the relevance of
>> 'select case' which is merely a language element
>
> the only relevance was that was the general mechanism I saw used and
> conceptually the format seemed to follow the general model of <select case
> event>...<generate output>
> (in my naive understanding)
>
> obviously much more complexity can be involved than my lame description
> indicated
> :-)
> mark
>
>
>>
>> Tony Proctor
>>
>> "MP" <NoSpam(a)Thanks.com> wrote in message
>> news:O6G1Sx55IHA.1204(a)TK2MSFTNGP04.phx.gbl...
>>> Hi all,
>>> any refs for sites delving into examples of usage and implementaion of
>>> "state machines" in vb?
>>> from what I've read so far(google) seems basically just a select case
>>> statement but I'm sure i'm missing a lot.
>>> thanks
>>> mark
>>>
>>
>>
>
>


From: MP on
Thanks Tony,

"Tony Proctor" <tony_proctor(a)aimtechnology_NoMoreSPAM_.com> wrote in message
news:enUZ8496IHA.5276(a)TK2MSFTNGP05.phx.gbl...
> Finite State Machines have lots of uses (e.g. parsers, workflow, etc) but
> there's no single design paradigm
>
> Basically, a FSM is just a black box that can only exist in a finite
> number of states. Inputs to the machine cause transitions from one state
> to another before finally exiting.

I probably don't need an "official" fsm in my problem, but i'm greatful for
the suggestion from dbp and Larry because it made be re-look at my problem
in new ways.

I do have a finite number of 'states'
(Input is already in 'store')
(MirrorOfInput is already in 'store')
(SimilarDiffLength is in 'store')
(OppHandDiffLength in 'store')
(NewItem)

am using a series of if statements on the inputs
far from a true fsm I'm sure.

mark


 | 
Pages: 1
Prev: World-wide use of VB.NET 2005
Next: .reg file