示例#1
0
        public Traversal(
            IProblem <TState, TCost> problem,
            IScenario <TState, TCost> scenario,
            TState initstate
            )
        {
            Problem  = problem;
            Scenario = scenario;
            var initstateestimateddistance = scenario.GetDistance(initstate);

            OpenNodes = new NodeRepository <TState, TCost>(
                new Node.Primitive <TState, TCost>(null, initstate, Problem.InitCost, initstateestimateddistance, Problem.Accumulate(Problem.InitCost, initstateestimateddistance)),
                Problem.Comparer);
        }