void simulationRun(void)
{
	CALbyte again;

	//exectutes the global transition function
	//the steering function and check for the stop condition
	again = calRunCAStep2D(zhabotinsky.run);

	//simulation main loop
	zhabotinsky.run->step++;

	//graphic rendering
	printf("step: %d\r", zhabotinsky.run->step);
	fflush(stdout);
	glutPostRedisplay();

	//check for the stop condition
	if (!again)
	{
		//breaking the simulation
		glutIdleFunc(NULL);
		printf("\nSimulation terminated\n");
		fflush(stdout);

		//graphic rendering
		glutPostRedisplay();
		return;
	}
}
Пример #2
0
void calRun2D(struct CALRun2D* simulation)
{
	CALbyte again;

	calRunInitSimulation2D(simulation);

	for (simulation->step = simulation->initial_step; (simulation->step <= simulation->final_step || simulation->final_step == CAL_RUN_LOOP); simulation->step++)
	{
		again = calRunCAStep2D(simulation);
		if (!again)
			break;
	}

	calRunFinalizeSimulation2D(simulation);
}