Пример #1
0
        private void loadSimLab(string filename)
        {
            Runs = new List <ScenarioRun>();
            slf  = new SimlabFile();
            slf.Load(filename);

            for (int i = 0; i < slf.Samples.Values.First().Count(); i++)
            {
                ScenarioRun sc = new ScenarioRun();
                sc.Number      = i + 1;
                sc.ParamValues = new SortedList <CalibrationParameter, double?>();

                foreach (var v in slf.Samples.Keys)
                {
                    sc.ParamValues.Add(v, slf.Samples[v][i]);
                }
                Runs.Add(sc);
            }
            RaisePropertyChanged("Runs");
        }
Пример #2
0
        public void GenerateParameterSets()
        {
            Random R = new Random(SeedValue);

            Runs = new List <ScenarioRun>();

            for (int i = 0; i < NumberOfScenarios; i++)
            {
                ScenarioRun sc = new ScenarioRun();
                sc.Number      = i + 1;
                sc.ParamValues = new SortedList <CalibrationParameter, double?>();

                foreach (var v in Params.Where(var => var.ParType != ParameterType.Fixed & var.ParType != ParameterType.tied))
                {
                    sc.ParamValues.Add(v, null);
                }
                Runs.Add(sc);
            }


            foreach (var v in Params.Where(var => var.ParType != ParameterType.Fixed & var.ParType != ParameterType.tied))
            {
                double stepsize = (v.CurrentValue * 1.1 - v.CurrentValue * 0.9) / NumberOfScenarios;

                for (int i = 0; i < NumberOfScenarios; i++)
                {
                    int k;
                    while (Runs[k = R.Next(0, NumberOfScenarios)].ParamValues[v].HasValue)
                    {
                        ;
                    }

                    Runs[k].ParamValues[v] = R.NextDouble() * stepsize + v.MinValue + i * stepsize;
                }
            }
            RaisePropertyChanged("Runs");
        }
Пример #3
0
    private void loadSimLab(string filename)
    {

      Runs = new List<ScenarioRun>();
      slf = new SimlabFile();
      slf.Load(filename);

      for (int i = 0; i < slf.Samples.Values.First().Count(); i++)
      {
        ScenarioRun sc = new ScenarioRun();
        sc.Number = i + 1;
        sc.ParamValues = new SortedList<CalibrationParameter, double?>();

        foreach (var v in slf.Samples.Keys)
        {
          sc.ParamValues.Add(v, slf.Samples[v][i]);
        }
        Runs.Add(sc);
      }
      RaisePropertyChanged("Runs");

    }
Пример #4
0
    public void GenerateParameterSets()
    {
      Random R = new Random(SeedValue);

      Runs = new List<ScenarioRun>();

      for (int i = 0; i < NumberOfScenarios; i++)
      {
        ScenarioRun sc = new ScenarioRun();
        sc.Number = i + 1;
        sc.ParamValues = new SortedList<CalibrationParameter, double?>();

        foreach (var v in Params.Where(var => var.ParType != ParameterType.Fixed & var.ParType != ParameterType.tied))
          sc.ParamValues.Add(v, null);
        Runs.Add(sc);
      }


      foreach (var v in Params.Where(var => var.ParType != ParameterType.Fixed & var.ParType != ParameterType.tied))
      {
        double stepsize = (v.CurrentValue*1.1 - v.CurrentValue*0.9) / NumberOfScenarios;

        for (int i = 0; i < NumberOfScenarios; i++)
        {
          int k;
          while (Runs[k = R.Next(0, NumberOfScenarios)].ParamValues[v].HasValue) ;

          Runs[k].ParamValues[v] = R.NextDouble() * stepsize + v.MinValue + i * stepsize;
        }
      }
      RaisePropertyChanged("Runs");
    }