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


C# Cloner.Clone方法代码示例

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


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

示例1: Solution

 private Solution(Solution original, Cloner cloner)
   : base(original, cloner) {
   SymbolicExpressionTree = cloner.Clone(original.SymbolicExpressionTree);
   World = cloner.Clone(original.World);
   MaxTimeSteps = original.MaxTimeSteps;
   Quality = original.Quality;
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:Trail.cs

示例2: OperatorGraph

 protected OperatorGraph(OperatorGraph original, Cloner cloner)
   : base(original, cloner) {
   operators = cloner.Clone(original.operators);
   initialOperator = cloner.Clone(original.initialOperator);
   visualizationInfo = cloner.Clone(original.visualizationInfo);
   Initialize();
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:OperatorGraph.cs

示例3: Solution

 private Solution(Solution original, Cloner cloner)
   : base(original, cloner) {
   Tree = cloner.Clone(original.Tree);
   Path = (string)original.Path.Clone();
   NrOfRounds = original.NrOfRounds;
   Enemies = cloner.Clone(original.Enemies);
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:Solution.cs

示例4: PathTSPTour

 private PathTSPTour(PathTSPTour original, Cloner cloner)
   : base(original, cloner) {
   this.coordinates = cloner.Clone(original.coordinates);
   this.permutation = cloner.Clone(original.permutation);
   this.quality = cloner.Clone(original.quality);
   Initialize();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:PathTSPTour.cs

示例5: Arc

 protected Arc(Arc original, Cloner cloner)
   : base(original, cloner) {
   Source = cloner.Clone(original.Source);
   Target = cloner.Clone(original.Target);
   label = original.Label;
   weight = original.Weight;
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:Arc.cs

示例6: SymbolicDataAnalysisModel

 protected SymbolicDataAnalysisModel(SymbolicDataAnalysisModel original, Cloner cloner)
   : base(original, cloner) {
   this.symbolicExpressionTree = cloner.Clone(original.symbolicExpressionTree);
   this.interpreter = cloner.Clone(original.interpreter);
   this.lowerEstimationLimit = original.lowerEstimationLimit;
   this.upperEstimationLimit = original.upperEstimationLimit;
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:SymbolicDataAnalysisModel.cs

示例7: ConnectionInfo

 protected ConnectionInfo(ConnectionInfo original, Cloner cloner)
   : base(original, cloner) {
   from = cloner.Clone(original.from);
   connectorFrom = original.ConnectorFrom;
   to = cloner.Clone(original.To);
   connectorTo = original.ConnectorTo;
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:ConnectionInfo.cs

示例8: Job

 protected Job(Job original, Cloner cloner)
   : base(original, cloner) {
   this.dueDate = original.DueDate;
   this.index = original.Index;
   this.tasks = cloner.Clone(original.Tasks);
   RegisterEventHandlers();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:Job.cs

示例9: Solution

 private Solution(Solution original, Cloner cloner)
   : base(original, cloner) {
   this.Length = original.Length;
   this.Width = original.Width;
   this.Tree = cloner.Clone(original.Tree);
   this.Quality = original.Quality;
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:Solution.cs

示例10: CalculateImpactAndReplacementValues

    public override void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node,
      IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
      double qualityForImpactsCalculation = Double.NaN) {
      var classificationModel = (ISymbolicClassificationModel)model;
      var classificationProblemData = (IClassificationProblemData)problemData;

      if (double.IsNaN(qualityForImpactsCalculation))
        qualityForImpactsCalculation = CalculateQualityForImpacts(classificationModel, classificationProblemData, rows);

      replacementValue = CalculateReplacementValue(classificationModel, node, classificationProblemData, rows);
      var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue };

      var cloner = new Cloner();
      var tempModel = cloner.Clone(classificationModel);
      var tempModelNode = (ISymbolicExpressionTreeNode)cloner.GetClone(node);

      var tempModelParentNode = tempModelNode.Parent;
      int i = tempModelParentNode.IndexOfSubtree(tempModelNode);
      tempModelParentNode.RemoveSubtree(i);
      tempModelParentNode.InsertSubtree(i, constantNode);

      OnlineCalculatorError errorState;
      var dataset = classificationProblemData.Dataset;
      var targetClassValues = dataset.GetDoubleValues(classificationProblemData.TargetVariable, rows);
      var estimatedClassValues = tempModel.GetEstimatedClassValues(dataset, rows);
      newQualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, estimatedClassValues, out errorState);
      if (errorState != OnlineCalculatorError.None) newQualityForImpactsCalculation = 0.0;

      impactValue = qualityForImpactsCalculation - newQualityForImpactsCalculation;
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:30,代码来源:SymbolicClassificationSolutionImpactValuesCalculator.cs

示例11: NcaModel

 protected NcaModel(NcaModel original, Cloner cloner)
   : base(original, cloner) {
   this.transformationMatrix = (double[,])original.transformationMatrix.Clone();
   this.allowedInputVariables = (string[])original.allowedInputVariables.Clone();
   this.nnModel = cloner.Clone(original.nnModel);
   this.classValues = (double[])original.classValues.Clone();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:NcaModel.cs

示例12: TwoPointFiveMove

 private TwoPointFiveMove(TwoPointFiveMove original, Cloner cloner)
   : base(original, cloner) {
   this.Index1 = original.Index1;
   this.Index2 = original.Index2;
   this.IsInvert = original.IsInvert;
   this.Permutation = cloner.Clone(original.Permutation);
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:TwoPointFiveMove.cs

示例13: AdditiveMove

 protected AdditiveMove(AdditiveMove original, Cloner cloner)
   : base(original, cloner) {
   this.Dimension = original.Dimension;
   this.MoveDistance = original.MoveDistance;
   if (original.RealVector != null)
     this.RealVector = cloner.Clone(original.RealVector);
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:AdditiveMove.cs

示例14: QAPAssignment

 private QAPAssignment(QAPAssignment original, Cloner cloner)
   : base(original, cloner) {
   distances = cloner.Clone(original.distances);
   weights = cloner.Clone(original.weights);
   assignment = cloner.Clone(original.assignment);
   quality = cloner.Clone(original.quality);
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:7,代码来源:QAPAssignment.cs

示例15: OperatorGraphVisualizationInfo

    private OperatorGraphVisualizationInfo(OperatorGraphVisualizationInfo original, Cloner cloner)
      : base(original, cloner) {
      operatorShapeInfoMapping = new BidirectionalLookup<IOperator, IOperatorShapeInfo>();
      operatorParameterCollectionMapping = new BidirectionalLookup<IOperator, IKeyedItemCollection<string, IParameter>>();
      parameterOperatorMapping = new Dictionary<IParameter, IOperator>();

      operatorGraph = cloner.Clone(original.operatorGraph);
      RegisterOperatorGraphEvents();
      oldInitialShape = cloner.Clone(original.oldInitialShape);
      oldInitialShapeColor = original.oldInitialShapeColor;

      foreach (KeyValuePair<IOperator, IOperatorShapeInfo> pair in original.operatorShapeInfoMapping.FirstEnumerable) {
        IOperator op = cloner.Clone(pair.Key);
        IOperatorShapeInfo shapeInfo = cloner.Clone(pair.Value);
        RegisterOperatorEvents(op);
        operatorParameterCollectionMapping.Add(op, op.Parameters);
        operatorShapeInfoMapping.Add(op, shapeInfo);
      }

      foreach (IOperator oper in operatorShapeInfoMapping.FirstValues) {
        foreach (IParameter param in oper.Parameters) {
          parameterOperatorMapping.Add(param, oper);
          IValueParameter opParam = param as IValueParameter;
          if (opParam != null && typeof(IOperator).IsAssignableFrom(param.DataType))
            RegisterOperatorParameterEvents(opParam);
          else
            RegisterParameterEvents(param);
        }
      }
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:30,代码来源:OperatorGraphVisualizationInfo.cs


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