Example #1
0
        public override void Load(BinaryReader r, uint id)
        {
            base.Load(r, id);

            Target             = r.ReadInt32();
            IsOutputConnection = r.ReadBoolean();

            Weight = DoubleMinMax.Read(r);
        }
Example #2
0
        public override void Load(BinaryReader r, uint id)
        {
            base.Load(r, id);

            Bias = DoubleMinMax.Read(r);
            LoadListInfo(Connections, r);

            SigmoidFunction = BinarySerializable.GetObject <SigmoidFunction>(r);
        }
Example #3
0
        public override void Load(BinaryReader r, uint id)
        {
            base.Load(r, id);

            Brain          = ReadNullableObject <INeuralNet>(r);
            CreatureGenome = ReadNullableObject <Genome>(r);

            EyeNeuronsAmount = r.ReadInt32();
            EyeSpan          = r.ReadDouble();
            ViewDistance     = r.ReadInt32();
            Speed            = r.ReadDouble();
            RotationSpeed    = r.ReadDouble();
            Energy           = DoubleMinMax.Read(r);

            CanSeeCreatures = r.ReadBoolean();

            EnergyLossByTick     = r.ReadDouble();
            EnergyLossByRotation = r.ReadDouble();
            EnergyLossByMove     = r.ReadDouble();
            EnergyLossByEating   = r.ReadDouble();
            EnergyLossByMating   = r.ReadDouble();
            EatingBiteSize       = r.ReadDouble();

            MatingCandidate       = BinarySerializable.GetObject <Creature>(r);
            CyclesInMating        = r.ReadInt32();
            CyclesNeededForMating = r.ReadInt32();

            MatingCooldownCyclesLeft    = r.ReadInt32();
            MatingCooldown              = r.ReadInt32();
            AttackingCooldownCyclesLeft = r.ReadInt32();
            AttackingCooldown           = r.ReadInt32();
            AttackMultiplier            = r.ReadDouble();

            MaxAge = r.ReadInt32();

            PixelsRotatedLeft    = r.ReadDouble();
            PixelsRotatedRight   = r.ReadDouble();
            PixelsMovedForwards  = r.ReadDouble();
            PixelsMovedBackwards = r.ReadDouble();
            TimesHaveEaten       = r.ReadInt32();
            TimesMated           = r.ReadInt32();

            LoseEnergy       = r.ReadBoolean();
            IsThinking       = r.ReadBoolean();
            DisableMating    = r.ReadBoolean();
            DisableAttacking = r.ReadBoolean();

            AlwaysMate = r.ReadBoolean();
            AlwaysEat  = r.ReadBoolean();

            if (Brain != null)
            {
                EyeR_I        = LoadArrayInfo <IInputNeuron>(r);
                EyeG_I        = LoadArrayInfo <IInputNeuron>(r);
                EyeB_I        = LoadArrayInfo <IInputNeuron>(r);
                EyeDistance_I = LoadArrayInfo <IInputNeuron>(r);

                random_I = BinarySerializable.GetObject <IInputNeuron>(r);
                clock_I  = BinarySerializable.GetObject <IInputNeuron>(r);
                energy_I = BinarySerializable.GetObject <IInputNeuron>(r);

                rotate_O = BinarySerializable.GetObject <IOutputNeuron>(r);
                move_O   = BinarySerializable.GetObject <IOutputNeuron>(r);
                eat_O    = BinarySerializable.GetObject <IOutputNeuron>(r);
                mate_O   = BinarySerializable.GetObject <IOutputNeuron>(r);
                attack_O = BinarySerializable.GetObject <IOutputNeuron>(r);
            }
        }