Esempio n. 1
0
        private void initOptions()
        {
            int nIterations = _researchData.Updates[0].Count;

            float[,] optionRange = SimOptions.optionRange;
            int numberOfVars = (int)optionRange.GetLength(0);

            float[]    optionsValues = new float[numberOfVars];
            SimOptions currentOption;

            for (int o = 0; o < trialGroupSize; o++)
            {
                for (int i = 0; i < numberOfVars; i++)
                {
                    optionsValues[i] = (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (optionRange[i, 1] - optionRange[i, 0]) + optionRange[i, 0];
                }
                currentOption = new SimOptions(optionsValues[0], optionsValues[1], optionsValues[2], optionsValues[3], optionsValues[4], optionsValues[5]);
                //currentOption = new SimOptions(1, 1, 4.410256f, 1.1148f, 1.014489f);

                currentOption.decayOfInteration = new float[nIterations];
                for (int i = 0; i < nIterations; i++)
                {
                    currentOption.decayOfInteration[i] = (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (optionRange[5, 1] - optionRange[5, 0]) + optionRange[5, 0];
                }
                options[o] = currentOption;
            }
        }
Esempio n. 2
0
 private void init()
 {
     _researchData = new ResearchData();
     options       = new SimOptions[trialGroupSize];
     performances  = new PredictionPerformances[trialGroupSize];
     experiments   = new Experiment[trialGroupSize];
     bestOption    = new SimOptions();
 }
Esempio n. 3
0
        public static void WriteBest(SimOptions option)
        {
            using (FileStream fs = File.Open(@"bestOption.json", FileMode.Create))
                using (StreamWriter sw = new StreamWriter(fs))
                    using (JsonWriter jw = new JsonTextWriter(sw))
                    {
                        jw.Formatting = Formatting.Indented;

                        JsonSerializer serializer = new JsonSerializer();
                        serializer.Serialize(jw, option);
                    }
        }
Esempio n. 4
0
 private void findBestOption()
 {
     for (int e = 0; e < trialGroupSize; e++)
     {
         if (performances[e].occupancyPerformance > bestPerformanceNumber)
         {
             bestPerformanceNumber = performances[e].occupancyPerformance;
             bestPerformance       = performances[e];
             bestOption            = options[e];
         }
     }
 }
Esempio n. 5
0
        private void initOptions()
        {
            float[,] optionRange = SimOptions.optionRange;
            int numberOfVars = (int)optionRange.GetLength(0);

            float[] optionsValues = new float[numberOfVars];
            for (int o = 0; o < trialGroupSize; o++)
            {
                for (int i = 0; i < numberOfVars; i++)
                {
                    optionsValues[i] = (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (float)rand.NextDouble() * (optionRange[i, 1] - optionRange[i, 0]) + optionRange[i, 0];
                }
                options[o] = new SimOptions(optionsValues[0], optionsValues[1], optionsValues[2], optionsValues[3], optionsValues[4], optionsValues[5]);
            }
        }
Esempio n. 6
0
 public Experiment(ResearchData _data, SimOptions _options)
 {
     options = _options;
     data    = _data;
 }
 public ExperimentIterationSpecific(ResearchData _data, SimOptions _options)
 {
     options       = _options;
     _researchData = _data;
 }