예제 #1
0
        private async Task <ParameterRange[]> snapshotDiseaseStateParameters(Model.Individual individual, RandomPopulationSettings randomPopulationSettings)
        {
            var diseaseStateParameterRanges = individual.OriginData?.DiseaseStateParameters
                                              .Select(x => randomPopulationSettings.ParameterRange(x.Name))
                                              .ToList();

            if (diseaseStateParameterRanges == null)
            {
                return(null);
            }

            if (!diseaseStateParameterRanges.Any())
            {
                return(null);
            }

            var snapshotParameterRanges = new List <ParameterRange>();

            foreach (var parameterRange in diseaseStateParameterRanges)
            {
                var snapshot = await _parameterRangeMapper.MapToSnapshot(parameterRange);

                snapshot.Name = parameterRange.ParameterName;
                snapshotParameterRanges.Add(snapshot);
            }

            return(snapshotParameterRanges.ToArray());
        }
예제 #2
0
 private Task <ParameterRange> snapshotRangeFor(RandomPopulationSettings randomPopulationSettings, string parameterName)
 {
     return(_parameterRangeMapper.MapToSnapshot(randomPopulationSettings.ParameterRange(parameterName)));
 }