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); }
public Protozoa love(Random rnd, Protozoa zoa) { Protozoa newZoa = new Protozoa(rnd, this, zoa); fetus = newZoa; cooldown += cooldownLove; return(newZoa); }
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++; }
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); }
private void moveZoa(Protozoa zoa, double time) { double viscosity = surface.getEffectAtPoint(zoa.centerP, SourceType.Viscosity); zoa.move(viscosity, time); }