Esempio n. 1
0
  /**
   * Merge the models into a single shared model
   *
   * @param initModel the initialization model
   * @param relationModel the relation model
   * @return a new model
   */
  public Model merge(Model initModel, Model relationModel) {
    // merge the relation model into the init model

    initModel.setIdentifiers(relationModel.getIdentifiers());
    initModel.setModelInfo(relationModel.getModelInfo());

    initModel.setExplicitRelations(relationModel.getExplicitRelations());
    initModel.setImplicitRelations(relationModel.getImplicitRelations());

    initModel.setOutputs(relationModel.getOutputs());
    return initModel;
  }
Esempio n. 2
0
  /**
   * Unmerge the model
   *
   * @param model the model
   * @return the unmerged model
   */
  public Model unmerge(Model initModel) {
    final Model model = new Model();

    /*
     * From xMLTree.ml
     */
    model.setName(initModel.getName());

    model.setElements(initModel.getElements());
    model.setEquations(initModel.getEquations());
    model.setWhenClauses(initModel.getWhenClauses());

    return model;
  }