Highlights
2.3 Goals
A goal can be any property of block configuration you want a game terminates with. For instance, you can require Block 1 to be located at (0,0). In this case, the goal can be represented as (1, 0, 0), meaning Block 1 to be located at coordinate (0,0). A goal state is any state that satisfies the goal. Normally one goal can have several goal states.
A goal in the form (block, row, column) is called an atom goal, which means that the block must be located at location (row, column). Atom goals can be further combined
in two different ways: disjunctive and conjunctive. If a set of atom goals {g1, g2, ..., gm} are disjunctive, any state that satisfies any of the atom goals is a goal state. For
instance, the disjunctive goals {(1, 0, 0), (1, 1, 0), (1, 2, 0)} means Block 1 must be in Column 0 no matter which row it is. If a set of atom goals {g1, g2, ..., gm} are
conjunctive, a goal state must satisfy all the atom goals in the set. For instance, the conjunctive goals {(1, 0, 0), (2, 0, 1), (3, 0, 2)} means Blocks 1,2&3 must be all in the
bottom row in the goal state.
There are also other ways to represent goals. If we use ‘b’, ‘a’, ‘l’ and ‘r’ to denote ‘below’, ‘above’, ‘left of ’ and ‘right of ’ respectively, ‘6b2’ means Block 6 must be below Block 2 and ‘4l1’ means Block 4 must be at the left of Block 1. These goals are named neighbourhood goals. Obviously neighbourhood goals can be transferred into
combinations of disjunctive and conjunctive goals.
Task 1: Create a class, named State, with related data members to store a game state (an array of nine integers, a 3*3 two-dimensional array of integers, an array of
three vectors, an array of three stacks, or any other data types you prefer to use) and necessary methods for variable initialisation, data input and game board display.
Task 2: Implement methods in the State class or in any other appropriate classes to randomly generate an initial state.
Task 3: Implement methods in the State class or in any other appropriate classes to execute a legal action (remove a block from one column and deposit it to another
column), output the list of all legal actions, and calculate the next state for any given action4
.
Task 4: Create a class, named Solver5, with at least a data member in type of State to record the current state of a game. Implement a search algorithm to find a goal
state from any randomly generated initial state for any user input atom goal. Your search algorithm does not have to achieve any goal any time within a pre-set step
limit (say 100 steps), but should avoid back and forth.
Task 5: Create a class driver containing the main() function to test all the classes you created.
Task 6: Create a heuristic function to evaluate the next state of each legal action so that the action that has more hope to achieve the goals has higher priority to be
executed. Any other implementation, instead of a heuristic function, is also acceptable as long as it can make your search algorithm out of blind search.
This Engineering Assignment has been solved by our Engineering Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.