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:
2023-12-09 11:22:26 +01:00
parent aadbced16f
commit 7d276e10d1
5 changed files with 30 additions and 10 deletions

View File

@@ -20,19 +20,24 @@ public class DataPoint {
return retStr; return retStr;
} }
double getX1() { double getX1()
{
return x1; return x1;
} }
double getX2() { double getX2()
{
return x2; return x2;
} }
String getName() { String getName()
{
return name; return name;
} }
int getLabel() { int getLabel()
{
return label; return label;
} }
} }

View File

@@ -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 breite = 500;
int hoehe = 400; int hoehe = 400;
@@ -8,7 +15,9 @@ class Graph
ArrayList<Shape> graphenobjekte; ArrayList<Shape> graphenobjekte;
// für x1-Werte bis etwa 500 (vgl. daten.txt)
double streckenInX1Faktor = 0.8; double streckenInX1Faktor = 0.8;
// für x2-Werte bis etwa 25 (vgl. daten.txt)
double streckenInX2Faktor = 10; double streckenInX2Faktor = 10;
World w = new World(breite, hoehe); World w = new World(breite, hoehe);
@@ -66,3 +75,4 @@ class Graph
graphenobjekte.clear(); graphenobjekte.clear();
} }
} }

View File

@@ -2,6 +2,7 @@
* Portierung des Perzeptron-Labors von Christoph Grässl für die Online-IDE. * Portierung des Perzeptron-Labors von Christoph Grässl für die Online-IDE.
* *
* @author: Jan Bertram ( jbsoc@mailbox.org ) * @author: Jan Bertram ( jbsoc@mailbox.org )
* @author: Sabine Schlötzer
*/ */
public class Labor { public class Labor {
ArrayList<DataPoint> trainingset; ArrayList<DataPoint> trainingset;
@@ -29,11 +30,13 @@ public class Labor {
} }
} }
public void zeigeGraph() { public void zeigeGraph()
{
g.zeichnen(); g.zeichnen();
} }
public void leereGraph() { public void leereGraph()
{
g.leeren(); g.leeren();
} }
@@ -43,3 +46,4 @@ public class Labor {
} }
} }
} }

View File

@@ -2,6 +2,7 @@
// eigentlich entfernt werden… // eigentlich entfernt werden…
Labor lab = new Labor(); Labor lab = new Labor();
lab.ladeTrainingsdaten("daten.txt"); lab.ladeTrainingsdaten("daten.txt");
lab.zeigeTrainingsdaten(); // lab.zeigeTrainingsdaten();
lab.zeigeGraph(); lab.zeigeGraph();
//lab.leereGraph(); //lab.leereGraph();

File diff suppressed because one or more lines are too long