Examples of Messager


Examples of edu.isi.karma.cleaning.Messager

          xHashMap.put(index + "", line);
          index++;
        }
        DataPreProcessor dpp = new DataPreProcessor(vtmp);
        dpp.run();
        Messager msger = new Messager();
        Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
        if (entries.size() <= 1)
          return Double.MAX_VALUE;
        ExampleSelection expsel = new ExampleSelection();
        ExampleSelection.firsttime = true;
        expsel.inite(xHashMap, null);
        int target = Integer.parseInt(expsel.Choose());
        String[] mt = { "<_START>" + entries.get(target)[0] + "<_END>",
            entries.get(target)[1] };
        examples.add(mt);
        ExampleSelection.firsttime = false;
        // accuracy record code
        ArrayList<double[]> accArrayList = new ArrayList<double[]>();
        long stime = System.currentTimeMillis();
        boolean overtime = true;
        while (true) // repeat as no incorrect answer appears.
        {
          if (examples.size() == 4) {
            System.out.println("Hello World");
          }
          if (System.currentTimeMillis() - stime > 600000) {
            overtime = false;
            break;
          }
          long checknumber = 1;
          long iterAfterNoFatalError = 0;
          long isvisible = 0;
          HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
          Vector<String> resultString = new Vector<String>();
          xHashMap = new HashMap<String, String[]>();
          ProgSynthesis psProgSynthesis = new ProgSynthesis();
          HashMap<String, String> unlabeledData = new HashMap<String, String>();
          for (int i = 0; i < vtmp.size(); i++) {
            unlabeledData.put("" + i, vtmp.get(i));
          }
          psProgSynthesis.inite(examples, dpp, msger);
          Vector<ProgramRule> pls = new Vector<ProgramRule>();
          Collection<ProgramRule> ps = psProgSynthesis.run_main();
          // collect history contraints
          msger.updateCM_Constr(psProgSynthesis.partiCluster
              .getConstraints());
          msger.updateWeights(psProgSynthesis.partiCluster.weights);
          // constraints.addAll();
          if (ps != null) {
            pls.addAll(ps);
          } else {
            System.out.println("Cannot find any rule");
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

      xHashMap.put(index + "", line);
      index++;
    }
    DataPreProcessor dpp = new DataPreProcessor(vtmp);
    dpp.run();
    Messager msger = new Messager();
    Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
    ArrayList<double[]> accArrayList = new ArrayList<double[]>();
    int i = 0;
    while (i<exps.size()) // repeat as no incorrect answer appears.
    {
      String[] tmt = { "<_START>" + exps.get(i)[0] + "<_END>", exps.get(i)[1] };
      examples.add(tmt);
      xHashMap = new HashMap<String, String[]>();
      ProgSynthesis psProgSynthesis = new ProgSynthesis();
      psProgSynthesis.inite(examples, dpp, msger);
      Vector<ProgramRule> pls = new Vector<ProgramRule>();
      long t1 = System.currentTimeMillis();
      Collection<ProgramRule> ps = psProgSynthesis.run_main();
      long span = System.currentTimeMillis()-t1;
      timeres += span+",";
      // collect history contraints
      msger.updateCM_Constr(psProgSynthesis.partiCluster.getConstraints());
      msger.updateWeights(psProgSynthesis.partiCluster.weights);
      i++;
      // constraints.addAll();
      if (ps != null) {
        pls.addAll(ps);
        System.out.println("program: "+ps);
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

      xHashMap.put(index + "", line);
      index++;
    }
    DataPreProcessor dpp = new DataPreProcessor(vtmp);
    dpp.run();
    Messager msger = new Messager();
    Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
    ArrayList<double[]> accArrayList = new ArrayList<double[]>();
    int i = 0;
    while (i<exps.size()) // repeat as no incorrect answer appears.
    {
      String[] tmt = { "<_START>" + exps.get(i)[0] + "<_END>", exps.get(i)[1] };
      examples.add(tmt);
      xHashMap = new HashMap<String, String[]>();
      ProgSynthesis psProgSynthesis = new ProgSynthesis();
      psProgSynthesis.inite(examples, dpp, msger);
      Vector<ProgramRule> pls = new Vector<ProgramRule>();
      long t1 = System.currentTimeMillis();
      Collection<ProgramRule> ps = psProgSynthesis.adaptive_main();
      long span = System.currentTimeMillis()-t1;
      timeres += span+",";
      // collect history contraints
      msger.updateCM_Constr(psProgSynthesis.partiCluster.getConstraints());
      msger.updateWeights(psProgSynthesis.partiCluster.weights);
      i++;
      // constraints.addAll();
      if (ps != null) {
        pls.addAll(ps);
        System.out.println("program: "+ps);
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

            xHashMap.put(index + "", line);
            index++;
          }
          DataPreProcessor dpp = new DataPreProcessor(vtmp);
          dpp.run();
          Messager msger = new Messager();
          Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
          if (entries.size() <= 1)
            continue;
          ExampleSelection expsel = new ExampleSelection();
          ExampleSelection.firsttime = true;
          expsel.inite(xHashMap, null);
          int target = Integer.parseInt(expsel.Choose());
          String[] mt = {
              "<_START>" + entries.get(target)[0] + "<_END>",
              entries.get(target)[1] };
          examples.add(mt);
          ExampleSelection.firsttime = false;
          // accuracy record code
          ArrayList<double[]> accArrayList = new ArrayList<double[]>();

          while (true) // repeat as no incorrect answer appears.
          {
            long checknumber = 1;
            long iterAfterNoFatalError = 0;
            HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
            Vector<String> resultString = new Vector<String>();
            xHashMap = new HashMap<String, String[]>();
            ProgSynthesis psProgSynthesis = new ProgSynthesis();
            HashMap<String, String> unlabeledData = new HashMap<String, String>();
            for (int i = 0; i < vtmp.size(); i++) {
              unlabeledData.put("" + i, vtmp.get(i));
            }
            psProgSynthesis.inite(examples, dpp, msger);
            Vector<ProgramRule> pls = new Vector<ProgramRule>();
            Collection<ProgramRule> ps = psProgSynthesis
                .adaptive_main();
            // collect history contraints
            msger.updateCM_Constr(psProgSynthesis.partiCluster
                .getConstraints());
            msger.updateWeights(psProgSynthesis.partiCluster.weights);
            // constraints.addAll();
            if (ps != null) {
              pls.addAll(ps);
            } else {
              System.out.println("Cannot find any rule");
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

            xHashMap.put(index + "", line);
            index++;
          }
          DataPreProcessor dpp = new DataPreProcessor(vtmp);
          dpp.run();
          Messager msger = new Messager();
          Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
          if (entries.size() <= 1)
            continue;
          ExampleSelection expsel = new ExampleSelection();
          ExampleSelection.firsttime = true;
          expsel.inite(xHashMap, null);
          int target = Integer.parseInt(expsel.Choose());
          String[] mt = {
              "<_START>" + entries.get(target)[0] + "<_END>",
              entries.get(target)[1] };
          examples.add(mt);
          ExampleSelection.firsttime = false;
          // accuracy record code
          ArrayList<double[]> accArrayList = new ArrayList<double[]>();
          long stime = System.currentTimeMillis();
          boolean overtime = true;
          while (true) // repeat as no incorrect answer appears.
          {
            if (examples.size() == 8) {
              System.out.println("Hello World");
            }
            if (System.currentTimeMillis() - stime > 600000) {
              overtime = false;
              break;
            }
            long checknumber = 1;
            long iterAfterNoFatalError = 0;
            long isvisible = 0;
            HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
            Vector<String> resultString = new Vector<String>();
            xHashMap = new HashMap<String, String[]>();
            ProgSynthesis psProgSynthesis = new ProgSynthesis();
            HashMap<String, String> unlabeledData = new HashMap<String, String>();
            for (int i = 0; i < vtmp.size(); i++) {
              unlabeledData.put("" + i, vtmp.get(i));
            }
            psProgSynthesis.inite(examples, dpp, msger);
            Vector<ProgramRule> pls = new Vector<ProgramRule>();
            Collection<ProgramRule> ps = psProgSynthesis.run_main();
            // collect history contraints
            msger.updateCM_Constr(psProgSynthesis.partiCluster
                .getConstraints());
            msger.updateWeights(psProgSynthesis.partiCluster.weights);
            // constraints.addAll();
            if (ps != null) {
              pls.addAll(ps);
            } else {
              System.out.println("Cannot find any rule");
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

      DataPreProcessor dpp = (DataPreProcessor) wk.getDpp();
      if(dpp == null)
      {
        dpp = new DataPreProcessor(rows.values());
      }
      Messager msg = (Messager) wk.getMsg();
      if(msg == null)
      {
        msg = new Messager();
      }
      RamblerTransformationOutput rtf = applyRamblerTransformation(rows,dpp,msg);
      if (rtf.getTransformations().keySet().size() <= 0) {
        c.append(WorksheetUpdateFactory
            .createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(workspace)));
View Full Code Here

Examples of edu.isi.karma.cleaning.Messager

      this.compResultString += originalVal + "\n";
      calAmbScore(id, originalVal, amb);
    }
    RamblerValueCollection vc = new RamblerValueCollection(rows);
    HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
    Messager mg = null;
    if(wk.getMsg()!= null)
    {
      mg = (Messager) wk.getMsg();
    }
    else
    {
      mg = new Messager();
      wk.setMsg(mg);
    }
    DataPreProcessor dp = null;
    if(wk.getDpp()!= null)
    {
View Full Code Here

Examples of javax.annotation.processing.Messager

    // ------------------------------------------------------ collect methods

    private void collectData(final RoundEnvironment roundEnv) throws Exception {

        final Messager messager = processingEnv.getMessager();
        final Types typeUtils = processingEnv.getTypeUtils();
        final Elements elementUtils = processingEnv.getElementUtils();

        for (Element e : roundEnv.getElementsAnnotatedWith(Store.class)) {
            TypeElement storeElement = (TypeElement) e;
            PackageElement packageElement = (PackageElement) storeElement.getEnclosingElement();

            final String packageName = packageElement.getQualifiedName().toString();
            final String storeDelegate = storeElement.getSimpleName().toString();
            final boolean changeSupport = typeUtils.isAssignable(storeElement.asType(),
                    elementUtils.getTypeElement(ChangeSupport.class.getName()).asType());
            final String storeClassName = GenerationUtil.storeImplementation(storeDelegate);
            messager.printMessage(NOTE,
                    String.format("Discovered annotated store [%s]", storeElement.getQualifiedName()));

            List<ExecutableElement> processMethods = new ArrayList<>();
            if (findValidProcessMethods(messager, typeUtils, storeElement, processMethods)) {
                Collection<ProcessInfo> processInfos = createProcessInfos(messager, typeUtils, elementUtils,
                        storeElement, processMethods);

                metadata.add(new StoreDelegateMetadata(packageName, storeClassName, storeDelegate, changeSupport,
                        processInfos));
            } else {
                // no valid process methods!
                messager.printMessage(ERROR,
                        String.format("%s does not contain suitable methods annotated with %s.",
                                storeElement.getQualifiedName(), Process.class.getName()));
                break;
            }
        }
View Full Code Here

Examples of javax.annotation.processing.Messager


    // ------------------------------------------------------ generate methods

    private void generateFiles() throws Exception {
        final Messager messager = processingEnv.getMessager();

        // store delegates
        for (StoreDelegateMetadata md : metadata) {
            try {
                messager.printMessage(NOTE, String.format("Generating code for [%s]", md.storeClassName));
                StoreGenerator generator = new StoreGenerator();
                final StringBuffer code = generator.generate(md);
                writeCode(md.packageName, md.storeClassName, code);

                messager.printMessage(NOTE,
                        String.format("Successfully generated store implementation [%s]", md.storeClassName));
            } catch (GenerationException ge) {
                final String msg = ge.getMessage();
                messager.printMessage(Diagnostic.Kind.ERROR, msg/* , storeElement*/);
            }
        }

        // GraphVIZ
        String graphVizFile = writeGraphViz();
View Full Code Here

Examples of javax.annotation.processing.Messager

        String graphVizFile = writeGraphViz();
        validateDAG(graphVizFile);
    }

    private String writeGraphViz() throws GenerationException, IOException {
        final Messager messager = processingEnv.getMessager();
        GraphVizGenerator generator = new GraphVizGenerator();
        StringBuffer code = generator.generate(graphVizInfos.values());
        messager.printMessage(NOTE,
                "Generating GraphViz file to visualize store dependencies [" + GRAPH_VIZ_OUTPUT + "]");
        FileObject fo = processingEnv.getFiler()
                .createResource(StandardLocation.SOURCE_OUTPUT, "", GRAPH_VIZ_OUTPUT);
        Writer w = fo.openWriter();
        BufferedWriter bw = new BufferedWriter(w);
        bw.append(code);
        bw.close();
        w.close();
        messager.printMessage(NOTE, "Successfully generated GraphViz file [" + GRAPH_VIZ_OUTPUT + "]");
        return fo.getName();
    }
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.