コード例 #1
0
        private void setParameter(Individual individual, string parameterName, OriginDataParameter originDataParameter, bool visible = true)
        {
            if (originDataParameter == null)
            {
                return;
            }

            var parameter = individual.Organism.Parameter(parameterName);

            if (parameter == null)
            {
                return;
            }

            var valueOrigin = individual.OriginData.ValueOrigin;

            var(value, unit) = originDataParameter;
            parameter.Value  = value;
            parameter.UpdateValueOriginFrom(valueOrigin);

            setParameterDisplayUnit(individual, parameterName, unit);
            parameter.Visible = visible;
        }
コード例 #2
0
        private double createDiseaseStateRandomParameterValueFor(OriginData originData, RandomPopulationSettings populationSettings, OriginDataParameter diseaseStateParameter, RandomGenerator randomGenerator, out bool success)
        {
            var parameterRange = populationSettings.ParameterRange(diseaseStateParameter.Name);
            var parameter      = originData.DiseaseState.Parameter(diseaseStateParameter.Name);

            return(tryCreateRandomValueFor(parameterRange, parameter, randomGenerator, out success));
        }