Example #1
0
 public Cell(CellMode mode, Simulation container)
 {
     Mode      = mode;
     Mass      = 500;
     Alive     = true;
     Container = container;
 }
Example #2
0
        public Cell NewCell(CellMode mode, PointF location)
        {
            Cell c = mode.CreateCell(this);

            c.Location = location;
            cells.Add(c);
            return(c);
        }
Example #3
0
        public object Clone()
        {
            Genome other = new Genome();

            foreach (CellMode mode in modes)
            {
                CellMode clone = new CellMode(mode);
                other.modes.Add(clone);
            }
            for (int i = 0; i < modes.Count; i++)
            {
                CellMode local  = modes[i];
                CellMode remote = other.modes[i];
                remote.Child1 = other.modes[modes.IndexOf(local.Child1)];
                remote.Child2 = other.modes[modes.IndexOf(local.Child2)];
            }
            return(other);
        }
Example #4
0
 /// <summary>
 /// Copies the value parameters from other to the new mode.
 /// Does not copy child references.
 /// </summary>
 /// <param name="other">the mode to copy from</param>
 internal CellMode(CellMode other)
 {
     Type      = other.Type;
     SplitMass = other.SplitMass;
 }
Example #5
0
 public Genome()
 {
     modes       = new List <CellMode>();
     InitialMode = null;
 }
Example #6
0
 public Photocyte(CellMode mode, Simulation container) : base(mode, container)
 {
 }