Examples of Gaussian


Examples of org.cspoker.ai.bots.util.Gaussian

          throw new IllegalStateException("Rounding error is too big.");
        }
        EVVar = 0;
      }
     
      this.EVGaussian = new Gaussian(EV,EVVar);
    }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

     
      ImmutableList<INode> children = node.getChildren();
      Gaussian[] gaussians = new Gaussian[children.size()];
      for (int i = 0; i < children.size(); i++) {
        INode child = children.get(i);
        gaussians[i] = new Gaussian(child.getEV(),child.getEVVar());
      }
      EVGaussian = Gaussian.maxOf(gaussians);
    }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

*/

public class MaxGaussianTest extends TestCase {

  public void testEqual() throws Exception {
    Gaussian a = new Gaussian(0,1);
    Gaussian m = Gaussian.maxOf(a,a);
    System.out.println(m);
    assertTrue(close(m.mean, 0.5642, 0.01));
  }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

    System.out.println(m);
    assertTrue(close(m.mean, 0.5642, 0.01));
  }
 
  public void test3() throws Exception {
    Gaussian a = new Gaussian(0,1);
    Gaussian m = Gaussian.maxOf(a,a,a);
    System.out.println(m);
    assertTrue(close(m.mean, 0.846, 0.01));
  }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

    assertTrue(close(m.mean, 0.846, 0.01));
  }

 
  public void test10() throws Exception {
    Gaussian a = new Gaussian(0,1);
    Gaussian m = Gaussian.maxOf(a,a,a,a,a,a,a,a,a,a);
    System.out.println(m);
    assertTrue(close(m.mean, 1.5388, 0.01));
  }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

    System.out.println(m);
    assertTrue(close(m.mean, 1.5388, 0.01));
  }

  public void testDifferent() throws Exception {
    Gaussian a = new Gaussian(0,1);
    Gaussian b = new Gaussian(-1000,1);

    Gaussian m = Gaussian.maxOf(a,b);
    System.out.println(m);
    assertTrue(close(m.mean, 0, 0.01));
    assertTrue(close(m.variance, 1, 0.01));
  }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

    assertTrue(close(m.variance, 1, 0.01));
  }


  public void testDifferentStdDev() throws Exception {
    Gaussian a = new Gaussian(5,10);
    Gaussian b = new Gaussian(-1000,1);

    Gaussian m = Gaussian.maxOf(a,b);
    System.out.println(m);
    assertTrue(close(m.mean, 5, 0.01));
    assertTrue(close(m.variance, 10, 0.01));
  }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

    assertTrue(close(m.variance, 10, 0.01));
  }

 
  public void testDifferentReverse() throws Exception {
    Gaussian a = new Gaussian(0,1);
    Gaussian b = new Gaussian(-1000,1);

    Gaussian m = Gaussian.maxOf(b,a);
    System.out.println(m);
    assertTrue(close(m.mean, 0, 0.01));
    assertTrue(close(m.variance, 1, 0.01));
  }
View Full Code Here

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

Examples of util.Gaussian

public class GaussianTest
{
  @Test
  public void testGaussian()
  {
    Gaussian g = new Gaussian();
   
    assert(g.getPDF() == null && g.getRandomVar() == null && g.isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.