Пример #1
0
        public InputProcessor(List <int> image)
        {
            heurisiticArray = new HeurisiticArray <List <int> >(new List <int>());

            //define the functions which generate these heuristics
            var pixelData = new HeuristicSet <List <int> >("Pixel Data", i => new List <int>(), image);

            heurisiticArray.AddHeuristics(pixelData);
            var colorData = new HeuristicSet <List <int> >("Color data", i => new List <int>(), image);

            heurisiticArray.AddHeuristics(colorData);
        }
Пример #2
0
        public HeurisiticArray <int[][]> AccessElement(int at)
        {
            var a     = lines.ElementAt(at);
            var label = a.Split(',').First();
            var data  = a.Split(',').Skip(1).Select(v => int.Parse(v));

            int[][] inputData = new int[28][];
            for (int i = 0; i < 28; i++)
            {
                inputData[i] = new int[28];
            }

            for (int i = 0; i < data.Count(); i++)
            {
                inputData[i / 28][i % 28] = data.ElementAt(i);
            }
            var set = new HeuristicSet <int[][]>("pixels", pixel => data, inputData);
            var b   = new HeurisiticArray <int[][]>(inputData);

            b.AddLabel(new Label(label));
            b.AddHeuristics(set);
            return(b);
        }
Пример #3
0
 public void AddHeuristics(HeuristicSet <T> set)
 {
     heuristics.Add(set.Label, set.Heuristics);
 }