diff --git a/organism/src/main.cpp b/organism/src/main.cpp index 40a7b25..01bc40e 100644 --- a/organism/src/main.cpp +++ b/organism/src/main.cpp @@ -37,10 +37,10 @@ std::vector agents; void init_attractant() { memset(attractant, 0.0, sizeof attractant); // draw a circle out of attractant - //for (int p = 0; p < 64; p++) { - // float angle = ((PI * 2) / 64) * p; - // int x = 31 + round(10 * sin(angle)); - // int y = 15 + round(10 * cos(angle)); + //for (int p = 0; p < PANEL_WIDTH; p++) { + // float angle = ((PI * 2) / PANEL_WIDTH) * p; + // int x = PANEL_WIDTH/2 + round(10 * sin(angle)); + // int y = PANEL_WIDTH/2 + round(10 * cos(angle)); // attractant[x][y] = 15.0; //} @@ -56,16 +56,16 @@ void init_attractant() { } void init_agents() { - AGENT_MOVE_DISTANCE = 1; //random(1, 3); + AGENT_MOVE_DISTANCE = 1; AGENT_MOVE_ANGLE = 0.175;//random(0, 334) / 1000.0; //if (random(0, 2) > 0) { // AGENT_SENSOR_ANGLE = 0.175; //} else { AGENT_SENSOR_ANGLE = 0.0875; //} - AGENT_SENSOR_DISTANCE = random(AGENT_SENSOR_DISTANCE_MIN * 1000.0, AGENT_SENSOR_DISTANCE_MAX * 1000.0) / 1000.0; NUM_AGENTS = random(NUM_AGENTS_MIN, NUM_AGENTS_MAX); + agents.clear(); for(int a = 0; a < NUM_AGENTS; a++) { float angle = ((PI * 2) / NUM_AGENTS) * a;