private void AddChild(int possibility, ICSPSolvable currentNode, CSPNode mostLimited) { ICSPSolvable nodeClone = currentNode.DeepClone(); nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, possibility); CreateChildren(nodeClone); }
private void AddChildenForEveryPossibility(List <int> allPossibilities, ICSPSolvable currentNode, CSPNode mostLimited) { for (int i = 0; i < allPossibilities.Count; i++) { ICSPSolvable CSPNodeClone = currentNode.DeepClone(); CSPNodeClone.AssignNewData(mostLimited.xIndex, mostLimited.yIndex, allPossibilities[i]); CreateChildren(CSPNodeClone); } }
private void AddChildenForEveryPossibility(List <int> allPossibilities, ICSPSolvable currentNode, CSPNode mostLimited) { for (int i = 0; i < allPossibilities.Count; i++) { ICSPSolvable nodeClone = currentNode.DeepClone(); nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, allPossibilities[i]); if (!nodeClone.IsAnyOfDomainsEmpty()) { CreateChildren(nodeClone); } } }
private void AddChild(int possibility, ICSPSolvable currentNode, CSPNode mostLimited) { ICSPSolvable nodeClone = currentNode.DeepClone(); nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, possibility); if (!nodeClone.IsAnyOfDomainsEmpty()) { CreateChildren(nodeClone); } else { numberOfIterations++; } }