Train() public method

Train the AddrSet, string must be wrapped in InsertElement
public Train ( List list, bool withException ) : int
list List InsertElements' List
withException bool Indicate whether throw exception, /// if param is false, function will return 0 if train failed, if param is true, /// function will throw TrainException with detail information
return int
Beispiel #1
0
        private static void Train()
        {
            AddrSet addrset = AddrSet.GetInstance();

            TrainMachine t = new TrainMachine(addrset);

            List<InsertElement> list = new List<InsertElement>();

            Random rnd = new Random();

            list.Add(new InsertElement(rnd.Next().ToString("0.00"), LEVEL.City, InsertMode.AutoPlace | InsertMode.ExactlyLevel));

            t.Train(list, true);

            MatchHelper.rwLockDashboard(addrset);
        }
Beispiel #2
0
        public void Train()
        {
            //start
            AddrSet addrset = AddrSet.GetInstance();

            TrainMachine m = new TrainMachine(addrset);

            List<InsertElement> list = new List<InsertElement>();

            list.Add(new InsertElement("武汉", LEVEL.City, InsertMode.AutoPlace | InsertMode.ExactlyLevel));

            list.Add(new InsertElement("理工大", LEVEL.Other, InsertMode.AutoPlace | InsertMode.ExactlyLevel));

            list.Add(new InsertElement("屋檐下", LEVEL.Uncertainty, InsertMode.AutoPlace | InsertMode.ExactlyLevel));

            m.Train(list, true);

            //close
            //addrset.Dump();
        }