Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Has scilab got "goto" or switch case?

1,174 views
Skip to first unread message

Marco Esteves

unread,
Dec 17, 2009, 7:48:25 AM12/17/09
to
Hello I've got to implement this algorithm

http://webdocs.cs.ualberta.ca/~sutton/book/ebook/pseudotmp1.png

I can't find or realize if scilab got “jump” instructions which allow
me coding this algorithm.

Steve Bellenot

unread,
Dec 17, 2009, 11:17:32 AM12/17/09
to
In article <202592d3-72af-4e2c...@u7g2000yqm.googlegroups.com>,

Marco Esteves <marcosil...@gmail.com> wrote:
>Hello I've got to implement this algorithm
>
>http://webdocs.cs.ualberta.ca/~sutton/book/ebook/pseudotmp1.png
>
>I can't find or realize if scilab got =93jump=94 instructions which allow
>me coding this algorithm.

This algorithm does not require a goto statement.

Initialization:

done = false

while not done
policy eval
done = true
for each s ...
if b not= pi(s) done = false
end
--
Steven Bellenot http://www.math.fsu.edu/~bellenot
Professor and Associate Chair phone: (850) 644-7405
Department of Mathematics office: 223 Love
Florida State University email: bellenot at math.fsu.edu

Marco Esteves

unread,
Dec 17, 2009, 11:34:59 AM12/17/09
to
On 17 Dez, 16:17, belle...@math.fsu.edu (Steve Bellenot) wrote:
> In article <202592d3-72af-4e2c-85ac-e0829ecf3...@u7g2000yqm.googlegroups.com>,

> Marco Esteves  <marcosilvaeste...@gmail.com> wrote:
>
> >Hello I've got to implement this algorithm
>
> >http://webdocs.cs.ualberta.ca/~sutton/book/ebook/pseudotmp1.png
>
> >I can't find or realize if scilab got =93jump=94 instructions which allow
> >me coding this algorithm.
>
> This algorithm does not require a goto statement.
>
> Initialization:
>
> done = false
>
> while not done
>         policy eval
>         done = true
>         for each s ...
>     if b not= pi(s) done = false
> end
> --
> Steven Bellenot              
> Professor and Associate Chair               phone: (850) 644-7405
> Department of Mathematics                        office: 223 Love
> Florida State University          email: bellenot at math.fsu.edu

Hello,

If b not=pi(s) policy false

this instrution is inside at for cycle but there is other if.

If policy (1) stop else goto 2(policy improvement)


I've already coded part 2 of algorithm. Has 3 for cyles under a while.
Using other while is a waste of resources. But seems the only solution.

0 new messages