Beispiel #1
0
        protected override void Context()
        {
            sut = new PopulationAnalysisFlatTableCreator();
            _populationDataCollector = A.Fake <PopulationSimulationComparison>();
            _populationAnalysis      = new PopulationPivotAnalysis();

            _ageField = new PopulationAnalysisParameterField {
                ParameterPath = "Path", Name = "Age"
            };
            _populationAnalysis.Add(_ageField);

            //add derived field age class
            var groupingDefinition = new FixedLimitsGroupingDefinition("Age");

            groupingDefinition.SetLimits(new[] { 14d }.OrderBy(x => x));
            groupingDefinition.AddItems(new[]
            {
                new GroupingItem {
                    Label = "Children", Color = Color.Blue
                },
                new GroupingItem {
                    Label = "Adults", Color = Color.Red
                }
            });
            _ageClassField = new PopulationAnalysisGroupingField(groupingDefinition)
            {
                Name = "AgeClass"
            };
            _populationAnalysis.Add(_ageClassField);

            _ageValues = new List <double> {
                8d, 14d, 21d
            };
            _ageClassValues = new[] { "Children", "Adults", "Adults" };
        }
Beispiel #2
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            var userSettings = A.Fake <ICoreUserSettings>();

            userSettings.NumberOfIndividualsPerBin = 1;
            userSettings.NumberOfBins = 2;
            _binIntervalsCreator      = new BinIntervalsCreator(userSettings);
            sut = new RangeChartDataCreator(_dimensionRepository, _pivotResultCreator, _binIntervalsCreator);
        }
        protected override void Context()
        {
            _pivotAnalysis = new PopulationBoxWhiskerAnalysis();
            _aggregate     = AggregationFunctions.BoxWhisker90Aggregation;
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _pivotAnalysis.SetPosition(_genderField, PivotArea.RowArea, 0);
            _pivotAnalysis.SetPosition(_raceField, PivotArea.RowArea, 1);
            _pivotAnalysis.SetPosition(_bmiClass, PivotArea.ColumnArea, 0);
            _pivotAnalysis.SetPosition(_cmaxField, PivotArea.DataArea, 0);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            sut = new BoxWhiskerChartDataCreator(_dimensionRepository, _pivotResultCreator);
        }
Beispiel #4
0
        protected override void Context()
        {
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            _populationAnalysis      = A.Fake <PopulationAnalysis>();
            A.CallTo(() => _populationDataCollector.NumberOfItems).Returns(100);
            _numericField = A.Fake <PopulationAnalysisNumericField>();

            A.CallTo(() => _populationAnalysis.FieldByName(_fieldName)).Returns(_numericField);
            _fixedLimitsGroupingDefinition = new FixedLimitsGroupingDefinition(_fieldName);
            _fixedLimitsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.AgeGroups);
            _fixedLimitsGroupingDefinition.SetLimits((new[] { 14D, 18D }).OrderBy(x => x));

            _dt = createData();
            A.CallTo(() => _numericField.GetValues(_populationDataCollector)).Returns(_dt.AllValuesInColumn <double>(_fieldName).ToList());
            sut = new PopulationAnalysisGroupingField(_fixedLimitsGroupingDefinition)
            {
                Name = _sutName
            };
        }
Beispiel #5
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            sut = new ScatterChartDataCreator(_dimensionRepository, _pivotResultCreator);
        }
Beispiel #6
0
 public void UpdateGroupingDefinition()
 {
     _groupingDefinition.Items.Clear();
     _groupingDefinition.SetLimits(calculateLimits().OrderBy(x => x));
     _groupingDefinition.AddItems(_fixedLimitDTOs.Select(x => x.ToGroupingItem()));
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _populationAnalysis = new PopulationPivotAnalysis();

            _pkParameterField              = new PopulationAnalysisPKParameterField().WithName("PKParam");
            _pkParameterField.PKParameter  = "AUC";
            _pkParameterField.QuantityPath = "A|B|C";
            _pkParameterField.QuantityType = QuantityType.Drug;
            _pkParameterField.Dimension    = _dimensionRepository.MassConcentration;

            _parameterField = new PopulationAnalysisParameterField().WithName("Param");
            _parameterField.ParameterPath = "A|B|C|D";
            _parameterField.Dimension     = _dimensionRepository.Auc;

            _outputField = new PopulationAnalysisOutputField().WithName("Output");
            _outputField.QuantityPath = "A|B|C";
            _outputField.Dimension    = _dimensionRepository.Auc;
            _outputField.Color        = Color.Aquamarine;

            _genderField = new PopulationAnalysisCovariateField {
                Covariate = "Gender"
            }.WithName("Gender");
            var numberOfBinsGroupingDefinition = new NumberOfBinsGroupingDefinition(_parameterField.Name)
            {
                NumberOfBins = 2
            };

            numberOfBinsGroupingDefinition.NamingPattern = "AA";
            numberOfBinsGroupingDefinition.StartColor    = Color.AliceBlue;
            numberOfBinsGroupingDefinition.EndColor      = Color.RoyalBlue;
            numberOfBinsGroupingDefinition.Strategy      = LabelGenerationStrategies.Roman;
            numberOfBinsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _numberOfBinsDerivedField = new PopulationAnalysisGroupingField(numberOfBinsGroupingDefinition).WithName("NumberOfBins");

            var fixedLimitsGroupingDefinition = new FixedLimitsGroupingDefinition(_pkParameterField.Name);

            fixedLimitsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.AgeGroups);

            _fixedLimitsGroupingDefinitionField = new PopulationAnalysisGroupingField(fixedLimitsGroupingDefinition)
                                                  .WithName("FixedLimits");

            fixedLimitsGroupingDefinition.SetLimits(new[] { 1d, 2d }.OrderBy(x => x));

            _derivedFieldWithFixedExpression = new PopulationAnalysisExpressionField("A+B")
                                               .WithName("FixedExpression");


            var valueMappingGroupingDefinition = new ValueMappingGroupingDefinition(_genderField.Name);

            valueMappingGroupingDefinition.AddValueLabel("Male", PopulationAnalysisHelperForSpecs.GroupingItemMale);
            valueMappingGroupingDefinition.AddValueLabel("Female", PopulationAnalysisHelperForSpecs.GroupingItemFemale);
            var valueMappingGroupingDefinitionField = new PopulationAnalysisGroupingField(valueMappingGroupingDefinition).WithName("ValueMapping");

            _populationAnalysis.Add(_pkParameterField);
            _populationAnalysis.Add(_parameterField);
            _populationAnalysis.Add(_genderField);
            _populationAnalysis.Add(_numberOfBinsDerivedField);
            _populationAnalysis.Add(_fixedLimitsGroupingDefinitionField);
            _populationAnalysis.Add(_derivedFieldWithFixedExpression);
            _populationAnalysis.Add(valueMappingGroupingDefinitionField);
            _populationAnalysis.Add(_outputField);
        }