示例#1
0
static void setupDisplay(Uns32 base, Uns32 size, Bool install, void *user)
{
    if (!install) {
        bhmMessage("F", PREFIX, "model does not support unmapping");
    }
    // TODO : explain why a PCI VGA falls outside the PCI memory mapped region!!
    mapDisplay(vs, base & 0x10000000);
}
示例#2
0
int main(int argc, char** argv)
{
	int method = 0;
	double start, finish;

	srand((unsigned int)time(NULL));
	
	fopen_s(&result, "mapColoring.txt", "w");
	if(result == NULL)
		printf("ERROR: File Open Failed");

	// Create Map Information
	printf("Start Map Generating..\n");
	createPoint();

	printf("Start Line Generating..\n");
	createEdge();
	if(boolAllEdge)
		createAllEdge();	// Plus Edge incremently..

	if(boolLog) {
		int a = 0;
		for(int i=0; i<POINT_COUNT; i++)
			a += mapPoints[i].edgeCount;
		printf("\n Created Edges Count:%d  \n", a/2);
	}
	
	// Save the Result
	if(boolSave) saveFile();
	
		initColor();
	// Select Color using each strategy
	for(method = 0; method < 3; method++) { // method 0~2
		kColor = 3;
		printf("\nStart map Coloring using %s\n", method == 0? "Backtracking" 
			: method == 1? "Backtracking using Foward check" : "Backtracking using Arc Consistency");
		if(boolSave) fprintf(result, "\nStart map Coloring using %s\n", method == 0? "Backtracking"
			: method == 1? "Backtracking using Foward check" : "Backtracking using Arc Consistency");

		// time check
		start = clock();

		initColor();
		if(!backtrackingSearch(method)) {
			printf("ERROR: It can't make %d-Coloring Map!!\n", kColor);
			if(boolSave) fprintf(result, "ERROR: It can't make %d-Coloring Map!!\n", kColor);
		
			kColor = 4;
			if(boolLog) printf("\nStart %d-Colorings Search\n", kColor);
			if(boolSave) fprintf(result, "\nStart %d-Colorings Search\n", kColor);

			initColor();
			backtrackingSearch(method);	// mapColoring using k = 4
		}
		
		printf("Map Coloring using %s is finished!!\n", method == 0? "Backtracking" 
			: method == 1? "Backtracking using Foward check" : "Backtracking using Arc Consistency");
		if(boolSave) fprintf(result, "Map Coloring using %s is finished!!\n", method == 0? "Backtracking" 
			: method == 1? "Backtracking using Foward check" : "Backtracking using Arc Consistency");

		// end time
		finish = clock();

		printf("time : %.3fs\n", ((finish-start)/CLOCKS_PER_SEC));
		if(boolSave) fprintf(result, "%s time : %.3fs\n"
			, method == 0? "Backtracking" : method == 1? "Backtracking using Foward check" : "Backtracking using Arc Consistency"
			, ((finish-start)/CLOCKS_PER_SEC));
		//printf("time : %f, %f, %.3f\n", start, finish, difftime(finish, start));
	}

	
	fclose(result);
	
	if(boolShowWindow) {
		glutInit(&argc, argv);
		mapDisplay();
	}
	return 0;
}