当前位置: 首页>>代码示例>>C#>>正文


C# INode.Clone方法代码示例

本文整理汇总了C#中INode.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# INode.Clone方法的具体用法?C# INode.Clone怎么用?C# INode.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INode的用法示例。


在下文中一共展示了INode.Clone方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegressionAlgorithm

 public RegressionAlgorithm(INode expression, IList<double[]> arguments, IList<double> result, double accurance = 0.0001, double lambda = 0.0001)
 {
     _inSamples = arguments;
     _exactResult = result;
     _precision = accurance;
     _lambda = lambda;
     Formula = expression.Clone<INode>();
     InConstant = new List<double>();
     BuildFunctional();
     _functional = Formula.ComplileDelegate<double>();
     ApproximationError = GetApproximationError(InConstant);
 }
开发者ID:vadimostanin,项目名称:CA,代码行数:12,代码来源:RegressionAlgorithm.cs

示例2: Reproduce

        /// <summary>
        /// A very simple reproduction algorithm. It starts with parent A and takes a single node
        /// from each parent and performs a crossover with those nodes.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public INode Reproduce(INode a, INode b)
        {
            // Clone parent A to start with
            INode child = (INode) a.Clone();

            // Get all the nodes in the child and parent b
            List<INode> childNodes = child.GetNodes();
            List<INode> bNodes = b.GetNodes();

            // Get a random node from the child and b
            INode childCrossoverNode = childNodes[RandomUtil.Random.Next(childNodes.Count - 1)];
            List<INode> bCandidates = FindNodeWithMatchingContext(childCrossoverNode, bNodes);
            if (bCandidates.Count == 0) return child;
            INode bCrossoverNode = bCandidates[RandomUtil.Random.Next(bCandidates.Count)];

            childCrossoverNode.ReplaceChild((INode) bCrossoverNode.Clone());
            return child;
        }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:25,代码来源:SimpleReproduction.cs

示例3: DivideNode

 public DivideNode(NodeContext context, INode numerator, INode denomiator)
 {
     this.context = (NodeContext) context.Clone();
     this.numerator = (INode) numerator.Clone();
     this.denomiator = (INode) denomiator.Clone();
 }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:6,代码来源:DivideNode.cs

示例4: Import

        /// <summary>
        /// Creates a copy of a node from an external document that can be 
        /// inserted into the current document.
        /// </summary>
        /// <param name="externalNode">
        /// The node from another document to be imported.
        /// </param>
        /// <param name="deep">
        /// Optional argument, indicating whether the descendants of the
        /// imported node need to be imported.
        /// </param>
        /// <returns>
        /// The new node that is imported into the document. The new node's
        /// parentNode is null, since it has not yet been inserted into the
        /// document tree.
        /// </returns>
        public INode Import(INode externalNode, Boolean deep = true)
        {
            if (externalNode.NodeType == NodeType.Document)
                throw new DomException(DomError.NotSupported);

            return externalNode.Clone(deep);
        }
开发者ID:workwebresources,项目名称:AngleSharp,代码行数:23,代码来源:Document.cs

示例5: CloneAndSet

 static INode[] CloneAndSet(INode[] array, int i, INode a)
 {
     INode[] clone = (INode[])array.Clone();
     clone[i] = a;
     return clone;
 }
开发者ID:davidadsit,项目名称:clojure-clr,代码行数:6,代码来源:PersistentHashMap.cs

示例6: SumNode

 public SumNode(NodeContext context, int collectionIndex, INode sumFunction)
 {
     this.Context = (NodeContext) context.Clone();
     this.collectionIndex = collectionIndex;
     this.sumFunction = (INode) sumFunction.Clone();
 }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:6,代码来源:SumNode.cs

示例7: SubtractNode

 public SubtractNode(NodeContext context, INode left, INode right)
 {
     this.context = (NodeContext) context.Clone();
     this.left = (INode) left.Clone();
     this.right = (INode) right.Clone();
 }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:6,代码来源:SubtractNode.cs

示例8: AddNode

 public AddNode(NodeContext context, INode right, INode left)
 {
     this.context = (NodeContext) context.Clone();
     this.right = (INode) right.Clone();
     this.left = (INode) left.Clone();
 }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:6,代码来源:AddNode.cs

示例9: MultiplyNode

 public MultiplyNode(NodeContext context, INode left, INode right)
 {
     this.context = (NodeContext) context.Clone();
     this.left = (INode) left.Clone();
     this.right = (INode) right.Clone();
 }
开发者ID:geoffsmith,项目名称:Genetic-Programming,代码行数:6,代码来源:MultiplyNode.cs


注:本文中的INode.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。