示例#1
0
        /// <summary>
        /// Deep Copy of an membrane instance. VERY IMPORTANT!!! This will not coppy the connections to other instances, nor clone
        /// those instances. This must be done at a higher level where access to all instances of P system is available.
        /// </summary>
        /// <returns></returns>
        public MInstance Clone()
        {
            MInstance clone = new MInstance(multiset.Clone());

            PItem.CopyProperties(this, clone);
            LabelledPItem.CopyLabels(this, clone);

            return(clone);
        }
 public static void CopyLabels(LabelledPItem src, LabelledPItem dest)
 {
     if (src.labels != null)
     {
         dest.labels = new List <string>();
         foreach (string label in src.labels)
         {
             dest.labels.Add(label);
         }
     }
 }