示例#1
0
        static void Main(string[] args)
        {
            Jug jug1 = new Jug(8, 8);
            Jug jug2 = new Jug(5, 0);
            Jug jug3 = new Jug(3, 0);

            Node root = new Node(jug1, jug2, jug3, 0);

            var currentNode = root;

            var transitions = new Transitions
            {
                AppliedRules = new List <Node>
                {
                    root
                }
            };

            while (!transitions.IsProblemSolved(currentNode))
            {
                Console.WriteLine($"Nó atual: {Helper.PrintNode(currentNode)}");

                var avaialbieTransitions = transitions.AvailableTransitions(currentNode);

                currentNode = transitions.ChooseBestNode(avaialbieTransitions);
            }

            Console.WriteLine($"Problema finalizado, nó atual: {Helper.PrintNode(currentNode)}");
        }