public TestModuleGenome(TestModuleGenome template) { parentID = template.parentID; inno = template.inno; maxSpeed = template.maxSpeed; accel = template.accel; radius = template.radius; }
// This class "holds" the various input/output channels for use in the Agent's Brain public TestModuleGenome(int parentID, BrainModuleID inno) { this.parentID = parentID; this.inno = inno; maxSpeed = 2f; accel = 0.04f; radius = 1f; }
public void Initialize(TestModuleGenome genome, Agent agent, StartPositionGenome startPos) { ownRigidBody2D = agent.GetComponent <Rigidbody2D>(); bias = new float[1]; //0 foodPosX = new float[1]; //1 foodPosY = new float[1]; // 2 foodDirX = new float[1]; // 3 foodDirY = new float[1]; // 4 foodTypeR = new float[1]; // 5 foodTypeG = new float[1]; // 6 foodTypeB = new float[1]; // 7 friendPosX = new float[1]; // 8 friendPosY = new float[1]; // 9 friendVelX = new float[1]; // 10 friendVelY = new float[1]; // 11 friendDirX = new float[1]; // 12 friendDirY = new float[1]; // 13 enemyPosX = new float[1]; // 14 enemyPosY = new float[1]; // 15 enemyVelX = new float[1]; // 16 enemyVelY = new float[1]; // 17 enemyDirX = new float[1]; // 18 enemyDirY = new float[1]; // 19 ownVelX = new float[1]; // 20 ownVelY = new float[1]; // 21 temperature = new float[1]; // 22 pressure = new float[1]; // 23 isContact = new float[1]; // 24 contactForceX = new float[1]; // 25 contactForceY = new float[1]; // 26 hitPoints = new float[1]; // 27 stamina = new float[1]; // 28 foodAmountR = new float[1]; // 29 foodAmountG = new float[1]; // 30 foodAmountB = new float[1]; // 31 distUp = new float[1]; // 32 // start up and go clockwise! distTopRight = new float[1]; // 33 distRight = new float[1]; // 34 distBottomRight = new float[1]; // 35 distDown = new float[1]; // 36 distBottomLeft = new float[1]; // 37 distLeft = new float[1]; // 38 distTopLeft = new float[1]; // 39 inComm0 = new float[1]; // 40 inComm1 = new float[1]; // 41 inComm2 = new float[1]; // 42 inComm3 = new float[1]; // 43 // 44 Total Inputs throttleX = new float[1]; // 0 throttleY = new float[1]; // 1 dash = new float[1]; // 2 outComm0 = new float[1]; // 3 outComm1 = new float[1]; // 4 outComm2 = new float[1]; // 5 outComm3 = new float[1]; // 6 // 7 Total Outputs //maxHealth = genome.maxHealth; //health = maxHealth; //prevHealth = health; bias[0] = 1f; foodAmountR[0] = 0.5f; foodAmountG[0] = 0.5f; foodAmountB[0] = 0.5f; hitPoints[0] = 1f; stamina[0] = 1f; //if(genome!= null) { // Debug.Log("!null -- genome.parentID" + genome.parentID.ToString()); //} //Debug.Log("genome.parentID" + genome.parentID.ToString()); parentID = genome.parentID; inno = genome.inno; //isVisible = agent.isVisible; //component = agent.segmentList[parentID].AddComponent<HealthModuleComponent>(); //if (component == null) { // Debug.LogAssertion("No existing HealthModuleComponent on segment " + parentID.ToString()); //} //component.healthModule = this; }
public NID(BrainModuleID moduleID, int neuronID) { this.moduleID = moduleID; this.neuronID = neuronID; }