本文整理汇总了C#中IFunction类的典型用法代码示例。如果您正苦于以下问题:C# IFunction类的具体用法?C# IFunction怎么用?C# IFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFunction类属于命名空间,在下文中一共展示了IFunction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetScriptBase
internal SetScriptBase(SetScriptConstructor constructor, IFunction<Element> appliesTo, string property)
{
m_constructor = constructor;
m_worldModel = constructor.WorldModel;
AppliesTo = appliesTo;
Property = property;
}
示例2: CreateExitScript
public CreateExitScript(WorldModel worldModel, IFunction<string> name, IFunction<Element> from, IFunction<Element> to)
{
m_worldModel = worldModel;
m_name = name;
m_from = from;
m_to = to;
}
示例3: ListAddScript
public ListAddScript(ScriptContext scriptContext, IFunctionGeneric list, IFunction<object> value)
{
m_scriptContext = scriptContext;
m_list = list;
m_value = value;
m_worldModel = scriptContext.WorldModel;
}
示例4: RequestScript
public RequestScript(ScriptContext scriptContext, string request, IFunction<string> data)
{
m_scriptContext = scriptContext;
m_worldModel = scriptContext.WorldModel;
m_data = data;
m_request = (Request)(Enum.Parse(typeof(Request), request));
}
示例5: SetFieldScript
public SetFieldScript(WorldModel worldModel, IFunction<Element> obj, IFunction<string> field, IFunction<object> value)
{
m_worldModel = worldModel;
m_obj = obj;
m_field = field;
m_value = value;
}
示例6: SimpleFuzzyRules
public SimpleFuzzyRules(double[][] dataIn, IFunction function, List<FuzzySet> fuzzySets)
{
this.function = function;
this.dataIn = dataIn;
dataOut = getDataOutputs();
rules = generateRules(fuzzySets);
}
示例7: Execute
public override void Execute(IFunction function, ResultRecord result) {
double value;
var votes = GetVotes().ToList();
function.Calculate(votes, result.ContentItemRecord.Id, out value);
result.Value = value;
result.Count = votes.Count;
}
示例8: Plot
Plot2DValue Plot(IFunction f, Double minx, Double maxx, Double precision)
{
var cp = new Plot2DValue();
var N = (Int32)((maxx - minx) / precision) + 1;
var M = new MatrixValue(N, 2);
var x = new ScalarValue(minx);
for (var i = 0; i < N; i++)
{
var row = i + 1;
var y = f.Perform(Context, x);
M[row, 1] = x.Clone();
if (y is ScalarValue)
{
M[row, 2] = (ScalarValue)y;
}
else if (y is MatrixValue)
{
var Y = (MatrixValue)y;
for (var j = 1; j <= Y.Length; j++)
{
M[row, j + 1] = Y[j];
}
}
x.Re += precision;
}
cp.AddPoints(M);
return cp;
}
示例9: DoActionScript
public DoActionScript(ScriptContext scriptContext, IFunction<Element> obj, IFunction<string> action)
{
m_scriptContext = scriptContext;
m_worldModel = scriptContext.WorldModel;
m_obj = obj;
m_action = action;
}
示例10: RunDelegateScript
public RunDelegateScript(WorldModel worldModel, IFunction<Element> obj, IFunction<string> del, IList<IFunction<object>> parameters)
{
m_worldModel = worldModel;
m_delegate = del;
m_parameters = new FunctionCallParameters(worldModel, parameters);
m_appliesTo = obj;
}
示例11: Integrate
public double Integrate(IFunction<Vector2, double> function)
{
double output = 0;
foreach (var finiteElement in FiniteElements)
;//output += finiteElement.Integrate(function);
return output;
}
示例12: IfScript
public IfScript(IFunction<bool> expression, IScript thenScript, IScript elseScript, WorldModel worldModel)
{
m_expression = expression;
m_thenScript = thenScript;
m_elseScript = elseScript;
m_worldModel = worldModel;
}
示例13: 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);
}
示例14: Execute
public override void Execute(IFunction function, ResultRecord result)
{
double value;
function.Create(result.Value, result.Count, Vote, out value);
result.Value = value;
result.Count++;
}
示例15: PlaySoundScript
public PlaySoundScript(WorldModel worldModel, IFunction<string> function, IFunction<bool> synchronous, IFunction<bool> loop)
{
m_worldModel = worldModel;
m_filename = function;
m_synchronous = synchronous;
m_loop = loop;
}