Package jmt.gui.common.definitions

Examples of jmt.gui.common.definitions.StoredResultsModel$Measure


    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
View Full Code Here


  /**
   * create default measure
   */
  private void createDefaultMeasure() {
    setMeiNode(new Measure());
  }
View Full Code Here

            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof MeasureForm) {
      MeasureForm measureForm = (MeasureForm) childForm;
      Measure measureNode = (Measure) measureForm.getMeiNode();
      measureNode.getAnnotsAndSlursAndTupletSpen().clear();
      for (BasicElement measureChildForm : measureForm.getChildren()) {
        measureNode.getAnnotsAndSlursAndTupletSpen().add(
            handleScoreChild(measureChildForm, saveAllVariants));
      }
      return measureNode;
    } else if (childForm instanceof StaffForm) {
      StaffForm contentForm = (StaffForm) childForm;
View Full Code Here

        if (model.isParametricAnalysisEnabled()) {
          PAResultsModel results = new PAResultsModel(model, true);
          XMLResultsReader.parseXML(getResultsFromArchiveDocument(doc), results);
          model.setSimulationResults(results);
        } else {
          StoredResultsModel results = new StoredResultsModel();
          XMLResultsReader.parseXML(getResultsFromArchiveDocument(doc), results);
          model.setSimulationResults(results);
        }
      }
    }
View Full Code Here

      start();
  }*/

  @Override
  public void run() {
    StoredResultsModel results = null;
    File simulationFile = null;
    ParametricAnalysisDefinition pad = simd.getParametricAnalysisModel();
    pad.createValuesSet();
    PAResultsModel parametricAnalysisResultsModel = new PAResultsModel((CommonModel) simd);
    for (currentStep = 0; currentStep < pad.getNumberOfSteps(); currentStep++) {
      progressWindow.setStepNumber(currentStep + 1);
      pad.changeModel(currentStep);
      try {
        simulationFile = File.createTempFile("~JModelSimulation", ".xml");
        simulationFile.deleteOnExit();
      } catch (Exception e) {
        JOptionPane.showMessageDialog(null, "File exception", "Error", JOptionPane.ERROR_MESSAGE);
      }
      simulationFile.deleteOnExit();
      XMLWriter.writeXML(simulationFile, (CommonModel) simd);
      simulator = new Dispatcher_jSIMschema(simulationFile);
      if (simd.getMaximumDuration().longValue() > 0) {
        timer = new PATimerThread(simulator, simd.getMaximumDuration().doubleValue());
        timer.start();
      }
      try {
        simulator.solveModel();
      } catch (OutOfMemoryError err) {
        simulator.abortAllMeasures();
        simulator.killSimulation();
        progressWindow.stop();
        progressWindow.dispose();
        gui.showErrorMessage("Out of memory error. Try to run Java Virtual Machine with more heap size (-Xmx<num>m)");
        break;
      } catch (Exception ex) {
        simulator.abortAllMeasures();
        simulator.killSimulation();
        gui.handleException(ex);
        break;
      }
      File output = simulator.getSimulation().getOutputFile();
      output.deleteOnExit();
      Document doc = XMLReader.loadXML(output.getAbsolutePath());
      results = new StoredResultsModel();
      XMLResultsReader.parseXML(doc, results);
      for (int i = 0; i < results.getMeasureNumber(); i++) {
        Vector thisMes = results.getValues(i);
        int measureState = results.getMeasureState(i);
        Object value = thisMes.get(0);
        boolean valid;
        valid = measureState == MeasureDefinition.MEASURE_SUCCESS;
        //valueSet[i].add(value);
        //validityMap[i].add(Boolean.valueOf(valid));
View Full Code Here

    File file = dialog.getSelectedFile();

    try {
      if (defaultFilter == JMODEL || defaultFilter == JSIM) {
        StoredResultsModel srm;
        // Handles loading of JSIM/JMODEL models
        switch (getXmlFileType(file.getAbsolutePath())) {
          case XML_SIM:
            XMLReader.loadModel(file, (CommonModel) modelData);
            fileFormat = CommonConstants.SIMENGINE;
            break;
          case XML_ARCHIVE:
            XMLArchiver.loadModel((CommonModel) modelData, file);
            fileFormat = CommonConstants.JSIM;
            break;
          case XML_MVA:
            ExactModel tmp = new ExactModel();
            tmp.loadDocument(xmlutils.loadXML(file));
            warnings.addAll(ModelConverter.convertJMVAtoJSIM(tmp, (CommonModel) modelData));
            fileFormat = CommonConstants.JMVA;
            break;
          case XML_JABA:
            //TODO implement bridge JABA --> JSIM
            failureMotivation = FAIL_CONVERSION + "JABA.";
            fileFormat = CommonConstants.JABA;
            return FAILURE;
          case XML_RES_SIM:
            srm = new StoredResultsModel();
            XMLResultsReader.loadModel(srm, file);
            ((CommonModel) modelData).setSimulationResults(srm);
            warnings.add("Loaded file contained simulation results only. Associated queuing network model is not available. "
                + "Results can be shown by selecting \"Show Results\" icon.");
            fileFormat = CommonConstants.SIMENGINE;
            break;
          case XML_RES_GUI:
            srm = new StoredResultsModel();
            XMLResultsReader.loadGuiModel(srm, file);
            ((CommonModel) modelData).setSimulationResults(srm);
            warnings.add("Loaded file contained simulation results only. Associated queuing network model is not available. "
                + "Results can be shown by selecting \"Show Results\" icon.");
            fileFormat = CommonConstants.SIMENGINE;
View Full Code Here

  public static void main(String[] args) throws Exception {
    Dispatcher_jSIMschema simulator = new Dispatcher_jSIMschema("" + path + filename);
    simulator.solveModel();
    String resfilename = path + "res_sim_" + filename + ".xml";
    StoredResultsModel srm = new StoredResultsModel();
    XMLResultsReader.parseXML(XMLReader.loadXML(resfilename), srm);
    ResultsWindow res = new ResultsWindow(srm);
    res.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    res.show();
  }
View Full Code Here

TOP

Related Classes of jmt.gui.common.definitions.StoredResultsModel$Measure

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.