Re: Plugin support

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Sunday 11 May 2008, Jesse Forsmann wrote:
> I'm thinking of possible monte carlo support.  Can this be
> done via the new supported plugin interface?
>
> Where can I get a good example to get me started?

First, what do you want the user interface to look like?

In the source, most of the c*, d*, lang*, s*, bm* can be used as 
plugins.  Just compile with "g++ -fPIC -shared  foo.cc".  Then 
you can "load ./a.out".

Look in "Make1" ..  The files explicitly listed in "RAW_SRCS" 
are part of the core.  The files listed in the groups 
like "MODELS" or "D_SRCS" are really designed as plugins.  You 
can leave them out if you want to.

For monte carlo, there is a need to vary the parameters.  Maybe 
something should be built-in, but I am not sure what.  I 
suppose you could use expressions as component values, and your 
MC plugin could randomize the values.

Something like:
R123 (a b) {10k*(1+mc1)}

.. where mc1 is the value you tweek to adjust the value.

.param mc1=0
.op
.param mc1=.1
.op
.param mc1=-.1
.op

and so on.

Make something based on a random number generator to make values 
for mc1.

What I would like to do eventually is to make a function that 
will take care of this.

R123 (a b) {10k*tolerance(.1,gaussian,15)}

... which says that it varies by +/- .1*value, has gaussian 
distribution, and is in group 15.  "Group 15" is a way to 
identify components that track each other.

Whatever the syntax is, it needs to work without changing any of 
the models.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.