Examples of ParametricAnalysisChecker


Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

      if (code != 0) {
        if (code == 1) {
          warnings[PARAMETRIC_ANALYSIS_MODEL_MODIFIED_WARNING] = true;
        }
        if (code == 2) {
          ParametricAnalysisChecker pac = new ParametricAnalysisChecker(class_def, station_def, simulation_def);
          if (pac.canBeEnabled()) {
            //        String[] avaible = pac.getRunnableParametricAnalysis();
            //        ParametricAnalysisDefinition newPAD = ParametricAnalysisModelFactory.createParametricAnalysisModel(avaible[0],class_def,station_def,simulation_def);
            //        simulation_def.setParametricAnalysisModel(newPAD);
            warnings[PARAMETRIC_ANALYSIS_MODEL_MODIFIED_WARNING] = true;
          }
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

  /**
   * Checks if PA is no more avaible, but a PA model was previously defined.
   */
  private void checkForParametricAnalysisNoMoreAvaibleWarning() {
    ParametricAnalysisChecker pac = new ParametricAnalysisChecker(class_def, station_def, simulation_def);
    if ((simulation_def.isParametricAnalysisEnabled()) && (!pac.canBeEnabled())) {
      warnings[PARAMETRIC_ANALYSIS_NO_MORE_AVAIBLE_WARNING] = true;
    }
  }
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

            JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
        //if user chooses ok..
        if (choice == 0) {
          //if the old PAModel could not be corrected..
          if (result == 2) {
            ParametricAnalysisChecker checker = new ParametricAnalysisChecker(model, model, model);
            //if there are no PA simulation avaible, disable parametric analysis
            //and return
            if (!checker.canBeEnabled()) {
              parametric = doc.createElement(XML_E_PARAMETRIC);
              parametric.setAttribute(XML_A_PARAMETRIC_ENABLED, "false");
              return;
            }
            //else set the first avaible
            else {
              String avaibleModel = checker.getRunnableParametricAnalysis()[0];
              pad = ParametricAnalysisModelFactory.createParametricAnalysisModel(avaibleModel, model, model, model);
            }
          }
          //else the PAModel can be corrected, so correct it
          else {
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

        + "The 'To' value represents the final mean value of service time distribution.";

    cd = classDef;
    sd = stationDef;
    simd = simDef;
    checker = new ParametricAnalysisChecker(cd, sd, simd);
    initialize();
  }
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

    allClass.setSelected(true);
    radioButtonsPanel.add(allClass);
    radioButtonsPanel.add(singleClass);
    radioButtonsPanel.setBorder(new EmptyBorder(5, 20, 0, 20));
    JPanel edit = new JPanel(new GridLayout(5, 1, 0, 5));
    ParametricAnalysisChecker checker = new ParametricAnalysisChecker(cd, sd, simd);
    Vector<Object> avaibleS = checker.checkForServiceTimesParametricAnalysisAvaibleStations();
    String[] stationNames = new String[avaibleS.size()];
    for (int i = 0; i < avaibleS.size(); i++) {
      stationNames[i] = sd.getStationName(avaibleS.get(i));
    }
    classChooserLabel = new JLabel("Class:");
    classChooser = new JComboBox();
    classChooser.setToolTipText("Choose the class whose service time mean value inside the selected station will change");
    stationChooser = new JComboBox(stationNames);
    stationChooser.setToolTipText("Choose the station whose service time mean value will be change");
    description = new JTextArea();
    description.setOpaque(false);
    description.setEditable(false);
    description.setLineWrap(true);
    description.setWrapStyleWord(true);
    descrPane = new JScrollPane(description);
    descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
    descrPane.setBorder(descriptionTitle);
    descrPane.setMinimumSize(new Dimension(80, 0));
    //if the reference station of the STPA is still avaible
    if (avaibleS.contains(STPA.getReferenceStation())) {
      stationChooser.setSelectedItem(sd.getStationName(STPA.getReferenceStation()));
    }
    //else select another one
    else {
      STPA.setReferenceStation(avaibleS.get(0));
      stationChooser.setSelectedIndex(0);
    }
    if (STPA.isSingleClass()) {
      fromLabel = new JLabel("From (s):");
      from = new JTextField();
      from.setEnabled(false);
      from.setText(Double.toString(STPA.getInitialValue()));
      toLabel = new JLabel("To (s):");
      to = new JSpinner(new SpinnerNumberModel(STPA.getFinalValue(), 0.001, Double.MAX_VALUE, 0.001));
      to.setToolTipText("Sets the final service time mean value expressed in seconds");
      stepsLabel = new JLabel("Steps (n. of exec.): ");
      steps = new JSpinner(new SpinnerNumberModel(STPA.getNumberOfSteps(), 2, ParametricAnalysis.MAX_STEP_NUMBER, 1));
      steps.setToolTipText("Sets the number of steps to be performed");
      //get the vector containing the keys of the class that can be used to do this type of parametric analysis
      Vector<Object> validC = checker.checkForServiceTimesParametricSimulationAvaibleClasses(STPA.getReferenceStation());
      String[] classeNames = new String[validC.size()];
      for (int i = 0; i < validC.size(); i++) {
        classeNames[i] = cd.getClassName(validC.get(i));
      }
      classChooser.removeAllItems();
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

    upperPanel.add(northPanel, BorderLayout.NORTH);
    upperPanel.add(chooserPanel, BorderLayout.SOUTH);
    this.setLayout(new BorderLayout());
    this.setBorder(new EmptyBorder(20, 20, 20, 20));
    chooser.removeAllItems();
    ParametricAnalysisChecker pac = new ParametricAnalysisChecker(cd, sd, simd);
    if (!pac.canBeEnabled()) {
      enabler.setEnabled(false);
      parameterOptionPanel = createPanel(null);
      simd.setParametricAnalysisModel(null);
      simd.setParametricAnalysisEnabled(false);
    } else {
      enabler.setEnabled(true);
      enabler.setSelected(simd.isParametricAnalysisEnabled());
      ParametricAnalysisDefinition pad = simd.getParametricAnalysisModel();
      parameters = pac.getRunnableParametricAnalysis();
      for (String parameter : parameters) {
        chooser.addItem(parameter);
      }
      String temp = parameters[0];
      if (pad == null) {
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

    super.setDividerSize(3);

    DESCRIPTION = "Repeat the simulations changing only the seed of the random number " + "generator.\n\n"
        + "The seeds used for the repeated simulations are randomly"
        + " generated, starting from the seed specified in the 'Simulation Parameters' panel.";
    checker = new ParametricAnalysisChecker(cd, sd, simd);
    cd = classDef;
    sd = stationDef;
    simd = simDef;
    initialize();
  }
View Full Code Here

Examples of jmt.gui.common.definitions.parametric.ParametricAnalysisChecker

        + "The 'To' value is the final arrival rate.\n\n ";

    cd = classDef;
    sd = stationDef;
    simd = simDef;
    checker = new ParametricAnalysisChecker(cd, sd, simd);
    initialize();
  }
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.