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); }
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); }
private void GetPatternNeighbours(PatternDataResults patternFinderResult, IFindNeighbourStrategy strategy) { patternPossibleNeighboursDictionary = PatternFinder.FindPossibleNeighboursForAllPatterns(strategy, patternFinderResult); }
public static Dictionary <int, PatternNeighbours> FindPossibleNeighboursForAllPatterns( IFindNeighbourStrategy strategy, PatternDataResults patternFinderResult) { return(strategy.FindNeighbours(patternFinderResult)); }