Package jmt.engine.simEngine

Examples of jmt.engine.simEngine.SimLoader$XMLParser$JmtNodeList


      final Nifty nifty) throws Exception {
    try {
      long start = timeProvider.getMsTime();
      log.info("loading new nifty xml file with schemaId [" + schemaId + "]");

      XmlParser parser = new XmlParser(new MXParser());
      parser.read(inputStreamXml);

      NiftyType niftyType = (NiftyType) getSchema(schemaId).loadXml(parser);
      niftyType.loadStyles(this, nifty);
      niftyType.loadControls(this);
View Full Code Here


      final String styleFilename,
      final NiftyType niftyType,
      final Nifty nifty) throws Exception {
    log.info("loading new nifty style xml file [" + styleFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(styleFilename);
    try {
      parser.read(stream);
      NiftyStylesType niftyStylesType = (NiftyStylesType) getSchema(schemaId).loadXml(parser);
      niftyStylesType.loadStyles(this, niftyType, nifty, log);
    } finally {
      stream.close();
    }
View Full Code Here

      final String schemaId,
      final String controlFilename,
      final NiftyType niftyType) throws Exception {
    log.info("loading new nifty controls xml file [" + controlFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(controlFilename);
    try {
      parser.read(stream);
      NiftyControlsType niftyControlsType = (NiftyControlsType) getSchema(schemaId).loadXml(parser);
      niftyControlsType.loadControls(this, niftyType);
    } finally {
      stream.close();
    }
View Full Code Here

  }

  public void registerSchema(final String schemaId, final InputStream inputStreamSchema) throws Exception {
    try {
      Schema niftyXmlSchema = new Schema();
      XmlParser parser = new XmlParser(new MXParser());
      parser.read(inputStreamSchema);
      parser.nextTag();
      parser.required("nxs", niftyXmlSchema);
      schemes.put(schemaId, niftyXmlSchema);
    } finally {
      inputStreamSchema.close();
    }
  }
View Full Code Here

      final XmlParser xmlParser,
      final Attributes attributes) throws Exception {
    String filename = attributes.get("filename");

    Schema niftyXmlSchema = new Schema();
    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(filename);
    try {
      parser.read(stream);
      parser.nextTag();
      parser.required("nxs", niftyXmlSchema);

      types.putAll(niftyXmlSchema.getTypes());
      xmlParser.nextTag();
    } finally {
      stream.close();
View Full Code Here

    long start, stop, elapsed;

    try {
      //File model = new File(path);
      //FileInputStream is = new FileInputStream(model);
      SimLoader loader = new SimLoader(path);
      Simulation sim = loader.getSim();
      sim.initialize();

      start = System.currentTimeMillis();
      sim.run();
      stop = System.currentTimeMillis();
View Full Code Here

    long start, stop, elapsed;

    try {
      //File model = new File(path);
      //FileInputStream is = new FileInputStream(model);
      SimLoader loader = new SimLoader(path);
      Simulation sim = loader.getSim();

      //TODO: fixed seed
      sim.setRandomEngineSeed(seed);

      sim.initialize();
View Full Code Here

    //String path = "D://JMTtest//sim_jsim_randomModel_open_1.xml";

    try {
      //File model = new File(path);
      //FileInputStream is = new FileInputStream(model);
      SimLoader loader = new SimLoader(path);
      Simulation sim = loader.getSim();
      sim.initialize();
      start = System.currentTimeMillis();
      sim.run();
      stop = System.currentTimeMillis();
      elapsed = stop - start;
View Full Code Here

  public static void test2() {

    try {

      SimLoader loader = new SimLoader("D://sim_test_2open.xml");
      Simulation sim = loader.getSim();
      sim.initialize();
      sim.run();
      double elapsed = NetSystem.getElapsedTime();
      System.out.println(elapsed);
View Full Code Here

    for (int i = 0; i < N; i++) {

      try {

        SimLoader loader = new SimLoader("D://sim_prova.xml");
        Simulation sim = loader.getSim();
        sim.initialize();
        start = System.currentTimeMillis();

        sim.run();
View Full Code Here

TOP

Related Classes of jmt.engine.simEngine.SimLoader$XMLParser$JmtNodeList

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.