-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
66 lines (45 loc) · 1.58 KB
/
Main.java
File metadata and controls
66 lines (45 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
static int ilePlikow;
public static ArrayList<Language> train = new ArrayList<>();
public static ArrayList<Perceptron> perceptrony = new ArrayList<>();
static int ok=0, no=0;
static int licznikPetli=0;
public static void main(String[] args) {
//czytanie pliku
FileService service = new FileService();
String dirPathname = "C:/Users/Admn/Desktop/dane";
File directory = new File(dirPathname);
if(!directory.isDirectory()){
System.out.println(dirPathname + " is not directory");
}
try {
service.prepareLanguages(directory);
} catch (IOException e) {
e.printStackTrace();
}
//tworze perceptrony
for(int i=0; i<FileService.nazwyKatalogow.size();i++){
Perceptron p = new Perceptron(FileService.nazwyKatalogow.get(i));
perceptrony.add(p);
}
do{
ok=0;
no=0;
System.out.println("MIESZANIE ZBIORU TRENINGOWEGO.....................");
Collections.shuffle(train);
for(Perceptron p : perceptrony){
for(Language l : train){
p.checkW(l.getDimensions(), l.getName(), p.name);
}
}
System.out.println("poprawnych: "+ ok + " niepoprawnych: " + no );
licznikPetli++;
}while(ok/(no + ok )<0.95 && licznikPetli<10);
//GUI
new GUI();
}
}