-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
81 lines (63 loc) · 3.26 KB
/
Program.cs
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using System.IO;
namespace ExpertSystem
{
class Program
{
static void Main(string[] args)
{
//var myList = new List<string> { "Yes", "No", "Maybe" };
ExpSystem expertSystem = new ExpSystem("D:\\Knowledge_base.txt");
//=============== DUBUG - Input =================================
/*Console.WriteLine("================================");
foreach ( var obj in expertSystem.mInputDate )
{
Console.WriteLine(obj.ToString());
}*/
Console.WriteLine("::::::::::::::::: Input Data :::::::::::::::::");
Console.WriteLine("=========== Objects ===============");
foreach (var obj in expertSystem.getObjects() )
{
Console.WriteLine(obj.Key.ToString() + "::" + obj.Value.ToString());
}
Console.WriteLine("=========== Relations Types ==============");
foreach (var obj in expertSystem.getRelations())
{
Console.WriteLine(obj.Key.ToString() + "::" + obj.Value.getRelationName().ToString() + "::" + obj.Value.getRelationType().ToString());
}
Console.WriteLine("========== Input Relations =============");
int[,] tempMatrix = expertSystem.getGivenRelationMatrix();
for ( int i = 0; i < expertSystem.getGivenRelationsListSize(); i++ )
{
Console.WriteLine(tempMatrix[i, 0].ToString() + "::" + tempMatrix[i, 1].ToString() + "::" + tempMatrix[i, 2].ToString());
}
Console.WriteLine("========== Processed data =============");
for (int i = 0; i < expertSystem.getOutputRelations().Count; i++ )
{
Console.WriteLine(expertSystem.getOutputRelations()[i].mObj1Name + " " + expertSystem.getOutputRelations()[i].mRelName + " " + expertSystem.getOutputRelations()[i].mObj2Name);
}
Console.WriteLine("========== Processed data in codes =============");
for (int i = 0; i < expertSystem.getOutputRelations().Count; i++)
{
Console.WriteLine(expertSystem.getOutputRelations()[i].mObj1Code.ToString() + ":" + expertSystem.getOutputRelations()[i].mRelCode.ToString() + ":" + expertSystem.getOutputRelations()[i].mObj2Code.ToString());
}
Console.WriteLine("==========-----------------------=============");
Console.WriteLine("========== The data is read and processed. =============");
Console.WriteLine("========== Enter the query by example: < ? : ? : ? > =============");
string s = Console.ReadLine();
while (s != "")
{
Console.WriteLine("========== ANSWER =============");
expertSystem.queryAnalyser(s);
Console.WriteLine("===============================");
Console.WriteLine("========== Enter the query by example: < ? : ? : ? > =============");
s = Console.ReadLine();
}
}
}
}