⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfparams.java

📁 ASMUML.zip一个人工股市的建模资料,主要是针对asm2.2的建模,欢迎大家下载
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    if (nnew > nnewmax) nnewmax = nnew;    if (condwords > ncondmax) ncondmax = condwords;    //  fprintf(stderr,"BFParams init complete");    return this;//super.createEnd();  }  public int[] getBitListPtr()  {    return bitlist;  }  /*"if passed a pointer to an array of integers of length size, this    frees the old bitlist and puts the new one in its place"*/  public void copyBitList$Length (int[] x , int size)  {    int i;    for (i=0; i < size; i++)      {        bitlist[i] = x[i];      }  }  public double[] getProbListPtr()  {    return problist;  }  /*"if passed a pointer to a double with a given size, this frees the    old bitlist and puts the new one in its place"*/  public void copyProbList$Length (double[] p , int size)  {    int i;    for (i=0; i < size; i++)      {        problist[i] = p[i];      }  }  public int ReadBitname(String variable, KeyTable[] table)  /*   * Like ReadKeyword, but looks up the name first as the name of a bit   * and then (if there's no match) in table if it's non-NULL.   */  {    KeyTable[] ptr;    int n;    n = World.bitNumberOf(variable);/*    if (n < 0 && table)      {        for (ptr=table; ptr->name; ptr++)          if (strcmp(variable,ptr->name) == EQ)            break;        if (!ptr->name && strcmp(variable,"???") != EQ)          printf("unknown keyword '%s'\n",variable);        n = ptr->value;      }*/    return n;  }  /*"Create a copy of this BFParams instance. Note this copies EVERY    instance variable, one by one"*/  public BFParams copy( Zone aZone)  {    BFParams bfParams = new BFParams(aZone,true) ;    //Why not begin with a totally fresh instance created from scratch,    //The way your old granny used to do it?    //if ((bfParams = (BFParams) Globals.env.lispAppArchiver.getWithZone$key(this.getZone(),"bfParams"))== null)    //      System.out.println("Can't find the BFParam's parameters");    //Then replace all those values granny liked (:    bfParams.numfcasts =  numfcasts;    bfParams.condwords = condwords ;    bfParams.condbits = condbits;    bfParams.mincount = mincount;    bfParams.gafrequency = gafrequency;    bfParams.firstgatime = firstgatime;    bfParams.longtime = longtime;    bfParams.individual = individual;    bfParams.tauv = tauv;    bfParams.lambda = lambda;    bfParams.maxbid = maxbid;    bfParams.bitprob = bitprob;    bfParams.subrange = subrange;    bfParams.a_min = a_min;    bfParams.a_max = a_max;    bfParams.b_min = b_min;    bfParams.b_max = b_max;    bfParams.c_min = c_min;    bfParams.c_max = c_max;    bfParams.a_range = a_range;    bfParams.b_range = b_range;    bfParams.c_range = c_range;    bfParams.newfcastvar = newfcastvar;    bfParams.initvar = initvar;    bfParams.bitcost = bitcost;    bfParams.maxdev = maxdev;    bfParams.poolfrac = poolfrac;    bfParams.newfrac = newfrac;    bfParams.pcrossover = pcrossover;    bfParams.plinear = plinear;    bfParams.prandom = prandom;    bfParams.pmutation = pmutation;    bfParams.plong = plong;    bfParams.pshort = pshort;    bfParams.nhood = nhood;    bfParams.genfrac = genfrac;    bfParams.gaprob = gaprob;    bfParams.npool = npool;    bfParams.nnew = nnew;    bfParams.nnulls = nnulls;    bfParams.npoolmax = npoolmax;    bfParams.nnewmax =  nnewmax;    bfParams.ncondmax = ncondmax;    bfParams.copyBitList$Length( bitlist , condbits);    bfParams.copyProbList$Length( problist , condbits);    return bfParams;  }  BFParams(Zone aZone){  super (aZone);  specialbits[0]=new KeyTable("null", NULLBIT);  specialbits[1]=new KeyTable("end", ENDLIST);  specialbits[2]=new KeyTable(".", ENDLIST);  specialbits[3]=new KeyTable("all", ALL);  specialbits[4]=new KeyTable("allbits", ALL);  specialbits[5]=new KeyTable("p", SETPROB);  specialbits[6]=new KeyTable("P", SETPROB);  specialbits[7]=new KeyTable("???", BADINPUT);  specialbits[8]=new KeyTable(null,  NOTFOUND);    class BFParamsProbeMap extends EmptyProbeMapImpl {      private VarProbe probeVariable (String name) {        return          Globals.env.probeLibrary.getProbeForVariable$inClass          (name, BFParams.this.getClass ());      }      private MessageProbe probeMessage (String name) {        return          Globals.env.probeLibrary.getProbeForMessage$inClass          (name, BFParams.this.getClass ());      }      private void addVar (String name) {        addProbe (probeVariable (name));      }      private void addMessage (String name) {        addProbe (probeMessage (name));      }      public BFParamsProbeMap (Zone _aZone, Class aClass) {        super (_aZone, aClass);     addVar ("numfcasts");     addVar ("condwords");     addVar ("condbits");     addVar ("mincount");     addVar ("gafrequency");     addVar ("firstgatime");     addVar ("longtime");     addVar ("individual");     addVar ("tauv");     addVar ("lambda");     addVar ("maxbid");     addVar ("bitprob");     addVar ("subrange");     addVar ("a_min");     addVar ("a_max");     addVar ("b_min");     addVar ("b_max");     addVar ("c_min");     addVar ("c_max");     addVar ("a_range");     addVar ("b_range");     addVar ("c_range");     addVar ("newfcastvar");     addVar ("initvar");     addVar ("bitcost");     addVar ("maxdev");     addVar ("poolfrac");     addVar ("newfrac");     addVar ("pcrossover");     addVar ("plinear");     addVar ("prandom");     addVar ("pmutation");     addVar ("plong");     addVar ("pshort");     addVar ("nhood");     addVar ("genfrac");     addVar ("gaprob");     addVar ("npool");     addVar ("nnew");     addVar ("nnulls");     addVar ("npoolmax");     addVar ("nnewmax");     addVar ("ncondmax");      }    }    // Install our custom probeMap class directly into the    // probeLibrary    Globals.env.probeLibrary.setProbeMap$For      (new BFParamsProbeMap (aZone, getClass ()), getClass ());  }  BFParams(Zone aZone, boolean a){  super (aZone);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -