CloneEngine

Helpers & Utilities · AiDotNet.Models

Executes a ClonePlan: reconstructs an instance and carries its configuration.

How It Works

This is the single implementation of “copy the configuration” in the library. Everything that clones routes through it, so a property cannot be carried correctly in one place and dropped in another — which is the failure that 1802 hand-written clone paths made possible.

Reconstruction rather than field copying. A fresh instance is created and the plan’s entries are applied to it. Anything not in the plan is therefore whatever the constructor produced, not a stale value carried over — so a derived or cached property is re-derived rather than duplicated. scikit-learn’s clone() works this way for the same reason; the difference here is that the plan is generated and checked at compile time instead of relying on a constructor convention verified only at test time.

Methods

Method Summary
object CopyConfiguration(object source) Creates a configuration copy of source.