optimize imports
This commit is contained in:
parent
0171629a9a
commit
471ad99190
|
@ -64,6 +64,11 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.4.0.905</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
import model.Line;
|
||||
import model.Point;
|
||||
import model.LineModel;
|
||||
import model.Point;
|
||||
import presenter.Presenter;
|
||||
import presenter.algorithms.advanced.LeastMedianOfSquaresEstimator;
|
||||
import presenter.algorithms.advanced.RepeatedMedianEstimator;
|
||||
|
@ -9,8 +8,8 @@ import presenter.algorithms.advanced.TheilSenEstimator;
|
|||
import presenter.algorithms.naiv.NaivLeastMedianOfSquaresEstimator;
|
||||
import presenter.algorithms.naiv.NaivRepeatedMedianEstimator;
|
||||
import presenter.algorithms.naiv.NaivTheilSenEstimator;
|
||||
import presenter.util.IntersectionComputer;
|
||||
import presenter.generator.DatasetGenerator;
|
||||
import presenter.util.IntersectionComputer;
|
||||
import view.MainFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
|
@ -27,8 +26,17 @@ import java.util.LinkedList;
|
|||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Laden der native Library für OpenCV
|
||||
*/
|
||||
static {
|
||||
nu.pattern.OpenCV.loadShared();
|
||||
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schriftart wird neu gesetzt
|
||||
*
|
||||
* @param f Schriftart
|
||||
*/
|
||||
private static void setUIFont(javax.swing.plaf.FontUIResource f) {
|
||||
|
@ -44,6 +52,7 @@ public class App {
|
|||
|
||||
/**
|
||||
* Das LookAndFeel wird neu gesetzt.
|
||||
*
|
||||
* @param view View Klasse
|
||||
*/
|
||||
private static void setLookAndFeel(JFrame view) {
|
||||
|
@ -101,16 +110,9 @@ public class App {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laden der native Library für OpenCV
|
||||
*/
|
||||
static {
|
||||
nu.pattern.OpenCV.loadShared();
|
||||
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maim Methode
|
||||
*
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -15,6 +15,7 @@ public class Interval {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lower untere Schranke
|
||||
* @param upper obere Schranke
|
||||
*/
|
||||
|
@ -68,6 +69,7 @@ public class Interval {
|
|||
|
||||
/**
|
||||
* Berechnet die Distanz zwischen der oberen und unteren Schranke
|
||||
*
|
||||
* @return Distanz
|
||||
*/
|
||||
public Double getDistance() {
|
||||
|
|
|
@ -25,6 +25,7 @@ public class Line {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
* @param id id
|
||||
|
@ -42,6 +43,7 @@ public class Line {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
*/
|
||||
|
@ -57,6 +59,7 @@ public class Line {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param x1 x-Koordiante des Startpunkts
|
||||
* @param x2 x-Koordinate des Endpunkts
|
||||
* @param y1 y-Koordinate des Startpunkts
|
||||
|
@ -145,6 +148,7 @@ public class Line {
|
|||
|
||||
/**
|
||||
* Setzt die Koordianten des Segments. Aus dem Segment wird eine Gerade berechnet.
|
||||
*
|
||||
* @param x1 x-Koordiante des Startpunkts
|
||||
* @param y1 y-Koordiante des Endpunkts
|
||||
* @param x2 x-Koordinate des Startpunkts
|
||||
|
@ -161,15 +165,12 @@ public class Line {
|
|||
|
||||
/**
|
||||
* Vergleich einzelner Geradern
|
||||
*
|
||||
* @param other zu vergleichende Gerade
|
||||
* @return <code>true</code> falls die Geraden Gleich sind
|
||||
*/
|
||||
public boolean equals(Line other) {
|
||||
if (other.getM() == this.getM() && other.getB() == this.getB()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return other.getM() == this.getM() && other.getB() == this.getB();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ public class LineModel {
|
|||
|
||||
/**
|
||||
* Fügt einen Schnittpunkt zum Modell hinzu
|
||||
*
|
||||
* @param node Schnittpunkt
|
||||
*/
|
||||
public void addNode(Point node) {
|
||||
|
@ -43,6 +44,7 @@ public class LineModel {
|
|||
|
||||
/**
|
||||
* Fügt eine Gerade zu dem Modell hinzu
|
||||
*
|
||||
* @param line Gerade
|
||||
*/
|
||||
public void addLine(Line line) {
|
||||
|
|
|
@ -14,6 +14,7 @@ public class Pair {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param p1 erstes Element des Tupels
|
||||
* @param p2 zweites Element des Tupels
|
||||
*/
|
||||
|
|
|
@ -15,6 +15,7 @@ public class Point implements Comparable<Point> {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param x x-Koordiante
|
||||
* @param y y-Koordiante
|
||||
*/
|
||||
|
@ -25,6 +26,7 @@ public class Point implements Comparable<Point> {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param x x-Koordiante
|
||||
* @param y y-Koordiante
|
||||
* @param id id des Punkts
|
||||
|
@ -80,15 +82,12 @@ public class Point implements Comparable<Point> {
|
|||
|
||||
/**
|
||||
* Vergleich zweier Punkte
|
||||
*
|
||||
* @param other zu vergleichernder Punkt
|
||||
* @return <code>true</code> falls die Punkte gleich sind
|
||||
*/
|
||||
public boolean equals(Point other) {
|
||||
if (other.getX() == this.getX() && other.getY() == this.getY()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return other.getX() == this.getX() && other.getY() == this.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package presenter;
|
||||
|
||||
import model.LineModel;
|
||||
import presenter.util.IntersectionComputer;
|
||||
import presenter.evaluation.EvaluateAlgorithms;
|
||||
import presenter.util.IntersectionComputer;
|
||||
import view.MainFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
|
@ -20,14 +20,15 @@ import java.util.concurrent.Executors;
|
|||
*/
|
||||
public abstract class AbstractPresenter implements Observer {
|
||||
|
||||
private final ExecutorService executor;
|
||||
private LineModel model;
|
||||
private MainFrame view;
|
||||
private EvaluateAlgorithms eval;
|
||||
private final ExecutorService executor;
|
||||
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param model Modell
|
||||
* @param view View
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,6 @@ import view.MainFrame;
|
|||
import javax.swing.table.DefaultTableModel;
|
||||
import java.io.File;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param set Liste der Geraden
|
||||
* @param intersections Liste der Schnittpunkte
|
||||
* @param presenter Presenter (Beobachter)
|
||||
|
@ -61,6 +62,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param set Liste der Geraden
|
||||
* @param intersections Liste der Schnittpunkte
|
||||
*/
|
||||
|
@ -70,7 +72,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
|
||||
/**
|
||||
* Algorithmus zum berechnen des LMS-Schätzers
|
||||
*
|
||||
* <p>
|
||||
* Paper:
|
||||
* Mount, David M, Nathan S Netanyahu, Kathleen Romanik, Ruth Silverman und Angela Y Wu
|
||||
* „A practical approximation algorithm for the LMS line estimator“. 2007
|
||||
|
@ -155,6 +157,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
|
||||
/**
|
||||
* Liefert die Anzahl der Schnittpunkte in einem Intervall
|
||||
*
|
||||
* @param interval Intervall
|
||||
* @return Anzahl der Schnittpunkte
|
||||
*/
|
||||
|
@ -217,6 +220,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
/**
|
||||
* Zu einer vertikalen Gerade werden kMinus Segmente erzeugt und geprüft ob eine bessere Lösung
|
||||
* als SigmaMin vorliegt.
|
||||
*
|
||||
* @param point x-Koordinate zur Konstruktion der vertikalen Gerade
|
||||
*/
|
||||
public void upperBound(double point) {
|
||||
|
@ -248,6 +252,7 @@ public class LeastMedianOfSquaresEstimator extends Observable implements Algorit
|
|||
|
||||
/**
|
||||
* Die Methode prüft ob das übergebene Intervall die untere Schranke einer potenziellen Lösung erfüllt.
|
||||
*
|
||||
* @param pslab übergebene Intervall
|
||||
*/
|
||||
public void lowerBound(Interval pslab) {
|
||||
|
|
|
@ -55,6 +55,7 @@ public class RepeatedMedianEstimator extends Observable implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param set Liste der Geraden
|
||||
* @param presenter Presenter (Beobachter)
|
||||
*/
|
||||
|
@ -83,6 +84,7 @@ public class RepeatedMedianEstimator extends Observable implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param set Liste der Geraden
|
||||
*/
|
||||
public RepeatedMedianEstimator(LinkedList<Line> set) {
|
||||
|
@ -91,7 +93,7 @@ public class RepeatedMedianEstimator extends Observable implements Algorithm {
|
|||
|
||||
/**
|
||||
* Führt den Algortihmus zur Berechnung des RM-Schätzers durch.
|
||||
*
|
||||
* <p>
|
||||
* Paper:
|
||||
* Matousek, Jiri, D. M. Mount und N. S. Netanyahu
|
||||
* „Efficient Randomized Algorithms for the Repeated Median Line Estimator“. 1998
|
||||
|
|
|
@ -5,7 +5,10 @@ import model.Line;
|
|||
import model.Point;
|
||||
import presenter.Presenter;
|
||||
import presenter.algorithms.Algorithm;
|
||||
import presenter.util.*;
|
||||
import presenter.util.BinomialCoeffizient;
|
||||
import presenter.util.FastElementSelector;
|
||||
import presenter.util.IntersectionCounter;
|
||||
import presenter.util.RandomSampler;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -46,6 +49,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param setOfLines Liste der Geraden
|
||||
* @param setOfIntersections Liste der Schnittpunkte
|
||||
* @param presenter Presenter (Beobachter)
|
||||
|
@ -69,6 +73,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param setOfLines Liste der Geraden
|
||||
* @param setOfIntersections Liste der Schnittpunkte
|
||||
*/
|
||||
|
@ -86,7 +91,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
//damit eine initiale Ordnung herscht
|
||||
//Collections.sort(intervalIntersections);
|
||||
|
||||
r = (double) n;
|
||||
r = n;
|
||||
while (true) {
|
||||
if (this.N <= n || (Math.abs(interval.getUpper() - interval.getLower())) < EPSILON) {
|
||||
break;
|
||||
|
@ -113,7 +118,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
interval.setLower(aVariant);
|
||||
interval.setUpper(bVariant);
|
||||
intervalIntersections = getOpenIntervalElements(interval.getLower(), interval.getUpper());
|
||||
N = (double) getOpenIntervalSize(interval.getLower(), interval.getUpper(), intervalIntersections);
|
||||
N = getOpenIntervalSize(interval.getLower(), interval.getUpper(), intervalIntersections);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,7 +167,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
/**
|
||||
* Berechne wieviele von den Schnittpunkten in dem Interval zwischen <code>a</code> und <code>b</code>
|
||||
* enthalten sind.
|
||||
*
|
||||
* <p>
|
||||
* Inspiriert durch:
|
||||
* <url>https://stackoverflow.com/questions/136474/best-way-to-pick-a-random-subset-from-a-collection</url>
|
||||
*
|
||||
|
@ -219,7 +224,7 @@ public class TheilSenEstimator extends Observable implements Algorithm {
|
|||
yCoordinates.add(p.getY());
|
||||
}
|
||||
|
||||
int pseudoIndex = (int) getOpenIntervalSize(NEGATIV_INF, interval.getLower(), setOfIntersections);
|
||||
int pseudoIndex = getOpenIntervalSize(NEGATIV_INF, interval.getLower(), setOfIntersections);
|
||||
m = FastElementSelector.randomizedSelect(resultAbscissas, k - pseudoIndex);
|
||||
|
||||
Set<Double> unique = new LinkedHashSet<>(yCoordinates);
|
||||
|
|
|
@ -24,6 +24,7 @@ public class NaivLeastMedianOfSquaresEstimator implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste des Geraden
|
||||
*/
|
||||
public NaivLeastMedianOfSquaresEstimator(LinkedList<Line> lines) {
|
||||
|
@ -72,6 +73,7 @@ public class NaivLeastMedianOfSquaresEstimator implements Algorithm {
|
|||
|
||||
/**
|
||||
* Berechnet die Gerade mit dem medianen Fehler
|
||||
*
|
||||
* @param a y-Achsenabschnitt
|
||||
* @param b Steigung
|
||||
* @return medianer Fehler
|
||||
|
|
|
@ -27,6 +27,7 @@ public class NaivRepeatedMedianEstimator implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
*/
|
||||
public NaivRepeatedMedianEstimator(LinkedList<Line> lines) {
|
||||
|
@ -97,6 +98,7 @@ public class NaivRepeatedMedianEstimator implements Algorithm {
|
|||
|
||||
/**
|
||||
* Berechnet die Geraden zwischen zwei Punkten im dualen Raum.
|
||||
*
|
||||
* @param startPoint Gerade 1 => Startpunkt mit den Koordianten (m,b)
|
||||
* @param endPoint Gerade 2 => Endpunkt mit den Koordianten (m', b')
|
||||
* @return
|
||||
|
|
|
@ -23,6 +23,7 @@ public class NaivTheilSenEstimator implements Algorithm {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
*/
|
||||
public NaivTheilSenEstimator(LinkedList<Line> lines) {
|
||||
|
|
|
@ -9,9 +9,9 @@ import presenter.algorithms.advanced.TheilSenEstimator;
|
|||
import presenter.algorithms.naiv.NaivLeastMedianOfSquaresEstimator;
|
||||
import presenter.algorithms.naiv.NaivRepeatedMedianEstimator;
|
||||
import presenter.algorithms.naiv.NaivTheilSenEstimator;
|
||||
import presenter.util.IntersectionComputer;
|
||||
import presenter.generator.DatasetGenerator;
|
||||
import presenter.io.DataImporter;
|
||||
import presenter.util.IntersectionComputer;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -143,6 +143,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Evaluation zu den passenden Typ. Bei beendigung wird der Beobachter informiert.
|
||||
*
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void run() {
|
||||
|
@ -315,6 +316,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Die berechneten Ergebnisse werden an den Beobachter übermittelt um dann visualisiert zu werden.
|
||||
*
|
||||
* @param result Ergebnisse
|
||||
* @param col Spalte
|
||||
*/
|
||||
|
@ -333,6 +335,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Die berechneten Ergebnisse werden an den Beobachter übermittelt um dann visualisiert zu werden.
|
||||
*
|
||||
* @param result Ergebnisse
|
||||
*/
|
||||
public void sendTableApproximationData(ArrayList<ArrayList<String>> result) {
|
||||
|
@ -379,6 +382,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
/**
|
||||
* Zur visualisierung der berechneten Geraden wird die Steigung und der y-Achsenabschnitt an den
|
||||
* Beobachter übermittelt.
|
||||
*
|
||||
* @param res Feld mit den Werten für die Steigung und dern y-Achsenabschnitt
|
||||
* @param alg code für welchen Algorithmus sich die Werte beziehen
|
||||
*/
|
||||
|
@ -399,6 +403,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
/**
|
||||
* Zur visualisierung der berechneten Geraden wird die Steigung und der y-Achsenabschnitt an den
|
||||
* Beobachter übermittelt.
|
||||
*
|
||||
* @param res Feld mit den Werten für die Steigung und dern y-Achsenabschnitt (alle)
|
||||
* @param algs codes für welchen Algorithmus sich die Werte beziehen (alle)
|
||||
*/
|
||||
|
@ -418,6 +423,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung des Alg. zum LMS-Schätzer
|
||||
*
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void startLMS() throws InterruptedException {
|
||||
|
@ -434,6 +440,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung des Alg. zum RM-Schätzer
|
||||
*
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void startRM() throws InterruptedException {
|
||||
|
@ -450,6 +457,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung des Alg. zum TS-Schätzer
|
||||
*
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void startTS() throws InterruptedException {
|
||||
|
@ -466,6 +474,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung der skalierungsabbhängigen Maße.
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
|
@ -486,6 +495,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung der Maße die auf dem prozentualen Fehler basieren.
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
|
@ -505,6 +515,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Startet die Berechnung der skalierungsunabbhängigen Maße.
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
|
@ -524,6 +535,7 @@ public class EvaluateAlgorithms extends Observable {
|
|||
|
||||
/**
|
||||
* Damit es bei der Visualisierung trennende Zeilen gibt.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private ArrayList<String> fillPseudoResults() {
|
||||
|
|
|
@ -20,6 +20,7 @@ public class PercentageErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achenabschnitt
|
||||
|
@ -45,6 +46,7 @@ public class PercentageErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Mean Absolute Precentage Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mape() {
|
||||
|
@ -61,6 +63,7 @@ public class PercentageErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Median Absolute Precentage Error:
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mdape() {
|
||||
|
@ -76,6 +79,7 @@ public class PercentageErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Root Mean Square Percentage Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double rmspe() {
|
||||
|
@ -92,6 +96,7 @@ public class PercentageErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Root Median Square Percentage Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double rmdspe() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package presenter.evaluation;
|
||||
|
||||
import model.Line;
|
||||
|
||||
import org.opencv.core.*;
|
||||
import org.opencv.imgcodecs.Imgcodecs;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
@ -32,6 +31,7 @@ public class PictureProcessor extends Observable {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
* @param file Bilddatei
|
||||
*/
|
||||
|
@ -52,6 +52,7 @@ public class PictureProcessor extends Observable {
|
|||
|
||||
/**
|
||||
* Vorverarbeitung des Eingabebilds. Dabei wird auf verschiedene OpenCV Methoden zurückgegriffen.
|
||||
*
|
||||
* @param image Eingabebild
|
||||
* @return Matrix representation des Bilds
|
||||
*/
|
||||
|
@ -93,6 +94,7 @@ public class PictureProcessor extends Observable {
|
|||
|
||||
/**
|
||||
* Das Bild wird passend umgewandelt, um im nächsten Schritt visualisiert werden zu können.
|
||||
*
|
||||
* @param m Matrix representation des Bilds
|
||||
* @return visualisierbares Bild
|
||||
*/
|
||||
|
|
|
@ -19,6 +19,7 @@ public class ScaleDependentMeasure {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste des Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
|
@ -39,6 +40,7 @@ public class ScaleDependentMeasure {
|
|||
|
||||
/**
|
||||
* Mean Square Error:
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mse() {
|
||||
|
@ -55,6 +57,7 @@ public class ScaleDependentMeasure {
|
|||
|
||||
/**
|
||||
* Root Mean Square Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double rmse() {
|
||||
|
@ -63,6 +66,7 @@ public class ScaleDependentMeasure {
|
|||
|
||||
/**
|
||||
* Mean Absolute Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mae() {
|
||||
|
@ -76,6 +80,7 @@ public class ScaleDependentMeasure {
|
|||
|
||||
/**
|
||||
* Median Absolute Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mdae() {
|
||||
|
|
|
@ -22,6 +22,7 @@ public class ScaledErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
|
@ -57,6 +58,7 @@ public class ScaledErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Mean Square Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mse() {
|
||||
|
@ -70,6 +72,7 @@ public class ScaledErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Root Mean Square Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double rmse() {
|
||||
|
@ -78,6 +81,7 @@ public class ScaledErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Mean Absolute Error:
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mae() {
|
||||
|
@ -91,6 +95,7 @@ public class ScaledErrorBasedMeasure {
|
|||
|
||||
/**
|
||||
* Median Absolute Error
|
||||
*
|
||||
* @return Ergebnis
|
||||
*/
|
||||
public Double mdae() {
|
||||
|
|
|
@ -22,6 +22,7 @@ public class DatasetGenerator extends Observable {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
*/
|
||||
|
@ -31,6 +32,7 @@ public class DatasetGenerator extends Observable {
|
|||
random = new Random();
|
||||
random.setSeed(9999);
|
||||
}
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
*/
|
||||
|
@ -40,6 +42,7 @@ public class DatasetGenerator extends Observable {
|
|||
|
||||
/**
|
||||
* Generiert zu einer gegebenen Größe einen Datensatz des typen: Punktwolke
|
||||
*
|
||||
* @param size Größe des Datensatzes
|
||||
* @return Liste der Geraden
|
||||
*/
|
||||
|
@ -54,7 +57,7 @@ public class DatasetGenerator extends Observable {
|
|||
double signal = m * i + b;
|
||||
signal *= -1;
|
||||
|
||||
Line line = new Line((double) i, signal - y);
|
||||
Line line = new Line(i, signal - y);
|
||||
line.setId(i - 1 + "");
|
||||
lines.add(line);
|
||||
}
|
||||
|
@ -68,6 +71,7 @@ public class DatasetGenerator extends Observable {
|
|||
|
||||
/**
|
||||
* Wrapper Methode zum generieren eines Datensatzes des typen: Gerade
|
||||
*
|
||||
* @param size Größe des Datensatzes
|
||||
* @return Liste des Geraden
|
||||
*/
|
||||
|
@ -79,6 +83,7 @@ public class DatasetGenerator extends Observable {
|
|||
/**
|
||||
* Generieren eines Datensatzes des typen: Gerade. Die Geraden werden in eine
|
||||
* übergebene Liste hinzugefügt.
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param n Größe des Datensatzes
|
||||
* @return Liste des Geraden
|
||||
|
@ -105,7 +110,7 @@ public class DatasetGenerator extends Observable {
|
|||
|
||||
int idx = lines.size();
|
||||
for (Double d : points.keySet()) {
|
||||
Line line = new Line((double) d, points.get(d));
|
||||
Line line = new Line(d, points.get(d));
|
||||
line.setId(idx + "");
|
||||
lines.add(line);
|
||||
idx++;
|
||||
|
@ -121,6 +126,7 @@ public class DatasetGenerator extends Observable {
|
|||
* Generiert einen Datensatz des typen: Gerade mit zirkulärer Störung. Zuerst wird die
|
||||
* zirkuläre Störung zu der Liste der (dualen-)Geraden hinzugefügt danach wird die wrapper Methode
|
||||
* <code>generateDataLines()</code> aufgerufen.
|
||||
*
|
||||
* @param size Größe des Datensatzes
|
||||
* @return Liste der Geraden
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,6 @@ package presenter.io;
|
|||
|
||||
import com.opencsv.CSVWriter;
|
||||
import model.Line;
|
||||
import model.LineModel;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
@ -24,6 +23,7 @@ public class DataExporter extends Observable {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param file Datei in die, die Informationen exportiert werden sollen
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@ package presenter.io;
|
|||
|
||||
import com.opencsv.CSVReader;
|
||||
import model.Line;
|
||||
import model.LineModel;
|
||||
import presenter.Presenter;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
|
@ -29,6 +27,7 @@ public class DataImporter extends Observable {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param file Datei aus der die Informationen imortiert werden sollen.
|
||||
*/
|
||||
public DataImporter(File file) {
|
||||
|
@ -46,6 +45,7 @@ public class DataImporter extends Observable {
|
|||
* Diese Methode importiert liest zeile für zeile die Daten aus der Datei und baut eine Liste von Geraden auf.
|
||||
* Dabei wird auf die richtige Form geachtet. Falls die Datei nicht, mindestens zwei Spalten enthält wird ein Fehler
|
||||
* signalisiert und der Import wird abgebrochen.
|
||||
*
|
||||
* @return Liste der Geraden
|
||||
*/
|
||||
public LinkedList<Line> run() {
|
||||
|
|
|
@ -21,6 +21,7 @@ public class EvalResultLatexExport {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param model TableModel aus dem exportiert werden soll
|
||||
* @param file Datei in die exportiert werden soll
|
||||
*/
|
||||
|
|
|
@ -10,6 +10,7 @@ package presenter.util;
|
|||
public class BinomialCoeffizient {
|
||||
/**
|
||||
* Berechnet den Binomialkoeffizient zu der eingabe. Bin(n,k)
|
||||
*
|
||||
* @param n n
|
||||
* @param k k
|
||||
* @return Ergebnis
|
||||
|
|
|
@ -15,6 +15,7 @@ public class FastElementSelector {
|
|||
|
||||
/**
|
||||
* Liefert das k-te Element aus der Eingabeliste zurück in Theta(n) Zeit.
|
||||
*
|
||||
* @param a Eingabeliste
|
||||
* @param i Rang des gewünschten Elements
|
||||
* @return das Element
|
||||
|
|
|
@ -30,6 +30,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
*/
|
||||
public IntersectionComputer(LinkedList<Line> lines) {
|
||||
|
@ -47,6 +48,7 @@ public class IntersectionComputer {
|
|||
* Berechnet zu einer gegebenen Menge von dualen Geraden die Schnittpunkte. Dafür wird ein modifizierter Merge-Sort
|
||||
* Algorithmus verwendett. Um die Performance zu steigern wird die Berechnung ab einer passenden Größe auf vier
|
||||
* Threads ausgelagert.
|
||||
*
|
||||
* @param lower untere Schranke
|
||||
* @param higher obere Schranke
|
||||
* @return Liste der Schnittpunkte
|
||||
|
@ -86,10 +88,12 @@ public class IntersectionComputer {
|
|||
return new ArrayList<>(intersections);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Berechnet zu einer gegebenen Menge von dualen Geraden die Schnittpunkte. Dafür wird ein modifizierter Merge-Sort
|
||||
* Algorithmus verwendett. Um die Performance zu steigern wird die Berechnung ab einer passenden Größe auf vier
|
||||
* Threads ausgelagert.
|
||||
*
|
||||
* @return Liste der Schnittpunkte
|
||||
*/
|
||||
public ArrayList<Point> compute() {
|
||||
|
@ -111,6 +115,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter Zugriff auf die Liste der Geraden
|
||||
*
|
||||
* @return Liste der Geraden
|
||||
*/
|
||||
public synchronized LinkedList<Line> getLines() {
|
||||
|
@ -119,6 +124,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter hinzufügen eines Schnittpunkts
|
||||
*
|
||||
* @param p Schnittpunkt
|
||||
*/
|
||||
public synchronized void addIntersection(Point p) {
|
||||
|
@ -127,20 +133,18 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisiertes abfragen ob ein Schnittpunkt bereits gefunden wurde.
|
||||
*
|
||||
* @param p Schnittpunkt
|
||||
* @return <code>true</code>, falls der Schnittpunkt p bereits gefunden wurde
|
||||
*/
|
||||
public synchronized boolean isFound(Point p) {
|
||||
if (intersections.contains(p)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return intersections.contains(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Zu einem Punkt werden die minimalen, maximalen x- und y-Koordinaten überprüft und ggf.
|
||||
* neu gesetzt
|
||||
*
|
||||
* @param point Schnittpunkt
|
||||
*/
|
||||
public void setRanges(Point point) {
|
||||
|
@ -152,6 +156,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter Zugriff auf die minimale x-Koordiante
|
||||
*
|
||||
* @return minimale x-Koordiante
|
||||
*/
|
||||
public synchronized Double getxMinimum() {
|
||||
|
@ -160,6 +165,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter Zugriff auf die maximale x-Koordinate
|
||||
*
|
||||
* @return maximale x-Koordinate
|
||||
*/
|
||||
public synchronized Double getxMaximum() {
|
||||
|
@ -168,6 +174,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter Zugriff auf die minimale y-Koordinate
|
||||
*
|
||||
* @return minimale y-Koordinate
|
||||
*/
|
||||
public synchronized Double getyMinimum() {
|
||||
|
@ -176,6 +183,7 @@ public class IntersectionComputer {
|
|||
|
||||
/**
|
||||
* Synchronisierter Zugriff auf die maximale y-Koordinate
|
||||
*
|
||||
* @return maximale y-Koordinate
|
||||
*/
|
||||
public synchronized Double getyMaximum() {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package presenter.util;
|
||||
|
||||
import model.*;
|
||||
import model.Interval;
|
||||
import model.Line;
|
||||
import model.Pair;
|
||||
import model.Point;
|
||||
import presenter.util.Comparators.YOrderLineComparatorBegin;
|
||||
import presenter.util.Comparators.YOrderLineComparatorEnd;
|
||||
|
||||
|
|
|
@ -50,8 +50,7 @@ public class RandomSampler {
|
|||
|
||||
Random rand = new Random();
|
||||
int inputSize = sampledLines.size();
|
||||
for (int i = 0; i < r; i++)
|
||||
{
|
||||
for (int i = 0; i < r; i++) {
|
||||
int indexToSwap = i + rand.nextInt(inputSize - i);
|
||||
Double temp = sampledLines.get(i);
|
||||
sampledLines.set(i, sampledLines.get(indexToSwap));
|
||||
|
|
|
@ -121,6 +121,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisiert das Ergebnis des LMS-Schätzers
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
*/
|
||||
|
@ -132,6 +133,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisiert das Ergebnis des RM-Schätzers
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
*/
|
||||
|
@ -143,6 +145,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisiert das Ergebnis des TS-Schätzers
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
*/
|
||||
|
@ -154,6 +157,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Erzeugt den Plot zu einer Eingabe von Punkten und der Lösung eines Schätzers (m,b)
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
* @param plot Plot
|
||||
|
@ -171,6 +175,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisierung des Import-Prozesses
|
||||
*
|
||||
* @param progress akteulle Prozentzahl (0-100)
|
||||
*/
|
||||
public void showImportProgress(Integer progress) {
|
||||
|
@ -207,13 +212,14 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Fügt der Evaluations-Tabelle eine Spalte mit Daten hinzu
|
||||
*
|
||||
* @param res Daten der Spalte
|
||||
* @param col Spalte
|
||||
* @param isApprCol <code>true</code>, falls es sich um die Überschirften der Approximationsgüten handelt
|
||||
*/
|
||||
public void appendEvalResult(Object[] res, int col, boolean isApprCol) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Object[] tmp = Arrays.asList(res).subList(2, res.length).toArray();
|
||||
Object[] tmp = Arrays.copyOfRange(res, 2, res.length);
|
||||
if (isApprCol) {
|
||||
evaluationPanel.setCurrentRow(tmp.length);
|
||||
evaluationPanel.addColumn(tmp, col, true);
|
||||
|
@ -227,11 +233,12 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Fügt der Evaluations-Tabelle eine Zeile mit Daten hinzu
|
||||
*
|
||||
* @param res Daten der Spalte
|
||||
*/
|
||||
public void appendEvalResult(Object[] res) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Object[] tmp = Arrays.asList(res).subList(1, res.length).toArray();
|
||||
Object[] tmp = Arrays.copyOfRange(res, 1, res.length);
|
||||
evaluationPanel.addRow(tmp);
|
||||
evaluationPanel.repaint();
|
||||
evaluationPanel.revalidate();
|
||||
|
@ -240,12 +247,13 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisiert die Ausgleichsgerade zu gegebenen Algorithmen
|
||||
*
|
||||
* @param res Steigungen und y-Achsenabschnitte
|
||||
* @param alg Kodierung der Alg.
|
||||
*/
|
||||
public void drawLineResult(Object[] res, int alg) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Object[] result = Arrays.asList(res).subList(2, res.length).toArray();
|
||||
Object[] result = Arrays.copyOfRange(res, 2, res.length);
|
||||
evaluationPanel.drawLines(result, alg);
|
||||
evaluationPanel.repaint();
|
||||
evaluationPanel.revalidate();
|
||||
|
@ -254,11 +262,12 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Visualisiert die Ausgleichsgerade zu einem gegebenen Algorithmus
|
||||
*
|
||||
* @param res Steigungen und y-Achsenabschnitte
|
||||
*/
|
||||
public void drawLineResults(Object[] res) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Object[] result = Arrays.asList(res).subList(1, res.length).toArray();
|
||||
Object[] result = Arrays.copyOfRange(res, 1, res.length);
|
||||
ArrayList<Double[]> algs = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < (result.length + 1) / 3; i++) {
|
||||
|
@ -277,6 +286,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Evaluations-Datensätze werden Visualisiert
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
*/
|
||||
public void addEvalDataset(LinkedList<Line> lines) {
|
||||
|
@ -511,6 +521,7 @@ public class MainFrame extends JFrame {
|
|||
|
||||
/**
|
||||
* Ausgabe einer Tabelle
|
||||
*
|
||||
* @param heading Überschrift
|
||||
* @param rows Zeilen mit Text
|
||||
*/
|
||||
|
|
|
@ -35,6 +35,7 @@ public class MenuBar {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param view View
|
||||
*/
|
||||
public MenuBar(MainFrame view) {
|
||||
|
|
|
@ -19,6 +19,7 @@ public class DualityVisualizerListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
*/
|
||||
public DualityVisualizerListener(Presenter presenter) {
|
||||
|
|
|
@ -24,6 +24,7 @@ public class ExportDataListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
* @param component visuelle Elternkomponente
|
||||
*/
|
||||
|
|
|
@ -25,6 +25,7 @@ public class GenerateDataListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
*/
|
||||
public GenerateDataListener(Presenter presenter) {
|
||||
|
|
|
@ -24,6 +24,7 @@ public class ImportDataListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
* @param component visuelle Elternkomponente
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@ public class PictureImportListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
* @param component visuelle Elternkomponente
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@ public class StartAlgorithmListener implements ActionListener {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param presenter Presenter
|
||||
* @param tabPanel Algorithmus Visualisierungskomponente
|
||||
*/
|
||||
|
|
|
@ -59,6 +59,7 @@ public class DualityPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilfsmethode um die Parameter im einem Schritt zu setzen
|
||||
*
|
||||
* @param lines Liste der Geraden
|
||||
* @param points Liste der Schnittpunkte
|
||||
* @param xmin minimale x-Koordinate
|
||||
|
@ -151,6 +152,7 @@ public class DualityPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilfmethode für die Zoom-Funktion im Panel
|
||||
*
|
||||
* @param component Komponente
|
||||
*/
|
||||
public void addKeyListener(JComponent component) {
|
||||
|
@ -180,6 +182,7 @@ public class DualityPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Zoom-Funktionalität für das Panel
|
||||
*
|
||||
* @param chartPanel
|
||||
*/
|
||||
protected void addZooming(ChartPanel chartPanel) {
|
||||
|
|
|
@ -63,6 +63,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Konstruktor
|
||||
*
|
||||
* @param view View
|
||||
*/
|
||||
public EvaluationPanel(MainFrame view) {
|
||||
|
@ -343,6 +344,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt der Tabelle eine Zeile hinzu
|
||||
*
|
||||
* @param data Daten der Zeile
|
||||
*/
|
||||
public void addRow(Object[] data) {
|
||||
|
@ -358,6 +360,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Visualisierung der Ausgleichsgeraden
|
||||
*
|
||||
* @param alg Steigung und y-Achsenabschnitt der Geraden, bestimmt durch die Schätzer
|
||||
*/
|
||||
public void drawLines(ArrayList<Double[]> alg) {
|
||||
|
@ -374,6 +377,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Visualisierung der Ausgleichsgerade
|
||||
*
|
||||
* @param results Steigung und y-Achsenabschnitt der Gerade, bestimmt durch die Schätzer
|
||||
* @param alg identifizierung des Alg.
|
||||
*/
|
||||
|
@ -394,6 +398,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Visualisierung der dualen Geraden (Eingabemenge)
|
||||
*
|
||||
* @param points Liste der Geraden
|
||||
*/
|
||||
public void setDualPoints(LinkedList<Line> points) {
|
||||
|
@ -407,6 +412,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilfsmethode
|
||||
*
|
||||
* @param n Anzahl der leeren Zeilen
|
||||
*/
|
||||
private void addBlankRows(int n) {
|
||||
|
@ -418,6 +424,7 @@ public class EvaluationPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilfsmethode
|
||||
*
|
||||
* @param val Anzahl der Zeilen die noch hinzugefügt werden
|
||||
*/
|
||||
public void setCurrentRow(int val) {
|
||||
|
|
|
@ -38,6 +38,7 @@ public class InfoPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt eine Text dem Panel als Paragraph hinzu
|
||||
*
|
||||
* @param p Übergebener Text
|
||||
*/
|
||||
public void appendParagraph(String p) {
|
||||
|
@ -47,6 +48,7 @@ public class InfoPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt eine Überschrift dem Panel hinzu
|
||||
*
|
||||
* @param h1 Überschrift
|
||||
*/
|
||||
public void appendParagraphWithHeading(String h1) {
|
||||
|
@ -56,6 +58,7 @@ public class InfoPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt einen Text in roter Schrift als Paragraph dem Panel hinzu
|
||||
*
|
||||
* @param p Text
|
||||
*/
|
||||
public void appendParagraphRed(String p) {
|
||||
|
@ -65,6 +68,7 @@ public class InfoPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt einen Text in grüner Schrift als Paragraph dem Panel hinzu
|
||||
*
|
||||
* @param p Text
|
||||
*/
|
||||
public void appendParagraphGreen(String p) {
|
||||
|
@ -74,6 +78,7 @@ public class InfoPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt eine Tabelle mit Werten dem Panel hinzu
|
||||
*
|
||||
* @param heading Überschriften
|
||||
* @param rows Liste von Daten pro Zeile
|
||||
*/
|
||||
|
|
|
@ -48,6 +48,7 @@ public class PlotPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Erzeugen des Plots
|
||||
*
|
||||
* @param points Liste der Geraden
|
||||
*/
|
||||
public void createPlot(LinkedList<Line> points) {
|
||||
|
@ -103,6 +104,7 @@ public class PlotPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt eine Gerade zum Plot hinzu
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
* @param color Farbe
|
||||
|
@ -125,6 +127,7 @@ public class PlotPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt eine Gerade zum Plot hinzu
|
||||
*
|
||||
* @param m Steigung
|
||||
* @param b y-Achsenabschnitt
|
||||
* @param name Bezeichner
|
||||
|
@ -144,6 +147,7 @@ public class PlotPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Wandelt die Daten in ein passendes Format um
|
||||
*
|
||||
* @param points Liste der Geraden
|
||||
*/
|
||||
private void convertData(LinkedList<Line> points) {
|
||||
|
|
|
@ -69,6 +69,7 @@ public class LMSPanel extends TabPanel {
|
|||
|
||||
/**
|
||||
* Hilftmethode um einen Botton an die passende Stelle zu platzieren
|
||||
*
|
||||
* @param row Zeile
|
||||
* @param button Button
|
||||
*/
|
||||
|
@ -89,6 +90,7 @@ public class LMSPanel extends TabPanel {
|
|||
|
||||
/**
|
||||
* Liefert die Eingaben in Form eines Feldes zurück. Die Parameter werden für den Alg. benötigt.
|
||||
*
|
||||
* @return Eingabe
|
||||
*/
|
||||
public String[] getInput() {
|
||||
|
|
|
@ -77,6 +77,7 @@ public class RMPanel extends TabPanel {
|
|||
|
||||
/**
|
||||
* Liefert die Eingabe zurück. Der Parameter wird für den Alg. benötigt.
|
||||
*
|
||||
* @return Eingabe
|
||||
*/
|
||||
public String getInput() {
|
||||
|
|
|
@ -46,6 +46,7 @@ public abstract class TabPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Fügt in eine Zeile ein Überschrift(JLabel) und eine Eingabekomponente(JTextField)
|
||||
*
|
||||
* @param row Zeile
|
||||
* @param name Überschrift
|
||||
* @param value Standardwert
|
||||
|
@ -56,6 +57,7 @@ public abstract class TabPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilftmethode um den Plotpanel erst bei Vorhandenen Ergebnissen hinzufügen zu können
|
||||
*
|
||||
* @param plotPanel Plotpanel
|
||||
*/
|
||||
public void setPlotPanel(PlotPanel plotPanel) {
|
||||
|
@ -92,6 +94,7 @@ public abstract class TabPanel extends JPanel {
|
|||
|
||||
/**
|
||||
* Hilfmethode zum prüfen ob die Eingabe numerisch ist.
|
||||
*
|
||||
* @param str Eingabe
|
||||
* @return <code>true</code>, falls es sich bei der Eingabe um numerische Werte handelt
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue