Package structures

Examples of structures.Network


   
    for(int x=0; x<numNetworks; x++)
    {
      //Main.UNIVERSAL_TO_MITRAL_WEIGHT = (new java.util.Random()).nextInt((int)Math.round(Network.DEFAULT_MITRAL_TO_COL_CONNECTIVITY*Main.NUM_COLS)) +1;
     
      Network n = new Network(main.Main.NUM_COLS);
     
      try
      {
        n.initialize(null);
      }
      catch(InitializationException e)
      {
        e.printStackTrace();
        System.exit(0);
View Full Code Here


   
    //STEP 1.5: Generate Initial Networks
    networkArray = new ArrayList<JNetwork>(numNetworks);
    for (int x=0; x<numNetworks; x++)
    {
      networkArray.add(new JNetwork(new Network(main.Main.NUM_COLS)));
    }
   
    //STEP 2: Show Options Screen
    optionsFrame = new OptionsFrame(networkArray);
    optionsFrame.setVisible(true);
View Full Code Here

   
    //STEP 1.5: Generate Initial Networks
    networkArray = new ArrayList<JNetwork>(numNetworks);
    for (int x=0; x<numNetworks; x++)
    {
      networkArray.add(new JNetwork(new Network(main.Main.NUM_COLS)));
    }
   
    //STEP 2: Setup Options Screen
    this.battery = battery;
    optionsFrame = new OptionsFrame(networkArray, battery);
View Full Code Here

   
    Util.printArray(inputs);
    Util.printArray(outputs);
    */
   
    Network n = new Network(NUM_COLS);
    n.initialize(null);
   
    Odor[] battery= OdorPreprocessor.generateSimilarOdors(2, NUM_COLS);
   
    double[][] outputs = new double[NUM_COLS][battery.length];
   
    int counter = 0;
   
    for (Odor od : battery)
    {
      System.out.println("Odor #"+(counter));
     
      for (double i : od.getInputs())
      {
        System.out.println(i);
      }
     
      System.out.println();
     
      outputs[counter] = n.fire(od);
     
      for (double a: outputs[counter])
      {
        System.out.println(a);
      }
View Full Code Here

  }
 
  //TODO parse network parameters file
  private static Network parseParametersFile(String filename)
  {
    if (filename == null || filename.compareTo("") == 0) return new Network(Main.NUM_COLS);
   
    File parametersFile = new File(System.getProperty("user.dir")+File.separatorChar+filename);
   
    //TODO Interesting Network variables
    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;
        }
      }
    }
   
    network = new NetworknumCols,
                granulesPerColumn,
                intercolumnConnectivity,
                dynamicItercolumnConnectivity,
                granuleToMitralWeight,
                granuleActivationThreshold,
View Full Code Here

    output = null;
  }
 
  public JNetwork(int numCols)
  {
    this.myNetwork = new Network(numCols);
   
    try{ this.myNetwork.initialize(null); } catch (main.InitializationException e ) { e.printStackTrace(); System.exit(0); }
   
    this.numColumns = myNetwork.getNumCols();
    output = null;
View Full Code Here

        }
        else if(value > EditNetworksComboBox.getItemCount())
        {
          while (value != EditNetworksComboBox.getItemCount())
          {
            JNetwork curr = new JNetwork(new Network(main.Main.NUM_COLS));
            networks.add(curr);
            EditNetworksComboBox.addItem(curr);
          }
        }
      }
View Full Code Here

TOP

Related Classes of structures.Network

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.