Package com.nr.min

Examples of com.nr.min.Anneal


    for (i=0;i<N;i++) {
      x[i]=myran.doub();
      y[i]=myran.doub();
      iorder[i]=i;
    }
    Anneal anl=new Anneal();

    // Initial length
    length=0;
    for (i=0;i<N-1;i++)
      length += anl.alen(x[iorder[i]],x[iorder[i+1]],y[iorder[i]],y[iorder[i+1]]);
    length += anl.alen(x[iorder[N-1]],x[iorder[0]],y[iorder[N-1]],y[iorder[0]]);
    linit=length;
//    System.out.printf(linit);
    for (k=0;k<M;k++) {
      anl.order(x,y,iorder);

      // Final length
      length=0;
      for (i=0;i<N-1;i++)
        length += anl.alen(x[iorder[i]],x[iorder[i+1]],y[iorder[i]],y[iorder[i+1]]);
      length += anl.alen(x[iorder[N-1]],x[iorder[0]],y[iorder[N-1]],y[iorder[0]]);
      l[k]=length;
//    System.out.printf(l[k]);
    }

    rms=0.0;
View Full Code Here

TOP

Related Classes of com.nr.min.Anneal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.