本文整理汇总了C#中IFunction.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IFunction.GetValue方法的具体用法?C# IFunction.GetValue怎么用?C# IFunction.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFunction
的用法示例。
在下文中一共展示了IFunction.GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FunctionRegressionView2D
/// <summary>
/// Constructs with the details of teh function regression problem to be visualized.
/// </summary>
/// <param name="func">The function being regressed.</param>
/// <param name="xMin">The minimum value of the input range being sampled.</param>
/// <param name="xIncr">The increment between input sample values.</param>
/// <param name="sampleCount">The number of samples over the input range.</param>
/// <param name="genomeDecoder">Genome decoder.</param>
public FunctionRegressionView2D(IFunction func, double xMin, double xIncr, int sampleCount, IGenomeDecoder<NeatGenome,IBlackBox> genomeDecoder)
{
InitializeComponent();
InitGraph(string.Empty, string.Empty, string.Empty);
_func = func;
_xMin = xMin;
_xIncr = xIncr;
_sampleCount = sampleCount;
_genomeDecoder = genomeDecoder;
// Prebuild plot point objects.
_plotPointListTarget = new PointPairList();
_plotPointListResponse = new PointPairList();
double[] args = new double[]{xMin};
for(int i=0; i<sampleCount; i++, args[0] += xIncr)
{
_plotPointListTarget.Add(args[0], _func.GetValue(args));
_plotPointListResponse.Add(args[0], 0.0);
}
// Bind plot points to graph.
zed.GraphPane.AddCurve("Target", _plotPointListTarget, Color.Black, SymbolType.None);
zed.GraphPane.AddCurve("Network Response", _plotPointListResponse, Color.Red, SymbolType.None);
}