public static void main(String[] args) {
    try {
      Project p =
          Project.loadProject(
              new File(ProjectStructure.getnCExamplesDir(), "Ex5_Networks/Ex5_Networks.ncx"), null);

      GeneratedElecInputs gei = new GeneratedElecInputs(p);

      System.out.println("Internal info: \n" + gei.toString());

      // IClamp ic = new IClamp(2,3,4, true);

      gei.addSingleInput("Input_0", "IClamp", "cg1", 3, 3, 3, null);
      gei.addSingleInput("Input_0", "IClamp", "cg1", 38, 3, 3, null);
      gei.addSingleInput("Input_2", "IClamp", "cg3", 3, 38, 39, null);

      System.out.println("Internal info: \n" + gei.toString());

      File f = new File("../temp/tempp.txt");

      gei.saveToFile(f);

      GeneratedElecInputs cpr2 = new GeneratedElecInputs(null);

      System.out.println(
          "----  v1.8.1: \n"
              + gei.getNetworkMLElement(UnitConverter.GENESIS_SI_UNITS)
                  .getXMLString("    ", false));

      ArrayList<SimpleXMLEntity> els =
          gei.getNetworkMLEntities(
              UnitConverter.GENESIS_SI_UNITS,
              NeuroMLConstants.NeuroMLVersion.NEUROML_VERSION_2_ALPHA,
              null);

      System.out.println("----  v2.0 alpha: ");
      for (SimpleXMLEntity el : els) System.out.println(el.getXMLString("    ", false));

      els =
          gei.getNetworkMLEntities(
              UnitConverter.GENESIS_SI_UNITS,
              NeuroMLConstants.NeuroMLVersion.getLatestVersion(),
              null);

      System.out.println("----  v2.0 beta: ");
      for (SimpleXMLEntity el : els) System.out.println(el.getXMLString("    ", false));

      System.out.println("-------------- ");

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Esempio n. 2
0
  public static void main(String args[]) {

    try {

      logger.logComment("Sys prop: " + System.getProperty("java.library.path"), true);

      // File projFile = new File("../copyNcModels/NewGranCellLayer/NewGranCellLayer.neuro.xml");

      // File projFile = new File("../nC_projects/Bignet/Bignet.neuro.xml");
      File projFile = new File("testProjects/TestNetworkML/TestNetworkML.neuro.xml");

      // Project testProj = Project.loadProject(new File("projects/Parall/Parall.neuro.xml"),null);
      // Project testProj = Project.loadProject(new
      // File("examples/Ex5-Networks/Ex5-Networks.neuro.xml"),null);
      Project testProj = Project.loadProject(projFile, null);

      // File h5File = new File(projFile.getParentFile().getAbsolutePath()+
      // "/savedNetworks/hhh.h5");
      // File h5File = new File(projFile.getParentFile().getAbsolutePath()+
      // "/savedNetworks/nnnn.h5");

      File h5File = new File("testProjects/TestNetworkML/savedNetworks/small.h5");

      // logger.logComment("Loading netml cell from "+ h5File.getAbsolutePath(), true);

      NetworkMLReader nmlReader = new NetworkMLReader(testProj);

      nmlReader.parse(h5File);

      logger.logComment("Contents: " + testProj.generatedCellPositions);
      logger.logComment("Net conns: " + testProj.generatedNetworkConnections);
      logger.logComment("Inputs: " + testProj.generatedElecInputs.details(false));

    } catch (Exception e) {
      e.printStackTrace();
      System.exit(0);
    }
  }