Beispiel #1
0
        protected void Initialize(string choiceModelName, string coefficientsPath, int totalAlternatives,
                                  int totalNestedAlternatives, int totalLevels, int maxParameter,
                                  ICoefficientsReader reader = null)
        {
            if (coefficientsPath == null)
            {
                return;
            }

            _reader = reader;

            for (int x = 0; x < ParallelUtility.NBatches; x++)
            {
                ChoiceModelHelper.Initialize(ref _helpers[x], choiceModelName,
                                             Global.GetInputPath(coefficientsPath),
                                             totalAlternatives, totalNestedAlternatives, totalLevels, maxParameter, _reader);
            }
        }
Beispiel #2
0
        public static void Initialize(ref ChoiceModelHelper helper, string choiceModelName, string coefficientsPath,
                                      int totalAlternatives, int totalNestedAlternatives, int totalLevels, int maxParameter,
                                      ICoefficientsReader reader = null)
        {
            if (helper != null)
            {
                return;
            }

            var modelIsInEstimationMode = Global.Configuration.IsInEstimationMode &&
                                          Global.Configuration.EstimationModel == choiceModelName &&
                                          !Global.Configuration.TestEstimationModelInApplicationMode;

            helper = new ChoiceModelHelper
            {
                ModelIsInEstimationMode = modelIsInEstimationMode
            };

            helper.InitializeFactory(coefficientsPath, modelIsInEstimationMode, totalAlternatives, totalNestedAlternatives,
                                     totalLevels, maxParameter, reader);

            UpdateTimesModelRun(choiceModelName);
        }