Package jmt.engine.jwat

Examples of jmt.engine.jwat.VariableNumber


        TimeConsumingWorker worker = new TimeConsumingWorker(new ProgressMonitorShow(this, "Constructin Dispersion Matrix...", 1)) {
          @Override
          public Object construct() {
            if (model.getMatrix() != null) {
              Graphics g = chart.getGraphics();
              VariableNumber Elenco[] = model.getMatrix().getVariables();
              try {
                // Pulizia dell'immagine
                g.setColor(Color.WHITE);
                g.fillRect(0, 0, WIDTH_TOT * Elenco.length + 1, HEIGHT_TOT * Elenco.length + 1);

View Full Code Here


          for (int i = 1; i < 9; i++) {
            g1.drawLine(1, 1 + (i * (HEIGHT / 9)), 499, 1 + (i * (HEIGHT / 9)));
            g1.drawLine(1 + (i * (WIDTH / 9)), 1, 1 + (i * (WIDTH / 9)), 499);
          }
          g1.setColor(Color.RED);
          VariableNumber x = model.getMatrix().getVariables()[xVar];
          x.setRangeIntervallo(x.getIndexMin(xMin), x.getIndexMax(xMax), yMin, yMax, yVar);

          try {
            initShow(x.Size());
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          } catch (InvocationTargetException e1) {
            e1.printStackTrace();
          }
          g1.setColor(JavaWatColor.getColor(match));
          int xPos = 0;
          for (int i = 0; i < x.Size(); i++) {
            try {
              xPos = x.getNextInt();
              if (i % getStep() == 0) {
                updateInfos(i, "Plotting obs " + i, false);
              }
              if (c1[x.getObsID(xPos) - 1] == match) {
                g1.fillOval((int) ((x.getValue(xPos) - xMin) / (xMax - xMin) * (WIDTH - 1)), (HEIGHT - 1)
                    - (int) ((x.getValue(xPos, yVar) - yMin) / (yMax - yMin) * (HEIGHT - 1)), pointSize, pointSize);
              }
            } catch (Exception e) {
              break;
            }
          }
          updateInfos(x.Size(), "End", true);
          return null;
        }

        @Override
        public void finished() {
View Full Code Here

    this.setMarksStyle("various", 1);
    this.setConnected(true, 2);
    this.setMarksStyle("point", 2);
    this.setColors(new Color[] { Color.RED, Color.BLUE });

    VariableNumber xvar = model.getMatrix().getVariables()[this.xvar];
    VariableNumber yvar = model.getMatrix().getVariables()[this.yvar];
    int[] qx = xvar.getUniStats().getQuantili();
    int[] qy = yvar.getUniStats().getQuantili();
    double xRange = xvar.getUniStats().getRangeValue() / 100;
    double yRange = yvar.getUniStats().getRangeValue() / 100;
    double xMin = xvar.getUniStats().getMinValue();
    double yMin = yvar.getUniStats().getMinValue();
    setXRange(xvar.getUniStats().getMinValue(), xvar.getUniStats().getMaxValue());
    if (xvar.getType() == JWATConstants.DATE) {
      SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy HH:mm:ss");
      addXTick(f.format(new Date((long) (xMin + xRange / 10))), xMin + xRange / 10);
      addXTick(f.format(new Date((long) (xMin + (xRange * 100) / 2))), xMin + (xRange * 100) / 2);
      addXTick(f.format(new Date((long) (xMin + (xRange * 99)))), xMin + (xRange * 99));
    } else {
      setXLabel("Quantiles of " + xvar.getName());
    }
    setYRange(yvar.getUniStats().getMinValue(), yvar.getUniStats().getMaxValue());
    if (yvar.getType() == JWATConstants.DATE) {
      SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy HH:mm:ss");
      addYTick(f.format(new Date((long) (yMin + yRange / 10))), yMin + yRange / 10);
      addYTick(f.format(new Date((long) (yMin + (yRange * 100) / 2))), yMin + (yRange * 100) / 2);
      addYTick(f.format(new Date((long) (yMin + (yRange * 99)))), yMin + (yRange * 99));
    } else {
      setYLabel("Quantiles of " + yvar.getName());
    }
    for (int i = 0; i < qx.length; i++) {
      addPoint(1, xvar.getValue(qx[i]), yvar.getValue(qy[i]), true);
      addPoint(2, xMin + (xRange * i), yMin + (yRange * i), true);
    }
    fillPlot();
  }
View Full Code Here

          for (int i = 1; i < 9; i++) {
            g1.drawLine(1, 1 + (i * (HEIGHT / 9)), 499, 1 + (i * (HEIGHT / 9)));
            g1.drawLine(1 + (i * (WIDTH / 9)), 1, 1 + (i * (WIDTH / 9)), 499);
          }
          g1.setColor(Color.RED);
          VariableNumber x = model.getMatrix().getVariables()[xVar];
          x.setRangeIntervallo(x.getIndexMin(xMin), x.getIndexMax(xMax), yMin, yMax, yVar);

          try {
            initShow(x.Size());
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          } catch (InvocationTargetException e1) {
            e1.printStackTrace();
          }

          int xPos = 0;
          for (int i = 0; i < x.Size(); i++) {
            try {
              xPos = x.getNextInt();
              if (i % getStep() == 0) {
                updateInfos(i, "Plotting obs " + i, false);
              }
              g1.setColor(JavaWatColor.getColor(c1[x.getObsID(xPos) - 1]));
              g1.fillOval((int) ((x.getValue(xPos) - xMin) / (xMax - xMin) * (WIDTH - 1)), (HEIGHT - 1)
                  - (int) ((x.getValue(xPos, yVar) - yMin) / (yMax - yMin) * (HEIGHT - 1)), pointSize, pointSize);
            } catch (Exception e) {
              break;
            }
          }
          updateInfos(x.Size(), "End", true);
          return null;
        }

        @Override
        public void finished() {
View Full Code Here

        grap.drawImage(chart, 0, 0, null);
        TimeConsumingWorker worker = new TimeConsumingWorker(new ProgressMonitorShow(this, "Constructin Dispersion Matrix...", 1)) {
          @Override
          public Object construct() {
            Graphics g = chart.getGraphics();
            VariableNumber Elenco[] = model.getMatrix().getVariables();
            try {
              if (fuzzyN != -1) {
                // Pulizia dell'immagine
                g.setColor(Color.WHITE);
                g.fillRect(0, 0, WIDTH_TOT * Elenco.length + 1, HEIGHT_TOT * Elenco.length + 1);
View Full Code Here

      double var = model.getMatrix().getVariables()[x].getUniStats().getVariance();
      //Draw reference line
      g.setColor(Color.RED);
      g.drawLine(1, 121, 201, 1);
      if (distribution == NORMAL) {
        VariableNumber xvar = model.getMatrix().getVariables()[x];
        double xrange = xvar.getUniStats().getRangeValue();
        double yrange = ((normale[normale.length - 1] * var) + mean) - ((normale[0] * var) + mean);
        int[] qx = xvar.getUniStats().getQuantili();
        double xmin = xvar.getUniStats().getMinValue();
        double ymax = ((normale[normale.length - 1] * var) + mean);
        g.setColor(Color.BLUE);
        for (int i = 0; i < qx.length; i++) {
          g.fillOval((int) (1 + ((xvar.getValue(qx[i]) - xmin) / xrange) * 200),
              (int) (1 + ((ymax - ((normale[i] * var) + mean)) / yrange) * 120), 1, 1);
        }
      }
      if (distribution == EXPO) {
        VariableNumber xvar = model.getMatrix().getVariables()[x];
        double xrange = xvar.getUniStats().getRangeValue();
        double yrange = (-Math.log(0.01) * mean) - (-Math.log(1) * mean);
        int[] qx = xvar.getUniStats().getQuantili();
        double xmin = xvar.getUniStats().getMinValue();
        double ymax = (-Math.log(0.01) * mean);
        g.setColor(Color.BLUE);
        for (int i = 0; i < qx.length; i++) {
          g.fillOval((int) (1 + ((xvar.getValue(qx[i]) - xmin) / xrange) * 200),
              (int) (1 + ((ymax - (-Math.log(1 - (0.01 * i)) * mean)) / yrange) * 120), 1, 1);
        }
      }
    }
  }
View Full Code Here

      g1.drawLine(1, 1, WIDTH + 1, 1);
      g1.drawLine(1, HEIGHT + 1, WIDTH + 1, HEIGHT + 1);
      g1.drawLine(WIDTH + 1, 1, WIDTH + 1, HEIGHT + 1);
      if (redraw) {
        Graphics2D g2 = (Graphics2D) graph.getGraphics();
        VariableNumber x = model.getMatrix().getVariables()[xVar.getSelectedIndex()];
        VariableNumber y = model.getMatrix().getVariables()[yVar.getSelectedIndex()];
        int row = yVar.getSelectedIndex();
        short[] c1 = ((KMean) session.getListOfClustering().get(clustering)).getAsseg()[cluster - 1];
        g2.setColor(Color.WHITE);
        g2.fillRect(1, 1, WIDTH - 1, HEIGHT - 1);
        //Calcolo del passo del grafico
        double yFoot = (HEIGHT - 1) / y.getUniStats().getRangeValue();
        for (int i = 1; i <= WIDTH - 1; i++) {
          boolean[] done = new boolean[101];
          int k = 1;
          //System.err.println("STart interval : " + x.getStartInt(i) + " end : " + x.getEndInt(i));
          for (int j = x.getStartInt(i); j < x.getEndInt(i); j++) {
            if ((int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot) >= 0) {
              //System.err.println(x.getValue(j,row) +" " + y.getUniStats().getMinValue() +" " + yFoot);
              if (!done[(int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot)]) {
                if (c1[x.getObsID(j) - 1] == match) {
                  g2.setColor(JavaWatColor.getColor(c1[x.getObsID(j) - 1]));
                  g2.fillOval(i, HEIGHT - ((int) (((x.getValue(j, row) - y.getUniStats().getMinValue())) * yFoot)), 1, 1);
                }
                done[(int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot)] = true;
              }
            }
          }
        }
        redraw = false;
View Full Code Here

      g1.drawLine(1, 1, WIDTH + 1, 1);
      g1.drawLine(1, HEIGHT + 1, WIDTH + 1, HEIGHT + 1);
      g1.drawLine(WIDTH + 1, 1, WIDTH + 1, HEIGHT + 1);
      if (redraw) {
        Graphics2D g2 = (Graphics2D) graph.getGraphics();
        VariableNumber x = model.getMatrix().getVariables()[xVar.getSelectedIndex()];
        VariableNumber y = model.getMatrix().getVariables()[yVar.getSelectedIndex()];
        int row = yVar.getSelectedIndex();
        short[] c1 = ((ClusteringInfosFuzzy) ((FuzzyKMean) session.getListOfClustering().get(clustering)).getClusteringInfos(cluster - 2))
            .getAssignment();
        g2.setColor(Color.WHITE);
        g2.fillRect(1, 1, WIDTH - 1, HEIGHT - 1);
        //Calcolo del passo del grafico
        double yFoot = (HEIGHT - 1) / y.getUniStats().getRangeValue();
        for (int i = 1; i <= WIDTH - 1; i++) {
          boolean[] done = new boolean[101];
          int k = 1;
          //System.err.println("STart interval : " + x.getStartInt(i) + " end : " + x.getEndInt(i));
          for (int j = x.getStartInt(i); j < x.getEndInt(i); j++) {
            if ((int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot) >= 0) {
              //System.err.println(x.getValue(j,row) +" " + y.getUniStats().getMinValue() +" " + yFoot);
              if (!done[(int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot)]) {
                if (c1[x.getObsID(j) - 1] == match) {
                  g2.setColor(JavaWatColor.getColor(c1[x.getObsID(j) - 1]));
                  g2.fillOval(i, HEIGHT - ((int) (((x.getValue(j, row) - y.getUniStats().getMinValue())) * yFoot)), 1, 1);
                }
                done[(int) ((x.getValue(j, row) - y.getUniStats().getMinValue()) * yFoot)] = true;
              }
            }
          }
        }
        redraw = false;
View Full Code Here

        grap.drawImage(chart, 0, 0, null);
        TimeConsumingWorker worker = new TimeConsumingWorker(new ProgressMonitorShow(this, "Constructin Dispersion Matrix...", 1)) {
          @Override
          public Object construct() {
            Graphics g = chart.getGraphics();
            VariableNumber Elenco[] = model.getMatrix().getVariables();
            try {
              // Pulizia dell'immagine
              g.setColor(Color.WHITE);
              g.fillRect(0, 0, WIDTH_TOT * Elenco.length + 1, HEIGHT_TOT * Elenco.length + 1);

View Full Code Here

          for (int i = 1; i < 9; i++) {
            g1.drawLine(1, 1 + (i * (HEIGHT / 9)), 499, 1 + (i * (HEIGHT / 9)));
            g1.drawLine(1 + (i * (WIDTH / 9)), 1, 1 + (i * (WIDTH / 9)), 499);
          }
          g1.setColor(Color.RED);
          VariableNumber x = model.getMatrix().getVariables()[xVar];
          x.setRangeIntervallo(x.getIndexMin(xMin), x.getIndexMax(xMax), yMin, yMax, yVar);

          try {
            initShow(x.Size());
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          } catch (InvocationTargetException e1) {
            e1.printStackTrace();
          }

          int xPos = 0;
          for (int i = 0; i < x.Size(); i++) {
            try {
              xPos = x.getNextInt();
              if (i % getStep() == 0) {
                updateInfos(i, "Plotting obs " + i, false);
              }
              g1.setColor(JavaWatColor.getColor(c1[curClust][x.getObsID(xPos) - 1]));
              g1.fillOval((int) ((x.getValue(xPos) - xMin) / (xMax - xMin) * (WIDTH - 1)), (HEIGHT - 1)
                  - (int) ((x.getValue(xPos, yVar) - yMin) / (yMax - yMin) * (HEIGHT - 1)), pointSize, pointSize);
            } catch (Exception e) {
              break;
            }
          }
          updateInfos(x.Size(), "End", true);
          return null;
        }

        @Override
        public void finished() {
View Full Code Here

TOP

Related Classes of jmt.engine.jwat.VariableNumber

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.