示例#1
0
文件: Dane.cs 项目: Rasa1/psychotest
 //tą metodą dodawaj pojedyńczo atrybuty
 public void AddAtrybut(Atrybut atr)
 {
     try
     {
         this.atrybuty.Add(atr);
     }
     catch (Exception)
     {
         return;
         throw;
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            //Cycki ( 。 ㅅ  。)
            Dane dane = new Dane(2, 14);

            Atrybut atr = new Atrybut("outlook");
            atr.AddMozliwosc("sunny");
            atr.AddMozliwosc("overcast");
            atr.AddMozliwosc("rain");

            dane.AddAtrybut(atr);

            atr = new Atrybut("windy");
            atr.AddMozliwosc("false");
            atr.AddMozliwosc("true");
            dane.AddAtrybut(atr);

            dane.AddOdpowiedz("play");
            dane.AddOdpowiedz("dont");
            int[,] tab = {
                         {0,0,1 },
                         {0,1,1 },
                         {1,0,0 },
                         {2,0,0 },
                         {2,0,0},
                         {2,1,1 },
                         {1,1,0 },
                         {0,0,1 },
                         {0,0,0 },
                         {2,0,0},
                         {0,1,0},
                         {1,1,0},
                         {1,0,0},
                         {2,1,1} };
            dane.SetDane_treningowe(tab);

            Console.Out.WriteLine(dane.GetEntropy());
            Console.Out.WriteLine(dane.info(0));
            return;
        }
示例#3
0
 public void Coppy(Atrybut kopiuj_z)
 {
     this.nazwa = kopiuj_z.nazwa;
     for (int i = 0; i < kopiuj_z.mozliwosci.Count; i++)
         this.mozliwosci[i] = kopiuj_z.mozliwosci[i];
 }