Package jmt.gui.exact

Examples of jmt.gui.exact.ExactModel


  /**
   * gets status from data object
   */
  public void sync() {
    /* arrays are copied to ensure data object consistency is preserved */
    ExactModel data = ew.getData();
    synchronized (data) {
      zeroLD = (data.isLd() && (data.getMaxpop() == 0));
      classes = data.getClasses();
      stations = data.getStations();

      classNames = data.getClassNames();
      stationNames = data.getStationNames();
      stationTypes = data.getStationTypes();

      serviceTimes = ArrayUtils.copy3(data.getServiceTimes());
    }
  }
View Full Code Here


  private void commit() {

    stTable.stopEditing();

    ExactModel data = ew.getData();
    synchronized (data) {
      if (data.setServiceTimes(serviceTimes)) {
        data.recalculateWhatifValues();
      }
    }
  }
View Full Code Here

   */
  private void initApproximation() {
    // Multiserver approximation
    if (inputModel.isMultipleServers() && !inputModel.isOpen()) {
      multipleServerApproximated = true;
      outputModel = new ExactModel(inputModel);
      // Finds multi-server stations (will be replaced with station + delay)
      multipleServerList = new int[inputModel.getStations()];
      int multipleCount = 0;
      for (int i = 0; i < multipleServerList.length; i++) {
        if (inputModel.getStationServers()[i] > 1 && inputModel.getStationTypes()[i] != ExactConstants.STATION_DELAY) {
View Full Code Here

  private static final boolean DEBUG = true;
 
  private ExactModel model;
 
  public boolean loadModel(File xmlFile) throws SolverException {
    model = new ExactModel();
    try {
      XMLUtils xmlUtils = new XMLUtils();
      if (!model.loadDocument(xmlUtils.loadXML(xmlFile))) {
        fail("Error loading model from tempfile", null);
      }
View Full Code Here

          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
View Full Code Here

  /**
   * Solves the model in file.
   * @throws jmt.common.exception.SolverException if there were errors operation was not successful
   */
  public void solve(File file) throws SolverException, InputDataException {
    ExactModel model = new ExactModel();
    try {
      if (!model.loadDocument(xmlUtils.loadXML(file))) {
        fail("Error loading model from tempfile", null);
      }
    } catch (SAXException e) {
      fail("XML parse error in tempfile", e);
    } catch (Exception e) {
      fail("Error loading model from tempfile", e);
    }

    if (PRINTMODEL) {
      System.out.println(model);
    }

    solve(model);

    if (PRINTMODEL) {
      System.out.println(model);
    }

    try {
      if (!xmlUtils.saveXML(model.createDocument(), file)) {
        fail("Error saving solved model to tempfile", null);
      }
    } catch (SAXException e) {
      fail("XML parse error in tempfile", e);
    } catch (Exception e) {
View Full Code Here

    }
  }

  public void launchToJMVA() {
    // New Converter by Bertoli Marco
    ExactModel output = new ExactModel();
    List res = ModelConverter.convertJSIMtoJMVA(model, output);
    ExactWizard jmva = new ExactWizard(output);
    // If problems are found, shows warnings
    if (res.size() > 0) {
      new WarningWindow(res, jmva, CommonConstants.JSIM, CommonConstants.JMVA).show();
View Full Code Here

  /**
   * gets status from data object
   */
  private void sync() {
    /* arrays are copied to ensure data object consistency is preserved */
    ExactModel data = ew.getData();
    synchronized (data) {
      classes = data.getClasses();
      stations = data.getStations();

      classNames = data.getClassNames();
      stationNames = data.getStationNames();
      visits = ArrayUtils.copy2(data.getVisits());
      ReferenceStation = ArrayUtils.copy(data.getReferenceStation());
     
    }
  }
View Full Code Here

  private void commit() {

    visitTable.stopEditing();

    ExactModel data = ew.getData();
    synchronized (data) {
      if (data.setVisits(visits)) {
        data.recalculateWhatifValues();
      }
    }
  }
View Full Code Here

    hasDeletes = false;
    classOps.clear();

    /* sync status with data object */
    /* arrays are copied to ensure data object consistency is preserved */
    ExactModel data = ew.getData();
    synchronized (data) {
      classes = data.getClasses();
      isLd = data.isLd();
      classNames = ArrayUtils.copy(data.getClassNames());
      classTypes = ArrayUtils.copy(data.getClassTypes());
      classData = ArrayUtils.copy(data.getClassData());

      //TODO
      //NEW
      //@author Stefano Omini
      if (isLd) {
        //if load dependent is no more supported after class changes
        //remove all load dependent stations
        if (!(data.isClosed() && !data.isMultiClass())) {
          JOptionPane
              .showMessageDialog(
                  this,
                  "<html><center>jMVA allows Load Dependent stations only for single class closed model. <br> Load Dependent stations will be replaced with Load Independent stations.</center></html>",
                  "Warning", JOptionPane.WARNING_MESSAGE);
          data.removeLD();
          isLd = false;
        }
      }
      //end NEW
    }
View Full Code Here

TOP

Related Classes of jmt.gui.exact.ExactModel

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.