-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.java
More file actions
47 lines (40 loc) · 1.27 KB
/
Copy pathApplication.java
File metadata and controls
47 lines (40 loc) · 1.27 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
package tp1;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class Application {
public static void main(String[] args){
// TODO Auto-generated method stub
String fileName="zebre";
Network myNetwork = null;
try {
System.out.println("Chargement du fichier : "+new java.io.File("../").getCanonicalPath()+ "/" + fileName);
} catch (IOException e) {
System.out.println("Erreur lors du chargement du fichier ! ");
e.printStackTrace();
}
BufferedReader readFile=null;
try {
readFile = new BufferedReader(new FileReader("/auto_home/bgallean/Bureau/Master/eclipse/IntelligenceArtificielle/"+fileName));
} catch (FileNotFoundException e) {
System.out.println("Erreur lors de la lecture du fichier ! ");
e.printStackTrace();
}
try {
myNetwork= new Network(readFile);
} catch (Exception e) {
System.out.println("Erreur lors du chargement du network ! ");
e.printStackTrace();
}
try {
readFile.close();
} catch (IOException e) {
System.out.println("Erreur lors de la fermeture du fichier ! ");
e.printStackTrace();
}
System.out.println(myNetwork.toString());
CSP test = new CSP(myNetwork);
System.out.println(test.searchSolution());
}
}