void Ocean::initCells(void) { addEmptyCells(); addObstacles(); addPredators(); addPrey(); displayStats(-1); displayBorder(); Ocean1 = this; }
void Ocean::run(void) { unsigned numIterations = DefaultNumIterations; // instead of cin if (numIterations > 1000) numIterations = DefaultNumIterations; for (unsigned iteration = 0; iteration < numIterations; iteration++) { if (numPredators > 0 && numPrey > 0) { for (unsigned row = 0; row < numRows; row++) for (unsigned col = 0; col < numCols; col++) cells[row][col]->process(); displayStats(iteration); displayCells(); displayBorder(); } } }
void displayHumidityScreenLive(){ displayBorder(); int i; GLCDD_Rect r; r.w = 128 - 10; //r.h = -1; r.h = 5; // Humidity r.x = 20; r.y = 12; GLCDD_Printf(fnt_spaceLex_5, 0, &r, "HUMIDITY LIVE"); for (i=0; i < 108; i++){ Data data; data=bufferPop(buffer); drawPoint(data.humidity.current); } }
void displayECScreenLive(int sensorID){ displayBorder(); int i; GLCDD_Rect r; r.w = 128 - 10; //r.h = -1; r.h = 5; // Humidity r.x = 20; r.y = 12; GLCDD_Printf(fnt_spaceLex_5, 0, &r, "EC-LEVEL %d LIVE", sensorID); for (i=0; i < 108; i++){ Data data; data=bufferPop(buffer); drawPoint(data.ecLevel[sensorID].current); } }
void displayTemperatureScreenLive(int sensorID){ displayBorder(); int i; GLCDD_Rect r; r.w = 128 - 10; //r.h = -1; r.h = 5; // Humidity r.x = 20; r.y = 12; GLCDD_Printf(fnt_spaceLex_5, 0, &r, "TEMPERATURE %d LIVE", sensorID); for (i=0; i < 108; i++){ Data data; data=bufferPop(buffer); drawPoint(data.temperature[sensorID].current); } }
void Ocean::displayStats(int iteration) { // lots of cout stuff displayBorder(); }