Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#ifndef DATA _ TYPES _ H #define DATA _ TYPES _ H / / = = = = = = = = = = =
#ifndef DATATYPESH
#define DATATYPESH
WRITE YOUR OPTIONAL DATA TYPES IF YOU NEED
enum CITIES
Arad, Bucharest, Craiova, Drobeta, Eforie,
Fagaras, Giurgiu, Hirsova, Iasi, Lugoj,
Mehadia, Neamt, Oradea, Pitesti, RimnicuVilcea,
Sibiu, Timisoara, Urziceni, Vaslui, Zerind
;
WRITE YOUR COMPULSORY BUT SPECIFIC TO THE PROBLEM DATA TYPES
enum ACTIONS All possible actions
GoArad, GoBucharest, GoCraiova, GoDrobeta, GoEforie,
GoFagaras, GoGiurgiu, GoHirsova, GoIasi, GoLugoj,
GoMehadia, GoNeamt, GoOradea, GoPitesti, GoRimnicuVilcea,
GoSibiu, GoTimisoara, GoUrziceni, GoVaslui, GoZerind
;
typedef struct State
enum CITIES city;
float hn; Heuristic function
State;
YOU DO NOT NEED TO CHANGE THIS PART
enum METHODS
BreastFirstSearch UniformCostSearch DepthFirstSearch
DepthLimitedSearch IterativeDeepeningSearch GreedySearch
AStarSearch GeneralizedAStarSearch
;
This struct is used to determine a new state and action in transition model
typedef struct TransitionModel
State newstate;
float stepcost;
TransitionModel;
typedef struct Node
State state;
float pathcost;
enum ACTIONS action; The action applied to the parent to generate this node
struct Node parent;
int NumberofChild; required for depthfirst search algorithms
Node;
typedef struct Queue Used for frontier
Node node;
struct Queue next;
Queue;
#endif change this code for puzzle game
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started