AIMA.Core.Search.Framework.SearchAgent.getInstrumentation C# (CSharp) Method

getInstrumentation() public method

public getInstrumentation ( ) : string>.Dictionary
return string>.Dictionary
        public Dictionary<string,string> getInstrumentation()
        {
            Dictionary<string, string> retVal = new Dictionary<string, string>();
           foreach(string key in  searchMetrics.keySet())
           {
                System.String value = searchMetrics.get(key);
                retVal.Add(key, value);
            }
            return retVal;
        }
    }

Usage Example

        public void testMultiGoalProblem()
        {
            Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
            Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.ARAD,
                    MapFunctionFactory.getActionsFunction(romaniaMap),
                    MapFunctionFactory.getResultFunction(), new DualMapGoalTest(
                            SimplifiedRoadMapOfPartOfRomania.BUCHAREST,
                            SimplifiedRoadMapOfPartOfRomania.HIRSOVA),
                    new MapStepCostFunction(romaniaMap));

            Search search = new BreadthFirstSearch(new GraphSearch());

            SearchAgent agent = new SearchAgent(problem, search);
            Assert
                    .Equals(
                            "[Action[name==moveTo, location==Sibiu], Action[name==moveTo, location==Fagaras], Action[name==moveTo, location==Bucharest], Action[name==moveTo, location==Urziceni], Action[name==moveTo, location==Hirsova]]",
                            agent.getActions().ToString());
            Assert.Equals(5, agent.getActions().Count);
            Assert.Equals("14", agent.getInstrumentation()[
                    "nodesExpanded"]);
            Assert.Equals("1", agent.getInstrumentation()[
                    "queueSize"]);
            Assert.Equals("5", agent.getInstrumentation()[
                    "maxQueueSize"]);
        }