示例#1
0
 /// <summary>
 /// Constructor for the RandomMoveAndSplitNeighbourSpace
 /// </summary>
 /// <param name="allRecTreeNodes">List of all RecursiveTrees in this instance</param>
 /// <param name="random">The random to be used</param>
 /// <param name="splits">The number SplitNeighbours to be generated</param>
 /// <param name="cumulativeHeuristic">Array with the cumulative heurstics for each node</param>
 public RandomMoveAndSplitNeighbourSpace(List <RecursiveTree <Node> > allRecTreeNodes, Random random, int splits, double[] cumulativeHeuristic)
 {
     Random = random;
     Splits = splits;
     MoveUpNeighbourSpace = new MoveUpNeighbourSpace(allRecTreeNodes, Random, cumulativeHeuristic);
     SplitNeighbourSpace  = new SplitNeighbourSpace(allRecTreeNodes, Random, cumulativeHeuristic);
 }
示例#2
0
        public Neighbour <RecursiveTree <Node> > GetRandomNeighbour(RecursiveTree <Node> data)
        {
            List <Neighbour <RecursiveTree <Node> > > neighbourlist = new List <Neighbour <RecursiveTree <Node> > >();

            // Create a random MoveUpNeighbour
            Neighbour <RecursiveTree <Node> > move = MoveUpNeighbourSpace.GetRandomNeighbour(data);

            neighbourlist.Add(move);

            // Generate Splits amount of random SplitNeighbours
            for (int i = 0; i < Splits; i++)
            {
                Neighbour <RecursiveTree <Node> > split = SplitNeighbourSpace.GetRandomNeighbour(data);
                neighbourlist.Add(split);
            }

            // Return the list with the single Move and multiple SplitNeighbours
            return(new MultipleNeighbourNeighbour <RecursiveTree <Node> >(neighbourlist));
        }