示例#1
0
        public void ProcessGrid <T>(ValuesManager <T> valueManager, bool equalWeights, string strategyName = null)
        {
            NeighbourStrategyFactory strategyFactory = new NeighbourStrategyFactory();

            strategy = strategyFactory.CreteInstance(strategyName == null ? _patternSize + "" : strategyName);
            CreatePatterns(valueManager, strategy, equalWeights);
        }
示例#2
0
        private void CreatePatterns <T>(ValuesManager <T> valueManager, IFindNeighbourStrategy strategy, bool equalWeights)
        {
            var patternFinderResult = PatternFinder.GetPatternDataFromGrid(valueManager, _patternSize, equalWeights);

            //StringBuilder builder = null;
            //List<string> list = new List<string>();
            //for (int row = 0; row < patternFinderResult.GetGridLengthY(); row++)
            //{
            //    builder = new StringBuilder();
            //    for (int col = 0; col < patternFinderResult.GetGridLengthX(); col++)
            //    {
            //        builder.Append(patternFinderResult.GetIndexAt(col,row) + " ");
            //    }
            //    list.Add(builder.ToString());
            //}
            //list.Reverse();
            //foreach (var item in list)
            //{
            //    Debug.Log(item);
            //}
            patternDataIndexDictionary = patternFinderResult.PatternIndexDictionary;
            GetPatternNeighbours(patternFinderResult, strategy);
        }
示例#3
0
 private void GetPatternNeighbours(PatternDataResults patternFinderResult, IFindNeighbourStrategy strategy)
 {
     patternPossibleNeighboursDictionary = PatternFinder.FindPossibleNeighboursForAllPatterns(strategy, patternFinderResult);
 }
示例#4
0
 public static Dictionary <int, PatternNeighbours> FindPossibleNeighboursForAllPatterns(
     IFindNeighbourStrategy strategy, PatternDataResults patternFinderResult)
 {
     return(strategy.FindNeighbours(patternFinderResult));
 }