diff options
Diffstat (limited to 'js/Sources/RAND_f.js')
-rw-r--r-- | js/Sources/RAND_f.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/js/Sources/RAND_f.js b/js/Sources/RAND_f.js index 9af2134d..5f29e7aa 100644 --- a/js/Sources/RAND_f.js +++ b/js/Sources/RAND_f.js @@ -1,21 +1,21 @@ /* autogenerated from "macros/Sources/RAND_f.sci" */ function RAND_f() { RAND_f.prototype.define = function RAND_f() { - a = 0; - b = 1; + this.a = 0; + this.b = 1; dt = 0; out = 1; - flag = 0; + this.flag = 0; model = scicos_model(); model.sim = "rndblk"; model.out = out; model.evtin = 1; - model.dstate = [[int(rand()*(10^7-1))],[0*a.slice()]]; - model.rpar = [[a.slice()],[b.slice()]]; - model.ipar = flag; + model.dstate = [[int(rand()*(10^7-1))],[0*this.a.slice()]]; + model.rpar = [[this.a.slice()],[this.b.slice()]]; + model.ipar = this.flag; model.blocktype = "d"; model.dep_ut = [false,false]; - exprs = [[string(flag)],[sci2exp(a.slice())],[sci2exp(b.slice())],[string(model.dstate[1-1])]]; + exprs = [[string(this.flag)],[sci2exp(this.a.slice())],[sci2exp(this.b.slice())],[string(model.dstate[1-1])]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -37,19 +37,19 @@ function RAND_f() { exprs = [[exprs],[string(model.dstate[1-1])]]; } while (true) { - [ok,flag,a,b,seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],[["flag"],["A"],["B"],["seed"]],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); + [ok,this.flag,this.a,this.b,this.seed_c,exprs] = scicos_getvalue([["Set Random generator block parameters"],["flag = 0 : Uniform distribution A is min and A+B max"],["flag = 1 : Normal distribution A is mean and B deviation"],[" "],["A and B must be vector with equal sizes"],["seed is the seed of random number generator (integer<2**31)"]],[["flag"],["A"],["B"],["seed"]],list("vec",1,"vec",-1,"vec","size(%2,\'*\')","vec",1),exprs); if (!ok) { break; } - if (flag!=0&&flag!=1) { + if (this.flag!=0&&this.flag!=1) { message("flag must be equal to 1 or 0"); } else { - nout = size(a,"*"); + nout = size(this.a,"*"); graphics.exprs = exprs; model.out = nout; - model.ipar = flag; - model.rpar = [[a.slice()],[b.slice()]]; - model.dstate = [[seed_c],[0*a.slice()]]; + model.ipar = this.flag; + model.rpar = [[this.a.slice()],[this.b.slice()]]; + model.dstate = [[this.seed_c],[0*this.a.slice()]]; this.x.graphics = graphics; this.x.model = model; break; |