AIXI.Utils.RandomDouble C# (CSharp) Méthode

RandomDouble() public static méthode

public static RandomDouble ( double min, double max ) : double
min double
max double
Résultat double
        public static double RandomDouble(double min, double max)
        {
            return Rnd.NextDouble() * (max - min) + min;
        }

Usage Example

Exemple #1
0
        override public int Search()
        {
            CtwContextTreeUndo undoInstance = new CtwContextTreeUndo(this);

            MonteCarloSearchNode searchTree = new MonteCarloSearchNode(MonteCarloSearchNode.DecisionNode);

            for (int i = 0; i < this.McSimulations; i++)
            {
                searchTree.Sample(this, this.Horizon);
                this.model_revert(undoInstance);
            }

            //searchTree.PrintBs();


            int    bestAction = -1;
            double bestMean   = double.NegativeInfinity;

            foreach (int action in this.Environment.ValidActions)
            {
                if (!searchTree.Children.ContainsKey(action))
                {
                    continue;
                }

                double mean = searchTree.Children[action].Mean + Utils.RandomDouble(0, 0.0001);
                if (mean > bestMean)
                {
                    bestMean   = mean;
                    bestAction = action;
                }
            }
            return(bestAction);
        }
All Usage Examples Of AIXI.Utils::RandomDouble