예제 #1
0
파일: BrisRace.cs 프로젝트: jpazarzis/hogar
        internal DecisionTreeList ReadDecisionTreeListFromDisk(string filename)
        {
            var dtl = new DecisionTreeList(DecisionTreeList.Type.Production);

            try
            {
                if (dtl.FileExists(filename))
                {
                    dtl.ReadFromDisk(filename);
                }
                else
                {
                    dtl = null;
                }
            }
            catch
            {
                dtl = null;
            }
            return dtl;
        }
예제 #2
0
 private string GetVotes(List<int> factors, DecisionTreeList dtl)
 {
     if (null == dtl)
     {
         return "NA";
     }
     else
     {
         int votes = 0;
         dtl.ForEach(dt => votes += dt.Evaluate(factors) ? 1 : 0);
         return string.Format("{0}", votes);
     }
 }