Beispiel #1
0
        public void Navigate(WumpusWorld environment)
        {
            environment.Reset();

            var i = 0;

            while (i < MAX_ACTIONS && !environment.Done)
            {
                var percepts = environment.GetPercepts();
                var output   = _network.Evaluate(percepts);
                var action   = (uint)Array.IndexOf(output, output.Max());

                System.Diagnostics.Debug.WriteLine($"Action Count: {i}");
                System.Diagnostics.Debug.WriteLine($"Percepts: {environment.GetPerceptsText()}");
                System.Diagnostics.Debug.WriteLine($"Action: {WumpusWorld.ACTION_MAP[action]}");
                environment.Render();

                environment.TakeAction(action);
                i++;

                Thread.Sleep(TIMEOUT);
            }
        }
Beispiel #2
0
 public WumpusWorldTrainer(WumpusWorld environment)
 {
     _environment = environment;
 }