本文整理汇总了C#中IFunction类的典型用法代码示例。如果您正苦于以下问题:C# IFunction类的具体用法?C# IFunction怎么用?C# IFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFunction类属于命名空间,在下文中一共展示了IFunction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SetScriptBase
internal SetScriptBase(SetScriptConstructor constructor, IFunction<Element> appliesTo, string property)
{
m_constructor = constructor;
m_worldModel = constructor.WorldModel;
AppliesTo = appliesTo;
Property = property;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:SetScript.cs
示例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;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:CreateScript.cs
示例3: ListAddScript
public ListAddScript(ScriptContext scriptContext, IFunctionGeneric list, IFunction<object> value)
{
m_scriptContext = scriptContext;
m_list = list;
m_value = value;
m_worldModel = scriptContext.WorldModel;
}
开发者ID:JatinR,项目名称:quest,代码行数:7,代码来源:ListAddScript.cs
示例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));
}
开发者ID:JatinR,项目名称:quest,代码行数:7,代码来源:RequestScript.cs
示例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;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:SetFieldScript.cs
示例6: SimpleFuzzyRules
public SimpleFuzzyRules(double[][] dataIn, IFunction function, List<FuzzySet> fuzzySets)
{
this.function = function;
this.dataIn = dataIn;
dataOut = getDataOutputs();
rules = generateRules(fuzzySets);
}
开发者ID:kepisty89,项目名称:fuzzyRules,代码行数:7,代码来源:SimpleFuzzyRules.cs
示例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;
}
开发者ID:NickAndersonX,项目名称:xodb,代码行数:7,代码来源:Calculus.cs
示例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;
}
开发者ID:FlorianRappl,项目名称:YAMP,代码行数:33,代码来源:FplotFunction.cs
示例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;
}
开发者ID:JatinR,项目名称:quest,代码行数:7,代码来源:DoScript.cs
示例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;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:RunDelegateScript.cs
示例11: Integrate
public double Integrate(IFunction<Vector2, double> function)
{
double output = 0;
foreach (var finiteElement in FiniteElements)
;//output += finiteElement.Integrate(function);
return output;
}
开发者ID:phamhathanh,项目名称:2DFEM,代码行数:7,代码来源:Mesh.cs
示例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;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:IfScript.cs
示例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);
}
开发者ID:homoluden,项目名称:SharpNEAT,代码行数:34,代码来源:FunctionRegressionView2D.cs
示例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++;
}
开发者ID:Timbioz,项目名称:SciGitAzure,代码行数:7,代码来源:Calculus.cs
示例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;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:PlaySoundScript.cs
示例16: DictionaryAddScript
public DictionaryAddScript(WorldModel worldModel, IFunctionGeneric dictionary, IFunction<string> key, IFunction<object> value)
{
m_dictionary = dictionary;
m_key = key;
m_value = value;
m_worldModel = worldModel;
}
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:DictionaryAddScript.cs
示例17: SetScriptBase
internal SetScriptBase(SetScriptConstructor constructor, IFunction appliesTo, string property, GameLoader loader)
{
m_constructor = constructor;
AppliesTo = appliesTo;
Property = property;
m_loader = loader;
}
开发者ID:jaynabonne,项目名称:quest,代码行数:7,代码来源:SetScript.cs
示例18: Default
/// <summary>Defaults.</summary>
/// <param name="d">The Descriptor to process.</param>
/// <param name="x">The Vector to process.</param>
/// <param name="y">The Vector to process.</param>
/// <param name="activation">The activation.</param>
/// <returns>A Network.</returns>
public static Network Default(Descriptor d, Matrix x, Vector y, IFunction activation)
{
var nn = new Network();
// set output to number of choices of available
// 1 if only two choices
var distinct = y.Distinct().Count();
var output = distinct > 2 ? distinct : 1;
// identity funciton for bias nodes
IFunction ident = new Ident();
// set number of hidden units to (Input + Hidden) * 2/3 as basic best guess.
var hidden = (int)Math.Ceiling((decimal)(x.Cols + output) * 2m / 3m);
// creating input nodes
nn.In = new Node[x.Cols + 1];
nn.In[0] = new Node { Label = "B0", Activation = ident };
for (var i = 1; i < x.Cols + 1; i++)
{
nn.In[i] = new Node { Label = d.ColumnAt(i - 1), Activation = ident };
}
// creating hidden nodes
var h = new Node[hidden + 1];
h[0] = new Node { Label = "B1", Activation = ident };
for (var i = 1; i < hidden + 1; i++)
{
h[i] = new Node { Label = string.Format("H{0}", i), Activation = activation };
}
// creating output nodes
nn.Out = new Node[output];
for (var i = 0; i < output; i++)
{
nn.Out[i] = new Node { Label = GetLabel(i, d), Activation = activation };
}
// link input to hidden. Note: there are
// no inputs to the hidden bias node
for (var i = 1; i < h.Length; i++)
{
for (var j = 0; j < nn.In.Length; j++)
{
Edge.Create(nn.In[j], h[i]);
}
}
// link from hidden to output (full)
for (var i = 0; i < nn.Out.Length; i++)
{
for (var j = 0; j < h.Length; j++)
{
Edge.Create(h[j], nn.Out[i]);
}
}
return nn;
}
开发者ID:ChewyMoon,项目名称:Cupcake,代码行数:65,代码来源:Network.cs
示例19: WhileScript
public WhileScript(ScriptContext scriptContext, IScriptFactory scriptFactory, IFunction<bool> expression, IScript loopScript)
{
m_scriptContext = scriptContext;
m_worldModel = scriptContext.WorldModel;
m_scriptFactory = scriptFactory;
m_expression = expression;
m_loopScript = loopScript;
}
开发者ID:JatinR,项目名称:quest,代码行数:8,代码来源:WhileScript.cs
示例20: pushFunction
public void pushFunction(IFunction func)
{
if (stkFunction == null)
{
stkFunction = new Stack();
}
stkFunction.Push(func);
}
开发者ID:nholik,项目名称:Fo.Net,代码行数:8,代码来源:PropertyInfo.cs
注:本文中的IFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论