示例#1
0
        public static FeatureModel New(Dictionary <string, double> parameters)
        {
            int maxNumberOfOperations = (int)Math.Round(parameters["MaxNumberOfOperations"]);
            int width  = (int)Math.Round(parameters["Width"]);
            int height = (int)Math.Round(parameters["Height"]);

            int          numOfOperations = rand.Next(1, maxNumberOfOperations);
            int          operationLib    = operations.Count();
            FeatureModel f = new FeatureModel();

            for (int i = 0; i < numOfOperations; i++)
            {
                f.operationStack.Add(new AtomicOperation(rand.Next(0, width), rand.Next(0, height), rand.Next(0, operationLib)));
            }
            return(f);

            throw new NotImplementedException();
        }
示例#2
0
        public void ResetModels(Dictionary <string, double> parameters)
        {
            InternalModels.Clear();
            this.TrainCount                 = 0;
            this.ContextSet                 = false;
            this.LabelSet                   = false;
            this.sw                         = new Stopwatch();
            this.IndicationStrength         = new IndicationStrength();
            this.IndicationStrengthPerLabel = new Dictionary <Label, IndicationStrength>();


            int numberOfModels        = (int)Math.Round(parameters["NumberOfModels"]);
            int maxNumberOfOperations = (int)Math.Round(parameters["MaxNumberOfOperations"]);
            int width  = (int)Math.Round(parameters["Width"]);
            int height = (int)Math.Round(parameters["Height"]);

            for (int i = 0; i < numberOfModels; i++)
            {
                InternalModels.Add(FeatureModel.New(parameters));
            }
        }