本文整理汇总了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;
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}