Ejemplo n.º 1
0
  private synchronized void GenerateIsoMorphismMapping() throws Exception {

    winner.searchWinners(educts, products, mh);

    if (winner.getFlag()) {

      //            System.out.println("**********Updated Mapping**************");
      UpdateMapping();
      //            System.out.println("**********Updated Matrix**************");
      UpdateMatrix(mh, removeHydrogen);
      //            System.out.println("**********Generate Mapping**************");
      GenerateMapping(false);
    }
  }
Ejemplo n.º 2
0
  private synchronized void GenerateMapping(boolean flag) throws Exception {
    boolean ruleMatchingFlag = flag;
    if (DEBUG) {
      //            System.out.println("**********Orignal Matrix**************");
      printMatrixAtomContainer(mh, eductList, productList);
      printSimMatrix(mh, eductList, productList);
      printCliqueMatrix(mh, eductList, productList);
      //            printStereoMatrix(mh, eductList, productList);
      //            printFragmentMatrix(mh, eductList, productList);
      //            printEnergyMatrix(mh, eductList, productList);
    }
    boolean conditionmet = false;
    if (!ruleMatchingFlag) {
      RuleBasedMappingHandler ruleBasedMappingHandler =
          new RuleBasedMappingHandler(mh, eductList, productList);
      if (ruleBasedMappingHandler.isMatchFound()) {
        if (DEBUG) {
          out.println("Rule Based Mapping Handler Match Found");
        }
        mh = Selector.modifyMatrix(ruleBasedMappingHandler.getMatrixHolder());
        conditionmet = true;
      }
      ruleMatchingFlag = true;
    }

    if (!conditionmet) {
      if (DEBUG) {
        out.println("Subgraph/Exact Match Test");
      }
      IsomorphismMin omorphismMin = new IsomorphismMin(mh, eductList, productList);
      if (omorphismMin.isSubAndCompleteMatchFlag()) {
        if (DEBUG) {
          out.println("Subgraph/Exact Match");
        }
        mh = omorphismMin.getUpdatedHolder();
      }
    }
    if (DEBUG) {
      out.println("**********Modified Matrix**************");
      //            printMatrixAtomContainer(mh, eductList, productList);
      printSimMatrix(mh, eductList, productList);
      printCliqueMatrix(mh, eductList, productList);
      //            printStereoMatrix(mh, eductList, productList);
      //            printFragmentMatrix(mh, eductList, productList);
      //            printEnergyMatrix(mh, eductList, productList);
    }
    winner.searchWinners(educts, products, mh);
    if (DEBUG) {
      printFlagMatrix(winner, eductList, productList);
    }
    if (winner.getFlag()) {
      if (DEBUG) {
        out.println("**********Updated Mapping**************");
      }
      UpdateMapping();
      if (DEBUG) {
        out.println("**********Updated Matrix**************");
      }
      UpdateMatrix(mh, removeHydrogen);
      if (DEBUG) {
        out.println("**********Generate Mapping**************");
      }
      GenerateMapping(ruleMatchingFlag);
    }
  }