Package util

Examples of util.Gaussian


    Network network = null;
    int numCols = 0;
    int granulesPerColumn = 1;
    double intercolumnConnectivity = 0.20;
    boolean dynamicItercolumnConnectivity = false;
    Gaussian granuleToMitralWeight = null;
    Gaussian granuleActivationThreshold = null;
    Gaussian mitralToGranuleWeights = null;
   
    String[] lines = Util.truncateLinesAtChar(FileUtil.readFileLines(parametersFile), '=');
   
    if (lines == null || lines.length != 7)
    {
      //DEBUG
      if (Main.VERBOSE)
      {
        System.out.println();
        System.out.println("-COULD NOT READ PARAMS FILE; DEFAULT NETWORK USED-");
      }
     
      //LOG
      if (Main.LOG_WRITER != null)
      {
        Main.attemptNewLineToLog();
        Main.attemptWriteToLog("-COULD NOT READ PARAMS FILE; DEFAULT NETWORK USED-");
      }
     
      return new Network(Main.NUM_COLS);
    }
   
    for (int x = 0; x < lines.length; x++)
    {
      switch (x)
      {
        case 0:
        {
          numCols = Integer.parseInt(lines[x]);
          break;
        }
        case 1:
        {
          granulesPerColumn = Integer.parseInt(lines[x]);
          break;
        }
        case 2:
        {
          intercolumnConnectivity = Double.parseDouble(lines[x]);
          break;
        }
        case 3:
        {
          dynamicItercolumnConnectivity = Boolean.parseBoolean(lines[x]);
          break;
        }
        case 4:
        {
          if (lines[x].contains( (CharSequence)"(" ))
          {
            lines[x] = Util.removeChar(lines[x], '(');
            lines[x] = Util.removeChar(lines[x], ')');
           
            granuleToMitralWeight = new Gaussian( Double.parseDouble(lines[x]) );
          }
          else
            granuleToMitralWeight = new SingleValueGaussian(Double.parseDouble(lines[x]));
         
          break;
        }
        case 5:
        {
          if (lines[x].contains( (CharSequence)"(" ))
          {
            lines[x] = Util.removeChar(lines[x], '(');
            lines[x] = Util.removeChar(lines[x], ')');
           
            granuleActivationThreshold = new Gaussian(Double.parseDouble(lines[x]));
          }
          else
            granuleActivationThreshold = new SingleValueGaussian(Double.parseDouble(lines[x]));
         
          break;
        }
        case 6:
        {
          if (lines[x].contains( (CharSequence)"(" ))
          {
            lines[x] = Util.removeChar(lines[x], '(');
            lines[x] = Util.removeChar(lines[x], ')');
           
            mitralToGranuleWeights = new Gaussian(Double.parseDouble(lines[x]));
          }
          else
            mitralToGranuleWeights = new SingleValueGaussian(Double.parseDouble(lines[x]));
         
          break;
View Full Code Here


public class GaussianTest
{
  @Test
  public void testGaussian()
  {
    Gaussian g = new Gaussian();
   
    assert(g.getPDF() == null && g.getRandomVar() == null && g.isEmpty());
  }
View Full Code Here

  @Test
  public void testGaussianDouble()
  {
    double stdev = 25.00;
    Gaussian g = new Gaussian(stdev);
   
    assert(    g.getMean() == 1+stdev*3
        && g.isEmpty() == false
        && g.getSize() == Gaussian.DEFAULT_GAUSSIAN_SIZE
        && g.getRandomVar().length == g.getPDF().length);
  }
View Full Code Here

  @Test
  public void testGaussianDoubleArray()
  {
    double[] zscores = {0.1, 1.0, 1.5, 2.0, 2.5, 3.0};
   
    Gaussian g = new Gaussian(zscores);
   
    assert(    g.isEmpty() == false
        && Util.compareArraysByValue(g.getPDF(),zscores)
        && g.getSize() == zscores.length
        && Util.arrayMean(zscores) == g.getMean()
        && Util.standardDeviation(zscores) == g.getStandardDeviation());
  }
View Full Code Here

    int size = 200;
    double mean = 100;
    double stdev = 20;
    double multiplier = 1000;
   
    Gaussian g = new Gaussian(size,mean,stdev,multiplier);
   
    assert(    g.isEmpty() == false
        && g.getSize() == size
        && g.getMean() == mean
        && g.getStandardDeviation() == stdev
        && g.getRandomValue() % multiplier <= multiplier);
  }
View Full Code Here

  {
    int size = 200;
    double mean = 100;
    double stdev = 20;
   
    Gaussian g = new Gaussian(size,mean,stdev);
   
    assert(    g.isEmpty() == false
        && g.getSize() == size
        && g.getMean() == mean
        && g.getStandardDeviation() == stdev);
  }
View Full Code Here

  public void testGaussianIntDouble()
  {
    int size = 200;
    double stdev = 20;
   
    Gaussian g = new Gaussian(size,stdev);
   
    assert(    g.isEmpty() == false
        && g.getSize() == size
        && g.getStandardDeviation() == stdev);
  }
View Full Code Here

  {
    int size = 200;
    double stdev = 20;
    double multiplier = 1000;
   
    Gaussian g = new Gaussian(multiplier,size,stdev);
   
    assert(    g.isEmpty() == false
        && g.getSize() == size
        && g.getStandardDeviation() == stdev
        && g.getRandomValue() % multiplier <= multiplier);
  }
View Full Code Here

    int size = 200;
    double mean = 100;
    double stdev = 20;
    double multiplier = 1000;
   
    Gaussian g = new Gaussian(size,mean,stdev,multiplier);
   
    assert( Util.arrayContains(g.getPDF(), g.getRandomValue()));
  }
View Full Code Here

  @Test
  public void testGetPDF()
  {
    double[] zscores = {0.1, 1.0, 1.5, 2.0, 2.5, 3.0};
   
    Gaussian g = new Gaussian(zscores);
   
    assert( Util.compareArraysByValue(g.getPDF(),zscores));
  }
View Full Code Here

TOP

Related Classes of util.Gaussian

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.