示例#1
0
        public Guid RegisterClient(int dataCount, int atrCount)
        {
            kMeansContext lCont      = new kMeansContext(dataCount, atrCount);
            Guid          ClientGuid = Guid.NewGuid();

            clients.Add(ClientGuid, lCont);
            return(ClientGuid);
        }
示例#2
0
        public void DoClusters(Guid client, int pClusterNum, double accuracy = 0.1)
        {
            Console.WriteLine("зашёл в метод");
            kMeansContext lCurClient = clients[client];

            lCurClient.SetClusterCount(pClusterNum);
            Console.WriteLine("создал контекст");
            MyDataComparer cmp = new MyDataComparer();

            lCurClient.MakeRndCenters(cmp);
            Console.WriteLine("сделал рандомные центры");
            updateMarkers(client);
            while (!computeCenters(accuracy, client))
            {
                updateMarkers(client);
            }
            Console.WriteLine("закончил работать");
            isFin = true;
        }