Create a print_node procedure that prints the information contained in a node, including the state of the game at that node. Format the cards properly so that it looks like a freecell game state.
Write a gen_children function that produces all the immediate successors of a given node. An immediate successor is one that is produced by moving just one card.
In your code, be very clear about your ghat, hhat, and any other heuristics that you use. Make extensive comments about these points in your code.
Your program should print the initial state, the detailed understandable sequence of steps to follow to solve it, the number of steps in the solution, and the number of nodes generated. On this last point, the number of nodes generated corresponds to the number of times you call get_node(). This is different from the number of nodes expanded, which you need not show.
You need to run your program on each of these problems. Using the microsoft numbering, the problems are 1057, 1101, 1111, 1122, 1129, and 1280. Modify your program so that it can deal hands that are consistent with the microsoft game numbers. Alternatively, but less useful, you may modify your program so that it can read in the actual hand from an input file.
You need to modify your program so that it computes the expected branching factor (EBF), and also the cpu time (CPU). We discussed how to compute EBF in class. As for computing CPU, here is a C function that returns the cpu consumed so far, when sampled. The cpu cost of any particular computation is the difference between the cpu consumed after the computation and the cpu consumed before the computation.
For your printf statement that produces that line, use:
"hw4wh %8d %4d %8d %[url removed, login to view] %[url removed, login to view] %-8s\n"
as your format. This assumes type `double' for ebf and cpuseconds.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
prefer windows, but can run on linux also