public OldestAverageYoungestAgeAnalyzer() : base() { #region Create parameters Parameters.Add(new ScopeTreeLookupParameter <DoubleValue>("Age", "The value which represents the age of a solution.")); Parameters.Add(new ValueLookupParameter <DoubleValue>("CurrentOldestAge", "The oldest age value found in the current population.")); Parameters.Add(new ValueLookupParameter <DoubleValue>("CurrentAverageAge", "The average age value of all solutions in the current population.")); Parameters.Add(new ValueLookupParameter <DoubleValue>("CurrentYoungestAge", "The youngest age value found in the current population.")); Parameters.Add(new ValueLookupParameter <DataTable>("Ages", "The data table to store the current oldest, current average, current youngest age value.")); Parameters.Add(new ValueLookupParameter <ResultCollection>("Results", "The results collection where the analysis values should be stored.")); CurrentOldestAgeParameter.Hidden = true; CurrentAverageAgeParameter.Hidden = true; CurrentYoungestAgeParameter.Hidden = true; AgesParameter.Hidden = true; #endregion #region Create operators var oldestAverageYoungestAgeCalculator = new OldestAverageYoungestAgeCalculator(); var dataTableValuesCollector = new DataTableValuesCollector(); var resultsCollector = new ResultsCollector(); oldestAverageYoungestAgeCalculator.AverageAgeParameter.ActualName = CurrentAverageAgeParameter.Name; oldestAverageYoungestAgeCalculator.OldestAgeParameter.ActualName = CurrentOldestAgeParameter.Name; oldestAverageYoungestAgeCalculator.AgeParameter.ActualName = AgeParameter.Name; oldestAverageYoungestAgeCalculator.AgeParameter.Depth = AgeParameter.Depth; oldestAverageYoungestAgeCalculator.YoungestAgeParameter.ActualName = CurrentYoungestAgeParameter.Name; dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("CurrentOldestAge", null, CurrentOldestAgeParameter.Name)); dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("CurrentAverageAge", null, CurrentAverageAgeParameter.Name)); dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("CurrentYoungestAge", null, CurrentYoungestAgeParameter.Name)); dataTableValuesCollector.DataTableParameter.ActualName = AgesParameter.Name; resultsCollector.CollectedValues.Add(new LookupParameter <DataTable>(AgesParameter.Name)); resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name; #endregion #region Create operator graph OperatorGraph.InitialOperator = oldestAverageYoungestAgeCalculator; oldestAverageYoungestAgeCalculator.Successor = dataTableValuesCollector; dataTableValuesCollector.Successor = resultsCollector; resultsCollector.Successor = null; #endregion Initialize(); }
public OldestAverageYoungestAgeAnalyzer() : base() { #region Create parameters Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The value which represents the age of a solution.")); Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentOldestAge", "The oldest age value found in the current population.")); Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageAge", "The average age value of all solutions in the current population.")); Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentYoungestAge", "The youngest age value found in the current population.")); Parameters.Add(new ValueLookupParameter<DataTable>("Ages", "The data table to store the current oldest, current average, current youngest age value.")); Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection where the analysis values should be stored.")); CurrentOldestAgeParameter.Hidden = true; CurrentAverageAgeParameter.Hidden = true; CurrentYoungestAgeParameter.Hidden = true; AgesParameter.Hidden = true; #endregion #region Create operators var oldestAverageYoungestAgeCalculator = new OldestAverageYoungestAgeCalculator(); var dataTableValuesCollector = new DataTableValuesCollector(); var resultsCollector = new ResultsCollector(); oldestAverageYoungestAgeCalculator.AverageAgeParameter.ActualName = CurrentAverageAgeParameter.Name; oldestAverageYoungestAgeCalculator.OldestAgeParameter.ActualName = CurrentOldestAgeParameter.Name; oldestAverageYoungestAgeCalculator.AgeParameter.ActualName = AgeParameter.Name; oldestAverageYoungestAgeCalculator.AgeParameter.Depth = AgeParameter.Depth; oldestAverageYoungestAgeCalculator.YoungestAgeParameter.ActualName = CurrentYoungestAgeParameter.Name; dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentOldestAge", null, CurrentOldestAgeParameter.Name)); dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageAge", null, CurrentAverageAgeParameter.Name)); dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentYoungestAge", null, CurrentYoungestAgeParameter.Name)); dataTableValuesCollector.DataTableParameter.ActualName = AgesParameter.Name; resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(AgesParameter.Name)); resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name; #endregion #region Create operator graph OperatorGraph.InitialOperator = oldestAverageYoungestAgeCalculator; oldestAverageYoungestAgeCalculator.Successor = dataTableValuesCollector; dataTableValuesCollector.Successor = resultsCollector; resultsCollector.Successor = null; #endregion Initialize(); }
private OldestAverageYoungestAgeCalculator(OldestAverageYoungestAgeCalculator original, Cloner cloner) : base(original, cloner) { }
private OldestAverageYoungestAgeCalculator(OldestAverageYoungestAgeCalculator original, Cloner cloner) : base(original, cloner) { }