示例#1
0
        public InteractResult interactWithZoa(Protozoa zoa, double toxicity)
        {
            double[] input = new double[]
            {
                zoa.fire,
                zoa.grass,
                zoa.ocean,
                toxicity,
                fear,
                energy
            };
            double[] res    = genome.interactZoaNet.calc(input);
            double   toEat  = res[0];
            double   toLove = res[1];

            if (toEat < 0 && toLove < 0)
            {
                return(InteractResult.Nothing);
            }
            if (toLove > toEat)
            {
                return(InteractResult.Love);
            }

            eat(zoa.fire, zoa.grass, zoa.ocean, toxicity);
            return(InteractResult.Eat);
        }
示例#2
0
        public Protozoa love(Random rnd, Protozoa zoa)
        {
            Protozoa newZoa = new Protozoa(rnd, this, zoa);

            fetus     = newZoa;
            cooldown += cooldownLove;
            return(newZoa);
        }
示例#3
0
 public void addZoa(Protozoa zoa)
 {
     zoa.id = counter;
     protozoas.Add(zoa.id, zoa);
     pointsManager.addDinamicPoint(
         zoa.centerP, zoa.viewDepth * zoa.radius, zoa.id, ZoaType, new KeyValuePair <object, object>(WorldObjectType, zoa)
         );
     counter++;
 }
示例#4
0
            genome;                 //container for constructor and control nets

        public Protozoa(Random rnd, Protozoa primaryParent, Protozoa secondaryParent, long id = 0)
        {
            this.id = id;
            centerP = primaryParent.centerP;
            genome  = new Genome(rnd, primaryParent.genome, secondaryParent.genome);
            applyConstructor(genome.constructor);

            moveVector.setStart(centerP);
        }
示例#5
0
        private void moveZoa(Protozoa zoa, double time)
        {
            double viscosity = surface.getEffectAtPoint(zoa.centerP, SourceType.Viscosity);

            zoa.move(viscosity, time);
        }