Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Particle Sw...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 30 of 37 Topic 3745 of 4325
Post > Topic >>

Re: Particle Swarm Optimization

by anton@[EMAIL PROTECTED] (Anton Ertl) Feb 11, 2008 at 12:55 PM

mhx@[EMAIL PROTECTED]
 (Marcel Hendrix) writes:
>anton@[EMAIL PROTECTED]
 (Anton Ertl) writes Re: Particle Swarm
Optimization
>> mhx@[EMAIL PROTECTED]
 (Marcel Hendrix) writes:
>>> Triggered by a (German) C't article, last week I experimented a bit 
>>> with Particle Swarm Optimization.
>> ...
>>> Unfortunately, I found the results quite unconvincing. 
>[..]
>> Yes.  Maybe I missed something, but the particle swarm stuff seems to
>> be similar to ant algorithms to me; and that fails to convince me, too
>> (but maybe I miss the point of that, too): We know the best path yet
>> after the first ant walks it, no need to simulate multiple ants
>> walking the same path.  Such algorithms may have a place if you have
>> massive parallelism, and very limited communication bandwidth compared
>> to computation, but not in settings that most of us use.
>
>Well, ant algorithms can solve 'discrete' problems (without 
>derivatives) which is useful. AFAIK, particle swarms can't 
>handle such discrete problems, and are very bad at accurately 
>finding derivatives.

Ok.  I was not looking at the algorithms in such detail.  It just
seems to me that, as soon as the first ant or particle hits a (local)
optimum, the others are unnecessary for finding that optimum, and
these algorithms also don't seem to provide a useful way to get out of
the local optimum and find another one.

>>> STRUCT
>>>   dfloat% FIELD .myBestResult
>[..]
>>> END-STRUCT node%        
>
>> Nice to see that you picked up my STRUCT syntax (although it's too
>> late for Forth200x).
>
>I'd rather keep on using it.

Go ahead.  There's an implementation of it in standard Forth
<http://www.complang.tuwien.ac.at/forth/struct.fs>,
so no reason to
switch.

What I meant was: Had this package been known to be widely used a year
or two ago, it may have had a good chance to be standardized in
Forth200x.

>Would the following be close enough 
>for Forth 200x? I think the word +FIELD can be combined with 
>Gforth's structures? (An obvious problem would be that a Gforth
>structure has an aligned size and would produce wrong results 
>when creating structures of structures.)
>
>( @[EMAIL PROTECTED]
 HEAD> @[EMAIL PROTECTED]
 >BODY  finds the body address of the last word 
>  defined ).
>
>-- ANS 200x 
>: +FIELD ( align1 offset1 size "name" -- align2 offset2 ) 1 SWAP FIELD ;
>: BEGIN-STRUCTURE ( "name" -- addr 1 0 ) 0 VALUE  @[EMAIL PROTECTED]
 HEAD> @[EMAIL PROTECTED]
 >BODY 1
0 ;
>: END-STRUCTURE   ( addr align size -- ) NIP SWAP ! ;
>: CFIELD:  char%   FIELD ; 
>: FIELD:   cell%   FIELD ; 
>: FFIELD:  float%  FIELD ;
>: SFFIELD: dfloat% FIELD ;
>: DFFIELD: sfloat% FIELD ;

I don't think that this is a correct implementation of Forth200x
X:structures, because it requires that there is the alignment on the
stack.  E.g., code like this would not work:

0
  cfield: x
  field:  y
constant xy

I would build (and have built) the X:structures implementation on
lower-level words than those provided by struct.fs.  But if you really
want to do it, you can build it on top of struct.fs:

: +field ( n1 n2 "name" -- n3 ) >r 1 swap 1 r> field nip ;
: cfield:   ( n1 "name" -- n2 ) 1 swap char% field nip ;
: field:    ( n1 "name" -- n2 ) 1 swap cell% field nip ;
....
: begin-structure ( "name" -- addr 0 )
  create
    here 0  0 ,
  does> ( -- size )
    @[EMAIL PROTECTED]
  ;
: end-structure  ( addr n -- )
  swap !  ;

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2008:
http://www.complang.tuwien.ac.at/anton/euroforth/ef08.html
 




 37 Posts in Topic:
Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-02 12:19:06 
Re: Particle Swarm Optimization
"Paul E. Bennett&quo  2008-02-03 21:30:00 
Re: Particle Swarm Optimization
Alex McDonald <blog@[E  2008-02-06 00:57:28 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:49:46 
Re: Particle Swarm Optimization
m-coughlin <m-coughlin  2008-02-23 22:31:01 
Re: Particle Swarm Optimization
William James <w_a_x_m  2008-02-06 02:23:23 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-06 21:33:55 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:50:32 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:51:37 
Re: Particle Swarm Optimization
anton@[EMAIL PROTECTED]   2008-02-10 17:29:06 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-10 22:41:01 
Re: Particle Swarm Optimization
Albert van der Horst <  2008-02-11 10:52:36 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-11 19:19:35 
Re: Particle Swarm Optimization
Albert van der Horst <  2008-02-12 11:39:37 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-12 11:00:00 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-13 07:38:53 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-13 10:35:49 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-13 19:59:37 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-13 14:35:17 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-16 12:21:38 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-16 12:39:34 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-18 10:40:50 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-18 20:21:40 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-18 15:29:13 
Re: Particle Swarm Optimization
Jerry Avins <jya@[EMAI  2008-02-18 17:39:54 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-19 20:20:06 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 11:14:52 
Re: Particle Swarm Optimization
John Doty <jpd@[EMAIL   2008-02-19 12:36:16 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:59:36 
Re: Particle Swarm Optimization
anton@[EMAIL PROTECTED]   2008-02-11 12:55:24 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-11 19:42:17 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:55:44 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:54:00 
Re: Particle Swarm Optimization
Doug Hoffman <no.spam&  2008-02-17 09:08:04 
Re: Particle Swarm Optimization
mhx@[EMAIL PROTECTED] (M  2008-02-17 17:14:44 
Re: Particle Swarm Optimization
Doug Hoffman <no.spam&  2008-02-17 15:29:03 
Re: Particle Swarm Optimization
gavino <gavcomedy@[EMA  2008-02-19 10:39:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:27:30 CST 2008.