schließt Kommentare und Autorenangabe ein
Die Faktoren für die Streckung richten sich im Augenblick nach den Daten in der daten.txt-Datei, darauf wird jetzt in zwei Kommentaren hingewiesen. Vielleicht wäre es eine Überlegung Wert, später den Streckungsfaktor anhand der eingelesenen Daten zu berechnen.
This commit is contained in:
@@ -20,19 +20,24 @@ public class DataPoint {
|
||||
return retStr;
|
||||
}
|
||||
|
||||
double getX1() {
|
||||
double getX1()
|
||||
{
|
||||
return x1;
|
||||
}
|
||||
|
||||
double getX2() {
|
||||
double getX2()
|
||||
{
|
||||
return x2;
|
||||
}
|
||||
|
||||
String getName() {
|
||||
String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
int getLabel() {
|
||||
int getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
class Graph
|
||||
/**
|
||||
* Graph-Klasse, die ein Trainingsset von Datenpunkten (DataPoint-Objekte)
|
||||
* entgegennimmt und diese nach Aufruf der Methode zeichnen() in einem
|
||||
* Koordinatensystem darstellt.
|
||||
*
|
||||
* @author: Sabine Schlötzer
|
||||
*/
|
||||
public class Graph
|
||||
{
|
||||
int breite = 500;
|
||||
int hoehe = 400;
|
||||
@@ -8,7 +15,9 @@ class Graph
|
||||
|
||||
ArrayList<Shape> graphenobjekte;
|
||||
|
||||
// für x1-Werte bis etwa 500 (vgl. daten.txt)
|
||||
double streckenInX1Faktor = 0.8;
|
||||
// für x2-Werte bis etwa 25 (vgl. daten.txt)
|
||||
double streckenInX2Faktor = 10;
|
||||
|
||||
World w = new World(breite, hoehe);
|
||||
@@ -66,3 +75,4 @@ class Graph
|
||||
graphenobjekte.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Portierung des Perzeptron-Labors von Christoph Grässl für die Online-IDE.
|
||||
*
|
||||
* @author: Jan Bertram ( jbsoc@mailbox.org )
|
||||
* @author: Sabine Schlötzer
|
||||
*/
|
||||
public class Labor {
|
||||
ArrayList<DataPoint> trainingset;
|
||||
@@ -29,11 +30,13 @@ public class Labor {
|
||||
}
|
||||
}
|
||||
|
||||
public void zeigeGraph() {
|
||||
public void zeigeGraph()
|
||||
{
|
||||
g.zeichnen();
|
||||
}
|
||||
|
||||
public void leereGraph() {
|
||||
public void leereGraph()
|
||||
{
|
||||
g.leeren();
|
||||
}
|
||||
|
||||
@@ -43,3 +46,4 @@ public class Labor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// eigentlich entfernt werden…
|
||||
Labor lab = new Labor();
|
||||
lab.ladeTrainingsdaten("daten.txt");
|
||||
lab.zeigeTrainingsdaten();
|
||||
// lab.zeigeTrainingsdaten();
|
||||
lab.zeigeGraph();
|
||||
//lab.leereGraph();
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user