SlideShare a Scribd company logo
1 of 71
Files/Assignm3.h
#ifndef Assignm3_H
#define Assignm3_H
// ------------------------------------------------------------------------
------------
#include <vector>
#include <string>
#include <pthread.h>
#include "Path.h"
#include "Maze.h"
#include "ProgramLog.h"
#include "Assignm3_Utils.h"
#include "SubmitMazeSoln.h"
// ------------------------------------------------------------------------
------------
namespace Assignm3
{
const int MAX_NO_OF_THREADS= 3;
const std::string THREAD_NAMES []= {"POOH", "TIGGER",
"ROO", "GOLPHER", "KANGA", "LUMPY", "OWL",
"RABBIT", "PIGLET",
"POOH0", "TIGGER0", "ROO0", "GOLPHER0", "KANGA0",
"LUMPY0", "OWL0", "RABBIT0", "PIGLET0",
"POOH1", "TIGGER1", "ROO1", "GOLPHER1", "KANGA1",
"LUMPY1", "OWL1", "RABBIT1", "PIGLET1",
"POOH2", "TIGGER2", "ROO2", "GOLPHER2", "KANGA2",
"LUMPY2", "OWL2", "RABBIT2", "PIGLET2",
"POOH3", "TIGGER3", "ROO3", "GOLPHER3", "KANGA3",
"LUMPY3", "OWL3", "RABBIT3", "PIGLET3",
"POOH4", "TIGGER4", "ROO4", "GOLPHER4", "KANGA4",
"LUMPY4", "OWL4", "RABBIT4", "PIGLET4",
"POOH5", "TIGGER5", "ROO5", "GOLPHER5", "KANGA5",
"LUMPY5", "OWL5", "RABBIT5", "PIGLET5"
};
// ------------------------------------------------------------------------
------------
// ------------------------------------------------------------------------
------------
// ------------------------------------------------------------------------
------------
struct PathFinderParameterInfo
{
intthreadIDArrayIndex;
boolexitThisThreadNow;
PointcurrentLocation;
std::stringthreadName;
VectorOfPointStructTypetravelledPath;
PathFinderParameterInfo (void)
{
currentLocation.x= -1;
currentLocation.y= -1;
threadIDArrayIndex= -1;
exitThisThreadNow= false;
travelledPath= VectorOfPointStructType ();
}
~PathFinderParameterInfo (void)
{
travelledPath.clear ();
}
};
// ------------------------------------------------------------------------
------------
struct PathFinderResource
{
pthread_tactiveThreadArray [MAX_NO_OF_THREADS];
PathFinderParameterInfo
*activeThreadParamArray[MAX_NO_OF_THREADS];
VectorOfPointStructTypesolutionPath;
VectorOfPointStructTypediscoveredDangerAreas;
intusedThreadNameIndex;
intnoOfDeadEndPathsFound;
intnoOfBarriersDiscovered;
intnoOfDangerAreaDiscovered;
PathFinderResource (void)
{
usedThreadNameIndex= 0;
noOfDeadEndPathsFound= 0;
noOfBarriersDiscovered= 0;
noOfDangerAreaDiscovered= 0;
solutionPath= VectorOfPointStructType ();
discoveredDangerAreas= VectorOfPointStructType ();
}
~PathFinderResource (void)
{
solutionPath.clear ();
discoveredDangerAreas.clear ();
}
};
PathFinderResource globalPathFinderResource;
// ------------------------------------------------------------------------
------------
static Maze * mazeObj;
static Path * pathObj;
static SubmitMazeSoln * submitMazeSolnObj;
static std::fstream logFileStream;
static std::string DefaultLogFilename = "Assignm3Log.txt";
static pthread_mutex_tthread_mutex=
PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t thread_condition=
PTHREAD_COND_INITIALIZER;
static bool mainThreadReportUpdateNow= false;
static bool discoveredA
Solution
Path= false;
// ------------------------------------------------------------------------
------------
static void AllocateProgramsVariableMemory (void)
{
mazeObj= new Maze ();
pathObj= new Path ();
submitMazeSolnObj= new SubmitMazeSoln ();
logFileStream.open (DefaultLogFilename.c_str(),
std::fstream::out);
}// end allocateProgramsVariableMemory () ...
// ------------------------------------------------------------------------
------------
static void DeallocateProgramsVariableMemory (void)
{
delete mazeObj;
delete pathObj;
delete submitMazeSolnObj;
logFileStream.close ();
pthread_mutex_destroy ( &thread_mutex );
pthread_cond_destroy ( &thread_condition );
}// end deallocateProgramsVariableMemory () ...
// ------------------------------------------------------------------------
------------
static void HandleThreadOperationResult (std::ostream &
outputStream, const std::string message, const int status)
{
if (status)
{
std::string msg = "Error on : " + message + ", ERROR CODE =
" + IntToString (status) + "n";
// below function 'WriteLogMessage' is defined in
'ProgramLog.h' ...
WriteLogMessage (std::cout, msg);
WriteLogMessage (outputStream, msg);
DeallocateProgramsVariableMemory ();
exit (EXIT_FAILURE);
}
}// end handleThreadOperationResult () ...
// ------------------------------------------------------------------------
------------
// ------------------------------------------------------------------------
------------
}// end namespace Assignm3
#endif // Assignm3_H
Files/Assignm3_Utils.h
#ifndef Assignm3_UTILS_H
#define Assignm3_UTILS_H
#include <vector>
#include <string>
#include <iostream>// cout, endl
#include <sstream>// ostringstream
#include <cstdlib>// srand, rand
// ------------------------------------------------------------------------
------------
struct Point
{
int x;
int y;
Point (){x = NULL;y = NULL;}
Point (int x1, int y1){x = x1;y = y1;}
~Point (void){}
Point & operator= (const Point &p)
{x = p.x;y = p.y;return (*this);}
bool operator== (const Point &p)
{return ( (x == p.x) && (y == p.y) );}
bool operator!= (const Point &p)
{return ( (x != p.x) || (y != p.y) );}
// 2 points are 'connected' but 'different' if they :
// i) share the same 'x' but adjacent 'y' values, OR
// ii) share the same 'y' but adjacent 'x' values!!
bool isConnected (Point &p)
{
return (((x == p.x) && ( ((y-1) == p.y) || ((y+1) == p.y) )) ||
((y == p.y) && ( ((x-1) == p.x) || ((x+1) == p.x) ))
);
}
void display (std::ostream &outputStream=std::cout)
{outputStream << "[" << x << ", " << y << "]";}
};
// ------------------------------------------------------------------------
------------
// type define a vector of Point structs ...
typedef std::vector<Point> VectorOfPointStructType;
// type define a vector of VectorOfPointStructType ...
typedef std::vector<VectorOfPointStructType>
VectorOfVectorOfPointStructType;
// ------------------------------------------------------------------------
------------
static std::string IntToString (const int intValue)
{
std::ostringstream oss (std::ostringstream::out);
oss << intValue;
return ( oss.str() );
}// end intToString () ...
// ------------------------------------------------------------------------
------------
static int GenerateRandomInteger (const int lowerLimit, const
int upperLimit)
{
time_t secs;
time (&secs);
std::srand ( (unsigned int) secs );
return ( std::rand () % (upperLimit - lowerLimit + 1) +
lowerLimit );
}// end GenerateRandomInteger () ...
// ------------------------------------------------------------------------
------------
#endif // Assignm3_UTILS_H
Files/CSCI212_Assignmt3.doc
University of Wollongong
School of Computing and Information Technology
CSCI212 Interacting Systems
Assignment 3
Aim
The objective of this assignment is to apply the concepts of
threading by developing a simple C++ Pthreads program to
discover the surroundings and the shortest path in a 2D maze
Background
This assignment requires you to write a multi-threaded C/C++
“Pathfinder” program to discover the surroundings of a jungle
maze. Each [x, y] location in the maze represents a ‘grid area’
of the jungle terrain. A particular gird area could be :
· “impassable”
(rep. by ‘#’ barrier) ,
· contains danger
(rep. by ‘X’ danger area)
· clear,
(i.e. allows you to travel)
An example of the jungle maze will be provided to you (see
Appendix A, ‘mazedata.txt’).
Your objective is to explore as much of the jungle maze terrain
as possible, and mark the discovered area as barrier (‘#’), or
danger (‘X’) accordingly.
When your program terminate, it should output a map of the
explored jungle maze, as well as 1 ‘safe’ path, to traverse from
Start to End locations.
Task Requirements
A) At startup, your program should read in the 2D maze
configuration (“mazedata.txt”) which stores the information
about the maze dimensions, barriers, start and end locations.
Please refer to Appendix A for an example.
B) For the purposes of testing your program, a sample of what
information should be output is shown in Appendix B.
C) Before you start developing your program, you should take
some time to review the output, and analyze the requirements of
the Pathfinder program.
D) Your program should have at least 2 threads, each thread
attempting to explore surrounding locations to discover whether
it contains a barrier (‘#’) or danger (‘X’).
E) Impt 1 : your program should maintain a global Maze
resource or variable, holding information about all the barriers
or danger areas uncovered by your exploring threads!
F) Impt 2 : when a particular thread has encountered a barrier
(‘#’) or danger (‘X’), it should …
· Record the path (history of point locations) it has traversed,
since the Start Location, to reach the barrier / danger areas, and
locations of barrier / danger should be marked on your ‘global
Maze resource’
· The thread ‘loses its life’ (i.e. should be destroyed) if it has
encountered a danger area (‘X’) !!
G) Whenever a thread is destroyed, your program should create
another replacement thread, to traverse the jungle maze
beginning from the Start Location again. But this time, it should
access the ‘global Maze resource’ to learn and avoid the
barriers and danger areas discovered by its predecessor threads!
H) In this way, the ‘sacrifice’ of the destroyed threads are not
in vain, as its knowledge (of locations of the barriers / danger
areas) have been recorded in the ‘global Maze resource’ that can
be accessed by future generations of created threads to aid their
survival in order to discover a path to End Location!
I) As you probably guess by now, the access to the ‘global Maze
resource’ should be protected via usage of mutex locks.
Whether a thread is:
· Updating its discovery of the path to barrier / danger areas
OR
· Accessing the ‘global Maze resource’ to learn about the
discovered locations of the barriers / danger areas
Only 1 thread can access it at any one time!
J) Once the program is completed and tested to be working
successfully, you are highly encouraged to add on “new
features” to the program that you feel are applicable to the task
of finding the shortest path thru a maze. Additional marks may
be awarded subject to the relevancy and correctness of the new
functionalities.
K) Your program should be written in C++, and using the
library functions available in header file ‘pthread.h’, to handle
all aspects of thread creation, management and synchronization.
L) To encourage good program design, you should consider
using different *.cpp class files to encapsulate groups of related
methods/functions.
Additional Resources
· After all students have gone through this document, your tutor
will hold a special session to discuss / elaborate on the
requirements of this assignment.
· In addition, your tutor will hold a Q & A sessions to clarify
any issues/doubts you may have on the analysis and design of
this multi-threaded program. To ensure a fruitful session, all
students must come prepared with their list of questions, so that
everybody’s time is efficiently utilized.
Deliverables
1) The deliverables include the following:
a) The actual working shell program (hard+soft copies), with
comments on each file, function or block of code to help the
tutor understand its purpose.
b) A word document (hard+soft copies) that elaborates on:
· (Interpreted) requirements of the program
· Diagram / Illustrations of program design
· Summary of implementation of each module in your program
· Reflections on program development (e.g. assumptions made,
difficulties faced, what could have been done better, possible
enhancements in future, what have you learnt, etc)
c) A program demo/evaluation during lab session. You must be
prepared to perform certain tasks / answer any questions posed
by the tutor.
2) IMPT: Please follow closely, to the submission instructions
in Appendix C, which contains details about what to submit, file
naming conventions, when to submit, where to submit, etc.
3) The evaluation will be held during lab session where you are
supposed to submit your assignment. Some time will be
allocated for you to present / demonstrate your program during
the session.
Grading
Student’s deliverable will be graded according to the following
criteria:
(i) Program fulfills all the basic requirements stipulated by the
assignment
The requirements includes some/all of the following:
· Ability to handle maze of different sizes
· No. of danger areas uncovered
· No. of barriers uncovered
· No. of threads utilized
· Validity of the single solution path (a series of Point locations
leading from Start to End locations
(ii) Successful demonstration of a working program, clarity of
presentation and satisfactory answers provided during Q & A
session.
(iii) Additional efforts in enhancing the program with features
over and above task requirements, impressive, “killer”
presentation and demonstration, etc.
(iv) After the submission of deliverables, students will be
required undergo an evaluation process (to determine
fulfillment of task requirements.) Further instructions will be
given by the Tutor during the subsequent respective labs. Please
pay attention as failure to adhere to instructions may result in
deduction of marks.
Tutor’s note:
In the real working world, satisfactory completion of your tasks
is no longer enough. The ability to add value, communicate
and/or demonstrate your ideas with clarity is just as important
as correct functioning of your program. The grading criteria is
set to imitate such requirements on a ‘smaller scale’.
APPENDIX A
(Sample contents for Maze ‘mazedata.txt’)
Length : 20
Breadth : 10
// ------------------------------
// ----- Start of Maze Data -----
// ------------------------------
// 'S' denotes Starting position
// 'E' denotes Ending position
// '#' denotes Barrier
// 'X' denotes Danger Area
####################
#S # # #
# # ## ## ### ###
# # # # E #
## # # X # X ## #
# X ### ##### #
# # # # # ###
# ### ### ## # #####
# # #
####################
APPENDIX B
(Output solution stored in a generated text, based on the maze
configuration in Appendix A)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # # # # # # # # # # # # # # # # # #
1 # S # # #
2 # # # # # # # # # # # #
3 # # # # E #
4 # # # # X # X # # #
5 # X # # # # # # # # #
6 # # # # # # # #
7 # # # # # # # # # # # # # # #
8 # # #
9 # # # # # # # # # # # # # # # # # # # #
_length : 20
_breadth : 10
_startLocation : [ 1, 1 ]
_endLocation : [ 17, 3 ]
No. of paths discovered : 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0
1 S
2
3 E
4
5
6
7
8
9
_length : 20
_breadth : 10
_startLocation : [ 1, 1 ]
_endLocation : [ 17, 3 ]
No. of paths discovered : 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # # # # # # # # # # # # # # # # # #
1 # S # # #
2 # # # # # # # # # # # #
3 # # # # E #
4 # # # # X # X # # #
5 # X # # # # # # # # #
6 # # # # # # # #
7 # # # # # # # # # # # # # # #
8 # # #
9 # # # # # # # # # # # # # # # # # # # #
Thread 'POOH' has been created !!
Total no. of steps : 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 S
2
3 E
4
5
6
7
8
9
Total no. of steps : 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 # S
2
3 E
4
5
6
7
8
9
Total no. of steps : 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 # S
2 # 1
3 E
4
5
6
7
8
9
Total no. of steps : 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 # S
2 # 1
3 2 E
4 #
5
6
7
8
9
Total no. of steps : 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 # S
2 # 1
3 # 2 E
4 #
5
6
7
8
9
Total no. of steps : 5
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 #
1 # S
2 # 1 4 #
3 # 2 3 E
4 #
5
6
7
8
9
Total no. of steps : 6
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S 5
2 # 1 4 #
3 # 2 3 E
4 #
5
6
7
8
9
Total no. of steps : 6
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S 5 #
2 # 1 4 #
3 # 2 3 E
4 #
5
6
7
8
9
Thread 'POOH' hits a DEAD END near [2, 1] !!
Thread 'TIGGER' has been created !!
Thread 'ROO' has been created !!
===============================================
============
Elapsed Time : 0
Latest Update ...
===============================================
============
Dead End Paths Found : 1
Barriers Discovered : 8
Danger Area Discovered : 0
Total no. of steps : 5
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4
5
6
7
8
9
Total no. of steps : 5
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5
6
7
8
9
Total no. of steps : 6
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 5
6 #
7
8
9
Total no. of steps : 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 6 5
6 #
7
8
9
Total no. of steps : 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 #
7
8
9
Total no. of steps : 8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7
8
9
Total no. of steps : 8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7
8
9
Total no. of steps : 9
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8
8
9
Total no. of steps : 9
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8
9
Total no. of steps : 10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8 9
9 #
Total no. of steps : 10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8 # 9
9 #
Total no. of steps : 11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8 # 9 10
9 #
Total no. of steps : 11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8 # 9 10
9 # #
Total no. of steps : 11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 6 5
6 # 7 #
7 # 8 #
8 # 9 10 #
9 # #
Thread 'TIGGER' hits a DEAD END near [2, 1] !!
===============================================
============
Elapsed Time : 1
Latest Update ...
===============================================
============
Dead End Paths Found : 2
Barriers Discovered : 22
Danger Area Discovered : 0
Thread 'TIGGER' hits a DEAD END near [2, 8] !!
===============================================
============
Elapsed Time : 2
Latest Update ...
===============================================
============
Dead End Paths Found : 3
Barriers Discovered : 22
Danger Area Discovered : 0
Thread 'ROO' hits a DEAD END near [2, 1] !!
===============================================
============
Elapsed Time : 3
Latest Update ...
===============================================
============
Dead End Paths Found : 4
Barriers Discovered : 22
Danger Area Discovered : 0
Total no. of steps : 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6
6 # #
7 # #
8 # #
9 # #
Total no. of steps : 8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6
6 # # 7
7 # # #
8 # #
9 # #
Total no. of steps : 8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6
6 # # 7
7 # # #
8 # #
9 # #
Total no. of steps : 9
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6
6 # # 7 8
7 # # # #
8 # #
9 # #
Total no. of steps : 9
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6 X
6 # # 7 8
7 # # # #
8 # #
9 # #
Thread 'TIGGER' stepped into DANGER at [4, 5] !!
===============================================
============
Elapsed Time : 4
Latest Update ...
===============================================
============
Dead End Paths Found : 4
Barriers Discovered : 26
Danger Area Discovered : 1
Thread 'TIGGER' is dead! It's sacrifice shall not be in vain!
Creating new thread 'GOLPHER'
Thread 'GOLPHER' has been created !!
Thread 'POOH' hits a DEAD END near [2, 8] !!
===============================================
============
Elapsed Time : 5
Latest Update ...
===============================================
============
Dead End Paths Found : 5
Barriers Discovered : 26
Danger Area Discovered : 1
Total no. of steps : 10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6 X
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 12
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 #
3 # 2 3 E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 13
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 # #
3 # 2 3 12 E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 13
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 # #
3 # 2 3 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # #
1 # S #
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # #
1 # S # 15
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # #
1 # S # 15
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # #
1 # S # 15 16
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # #
1 # S # 15 16
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Total no. of steps : 17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # #
1 # S # 15 16 #
2 # 1 # 14 #
3 # 2 3 13 12 # E
4 # 4 # 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # # Thread 'ROO' hits a
DEAD END near [2, 8] !!
9 # #
===============================================
============
Elapsed Time : 6
Latest Update ...
===============================================
============
Dead End Paths Found : 6
Barriers Discovered : 38
Danger Area Discovered : 1
Thread 'ROO' hits a DEAD END near [5, 1] !!
===============================================
============
Elapsed Time : 7
Latest Update ...
===============================================
============
Dead End Paths Found : 7
Barriers Discovered : 38
Danger Area Discovered : 1
Total no. of steps : 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # #
1 # S # #
2 # 1 # #
3 # 2 3 13 12 # E
4 # 4 # 14 11 #
5 # 5 6 X 10 #
6 # # 7 8 9 #
7 # # # #
8 # #
9 # #
Note :
· There are many pages of other intermediate output that is not
feasible to show in this Appendix.
· We are now skipping straight to the ending portion of the
output.
· Below output show the LAST FEW STEPS of the thread
exploration leading to the discovery of a single, solution path
from Start Location ‘S’ to End Location ‘E’ !!
Total no. of steps : 51
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # # # # # # # # # # # #
1 # S # # 23 24 25 26 33 34 35 36 37
2 # 1 # # # 22 # # 27 32 # # # 38 # #
3 # 2 3 # 21 20 # 28 31 # 40 39 50 49 #
4 # 4 # # 19 # 29 30 41 # # 48 #
5 # 5 6 X # # # 18 # # # # 42 45 46 47 #
6 # # 7 8 9 # 17 # # 43 44 # #
7 # # # # 10 # # # 16 # # # # # # #
8 # # 11 12 13 14 15 #
9 # # # # # # # # # # # # # # # # #
Thread 'ROO' just found a solution! Well done!!
Finished Finding a SAFE PATH !!
Printing submitted maze solution ...
Printing solution for Tan Ah Beng, id : 1001001
---------------------------------------------------------------------------
-----------------
Total no. of steps : 50
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 # # # # # # # # # # # # # #
1 # S # # 23 24 25 26 33 34 35 36 37
2 # 1 # # # 22 # # 27 32 # # # 38 # #
3 # 2 3 # 21 20 # 28 31 # 40 39 E 49 #
4 # 4 # # 19 # 29 30 41 # # 48 #
5 # 5 6 X # # # 18 # # # # 42 45 46 47 #
6 # # 7 8 9 # 17 # # 43 44 # #
7 # # # # 10 # # # 16 # # # # # # #
8 # # 11 12 13 14 15 #
9 # # # # # # # # # # # # # # # # #
Total no. of Threads submitting info : 3
Duplicated Paths (to Barriers) submitted : 155
Duplicated Paths (to Danger Area) submitted : 0
Total no. of Barrier ('#') discovered : 90 out of 105 !!
Total no. of Danger Area ('X') discovered : 1 out of 3 !!
Printing Thread Statistics !!
---------------------------------------------------------------------------
-----------------
Stats for Thread ID : 3070360432
Found

More Related Content

Similar to FilesAssignm3.h#ifndef Assignm3_H#define Assignm3_H.docx

C aptitude questions
C aptitude questionsC aptitude questions
C aptitude questionsSrikanth
 
C - aptitude3
C - aptitude3C - aptitude3
C - aptitude3Srikanth
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat SheetHortonworks
 
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013ericupnorth
 
C standard library functions
C standard library functionsC standard library functions
C standard library functionsVaishnavee Sharma
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfezonesolutions
 
Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 pramode_ce
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05cKaz Yoshikawa
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.jsWebsecurify
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Functions And Header Files In C++ | Bjarne stroustrup
Functions And Header Files In C++ | Bjarne stroustrupFunctions And Header Files In C++ | Bjarne stroustrup
Functions And Header Files In C++ | Bjarne stroustrupSyedHaroonShah4
 
Introduction to go
Introduction to goIntroduction to go
Introduction to goJaehue Jang
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...Francesco Casalegno
 
Asterisk: PVS-Studio Takes Up Telephony
Asterisk: PVS-Studio Takes Up TelephonyAsterisk: PVS-Studio Takes Up Telephony
Asterisk: PVS-Studio Takes Up TelephonyAndrey Karpov
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesssuserf86fba
 

Similar to FilesAssignm3.h#ifndef Assignm3_H#define Assignm3_H.docx (20)

C aptitude questions
C aptitude questionsC aptitude questions
C aptitude questions
 
C - aptitude3
C - aptitude3C - aptitude3
C - aptitude3
 
7 functions
7  functions7  functions
7 functions
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
 
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
 
C standard library functions
C standard library functionsC standard library functions
C standard library functions
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdf
 
Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05c
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.js
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Functions And Header Files In C++ | Bjarne stroustrup
Functions And Header Files In C++ | Bjarne stroustrupFunctions And Header Files In C++ | Bjarne stroustrup
Functions And Header Files In C++ | Bjarne stroustrup
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
 
Linked list
Linked listLinked list
Linked list
 
Asterisk: PVS-Studio Takes Up Telephony
Asterisk: PVS-Studio Takes Up TelephonyAsterisk: PVS-Studio Takes Up Telephony
Asterisk: PVS-Studio Takes Up Telephony
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequences
 

More from mydrynan

CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docxCSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docxmydrynan
 
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docxCSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docxmydrynan
 
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
CSI Paper Grading Rubric- (worth a possible 100 points)   .docxCSI Paper Grading Rubric- (worth a possible 100 points)   .docx
CSI Paper Grading Rubric- (worth a possible 100 points) .docxmydrynan
 
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docxCSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docxmydrynan
 
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docxCSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docxmydrynan
 
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018  Ho.docxCSE422 Section 002 – Computer Networking Fall 2018  Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docxmydrynan
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxmydrynan
 
CSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docxCSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docxmydrynan
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxmydrynan
 
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docxCSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docxmydrynan
 
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docxCryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docxmydrynan
 
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docxCSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docxmydrynan
 
CSCE 1040 Homework 2 For this assignment we are going to .docx
CSCE 1040 Homework 2  For this assignment we are going to .docxCSCE 1040 Homework 2  For this assignment we are going to .docx
CSCE 1040 Homework 2 For this assignment we are going to .docxmydrynan
 
CSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docxCSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docxmydrynan
 
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxmydrynan
 
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docxCSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docxmydrynan
 
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docxCSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docxmydrynan
 
CSC-321 Final Writing Assignment In this assignment, you .docx
CSC-321 Final Writing Assignment  In this assignment, you .docxCSC-321 Final Writing Assignment  In this assignment, you .docx
CSC-321 Final Writing Assignment In this assignment, you .docxmydrynan
 
Cryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docxCryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docxmydrynan
 
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docxCSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docxmydrynan
 

More from mydrynan (20)

CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docxCSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
 
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docxCSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
 
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
CSI Paper Grading Rubric- (worth a possible 100 points)   .docxCSI Paper Grading Rubric- (worth a possible 100 points)   .docx
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
 
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docxCSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
 
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docxCSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
 
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018  Ho.docxCSE422 Section 002 – Computer Networking Fall 2018  Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docx
 
CSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docxCSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docx
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
 
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docxCSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
 
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docxCryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
 
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docxCSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
 
CSCE 1040 Homework 2 For this assignment we are going to .docx
CSCE 1040 Homework 2  For this assignment we are going to .docxCSCE 1040 Homework 2  For this assignment we are going to .docx
CSCE 1040 Homework 2 For this assignment we are going to .docx
 
CSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docxCSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docx
 
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
 
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docxCSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
 
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docxCSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
 
CSC-321 Final Writing Assignment In this assignment, you .docx
CSC-321 Final Writing Assignment  In this assignment, you .docxCSC-321 Final Writing Assignment  In this assignment, you .docx
CSC-321 Final Writing Assignment In this assignment, you .docx
 
Cryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docxCryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docx
 
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docxCSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

FilesAssignm3.h#ifndef Assignm3_H#define Assignm3_H.docx

  • 1. Files/Assignm3.h #ifndef Assignm3_H #define Assignm3_H // ------------------------------------------------------------------------ ------------ #include <vector> #include <string> #include <pthread.h> #include "Path.h" #include "Maze.h" #include "ProgramLog.h" #include "Assignm3_Utils.h" #include "SubmitMazeSoln.h" // ------------------------------------------------------------------------ ------------ namespace Assignm3 { const int MAX_NO_OF_THREADS= 3; const std::string THREAD_NAMES []= {"POOH", "TIGGER", "ROO", "GOLPHER", "KANGA", "LUMPY", "OWL", "RABBIT", "PIGLET", "POOH0", "TIGGER0", "ROO0", "GOLPHER0", "KANGA0", "LUMPY0", "OWL0", "RABBIT0", "PIGLET0", "POOH1", "TIGGER1", "ROO1", "GOLPHER1", "KANGA1",
  • 2. "LUMPY1", "OWL1", "RABBIT1", "PIGLET1", "POOH2", "TIGGER2", "ROO2", "GOLPHER2", "KANGA2", "LUMPY2", "OWL2", "RABBIT2", "PIGLET2", "POOH3", "TIGGER3", "ROO3", "GOLPHER3", "KANGA3", "LUMPY3", "OWL3", "RABBIT3", "PIGLET3", "POOH4", "TIGGER4", "ROO4", "GOLPHER4", "KANGA4", "LUMPY4", "OWL4", "RABBIT4", "PIGLET4", "POOH5", "TIGGER5", "ROO5", "GOLPHER5", "KANGA5", "LUMPY5", "OWL5", "RABBIT5", "PIGLET5" }; // ------------------------------------------------------------------------ ------------ // ------------------------------------------------------------------------ ------------ // ------------------------------------------------------------------------ ------------ struct PathFinderParameterInfo { intthreadIDArrayIndex; boolexitThisThreadNow; PointcurrentLocation; std::stringthreadName; VectorOfPointStructTypetravelledPath; PathFinderParameterInfo (void) { currentLocation.x= -1; currentLocation.y= -1; threadIDArrayIndex= -1; exitThisThreadNow= false; travelledPath= VectorOfPointStructType (); } ~PathFinderParameterInfo (void)
  • 3. { travelledPath.clear (); } }; // ------------------------------------------------------------------------ ------------ struct PathFinderResource { pthread_tactiveThreadArray [MAX_NO_OF_THREADS]; PathFinderParameterInfo *activeThreadParamArray[MAX_NO_OF_THREADS]; VectorOfPointStructTypesolutionPath; VectorOfPointStructTypediscoveredDangerAreas; intusedThreadNameIndex; intnoOfDeadEndPathsFound; intnoOfBarriersDiscovered; intnoOfDangerAreaDiscovered; PathFinderResource (void) { usedThreadNameIndex= 0; noOfDeadEndPathsFound= 0; noOfBarriersDiscovered= 0; noOfDangerAreaDiscovered= 0; solutionPath= VectorOfPointStructType (); discoveredDangerAreas= VectorOfPointStructType (); } ~PathFinderResource (void) { solutionPath.clear (); discoveredDangerAreas.clear (); }
  • 4. }; PathFinderResource globalPathFinderResource; // ------------------------------------------------------------------------ ------------ static Maze * mazeObj; static Path * pathObj; static SubmitMazeSoln * submitMazeSolnObj; static std::fstream logFileStream; static std::string DefaultLogFilename = "Assignm3Log.txt"; static pthread_mutex_tthread_mutex= PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t thread_condition= PTHREAD_COND_INITIALIZER; static bool mainThreadReportUpdateNow= false; static bool discoveredA Solution Path= false; // ------------------------------------------------------------------------ ------------ static void AllocateProgramsVariableMemory (void) {
  • 5. mazeObj= new Maze (); pathObj= new Path (); submitMazeSolnObj= new SubmitMazeSoln (); logFileStream.open (DefaultLogFilename.c_str(), std::fstream::out); }// end allocateProgramsVariableMemory () ... // ------------------------------------------------------------------------ ------------ static void DeallocateProgramsVariableMemory (void) { delete mazeObj; delete pathObj; delete submitMazeSolnObj; logFileStream.close (); pthread_mutex_destroy ( &thread_mutex ); pthread_cond_destroy ( &thread_condition ); }// end deallocateProgramsVariableMemory () ... // ------------------------------------------------------------------------
  • 6. ------------ static void HandleThreadOperationResult (std::ostream & outputStream, const std::string message, const int status) { if (status) { std::string msg = "Error on : " + message + ", ERROR CODE = " + IntToString (status) + "n"; // below function 'WriteLogMessage' is defined in 'ProgramLog.h' ... WriteLogMessage (std::cout, msg); WriteLogMessage (outputStream, msg); DeallocateProgramsVariableMemory (); exit (EXIT_FAILURE); } }// end handleThreadOperationResult () ... // ------------------------------------------------------------------------ ------------ // ------------------------------------------------------------------------
  • 7. ------------ }// end namespace Assignm3 #endif // Assignm3_H Files/Assignm3_Utils.h #ifndef Assignm3_UTILS_H #define Assignm3_UTILS_H #include <vector> #include <string> #include <iostream>// cout, endl #include <sstream>// ostringstream #include <cstdlib>// srand, rand // ------------------------------------------------------------------------ ------------
  • 8. struct Point { int x; int y; Point (){x = NULL;y = NULL;} Point (int x1, int y1){x = x1;y = y1;} ~Point (void){} Point & operator= (const Point &p) {x = p.x;y = p.y;return (*this);} bool operator== (const Point &p) {return ( (x == p.x) && (y == p.y) );} bool operator!= (const Point &p) {return ( (x != p.x) || (y != p.y) );} // 2 points are 'connected' but 'different' if they : // i) share the same 'x' but adjacent 'y' values, OR // ii) share the same 'y' but adjacent 'x' values!!
  • 9. bool isConnected (Point &p) { return (((x == p.x) && ( ((y-1) == p.y) || ((y+1) == p.y) )) || ((y == p.y) && ( ((x-1) == p.x) || ((x+1) == p.x) )) ); } void display (std::ostream &outputStream=std::cout) {outputStream << "[" << x << ", " << y << "]";} }; // ------------------------------------------------------------------------ ------------ // type define a vector of Point structs ... typedef std::vector<Point> VectorOfPointStructType; // type define a vector of VectorOfPointStructType ... typedef std::vector<VectorOfPointStructType> VectorOfVectorOfPointStructType; // ------------------------------------------------------------------------ ------------
  • 10. static std::string IntToString (const int intValue) { std::ostringstream oss (std::ostringstream::out); oss << intValue; return ( oss.str() ); }// end intToString () ... // ------------------------------------------------------------------------ ------------ static int GenerateRandomInteger (const int lowerLimit, const int upperLimit) { time_t secs; time (&secs); std::srand ( (unsigned int) secs ); return ( std::rand () % (upperLimit - lowerLimit + 1) + lowerLimit ); }// end GenerateRandomInteger () ... // ------------------------------------------------------------------------ ------------
  • 11. #endif // Assignm3_UTILS_H Files/CSCI212_Assignmt3.doc University of Wollongong School of Computing and Information Technology CSCI212 Interacting Systems Assignment 3 Aim The objective of this assignment is to apply the concepts of threading by developing a simple C++ Pthreads program to discover the surroundings and the shortest path in a 2D maze Background This assignment requires you to write a multi-threaded C/C++ “Pathfinder” program to discover the surroundings of a jungle maze. Each [x, y] location in the maze represents a ‘grid area’ of the jungle terrain. A particular gird area could be : · “impassable”
  • 12. (rep. by ‘#’ barrier) , · contains danger (rep. by ‘X’ danger area) · clear, (i.e. allows you to travel) An example of the jungle maze will be provided to you (see Appendix A, ‘mazedata.txt’). Your objective is to explore as much of the jungle maze terrain as possible, and mark the discovered area as barrier (‘#’), or danger (‘X’) accordingly. When your program terminate, it should output a map of the explored jungle maze, as well as 1 ‘safe’ path, to traverse from Start to End locations. Task Requirements A) At startup, your program should read in the 2D maze configuration (“mazedata.txt”) which stores the information about the maze dimensions, barriers, start and end locations. Please refer to Appendix A for an example.
  • 13. B) For the purposes of testing your program, a sample of what information should be output is shown in Appendix B. C) Before you start developing your program, you should take some time to review the output, and analyze the requirements of the Pathfinder program. D) Your program should have at least 2 threads, each thread attempting to explore surrounding locations to discover whether it contains a barrier (‘#’) or danger (‘X’). E) Impt 1 : your program should maintain a global Maze resource or variable, holding information about all the barriers or danger areas uncovered by your exploring threads! F) Impt 2 : when a particular thread has encountered a barrier (‘#’) or danger (‘X’), it should … · Record the path (history of point locations) it has traversed, since the Start Location, to reach the barrier / danger areas, and locations of barrier / danger should be marked on your ‘global Maze resource’ · The thread ‘loses its life’ (i.e. should be destroyed) if it has encountered a danger area (‘X’) !! G) Whenever a thread is destroyed, your program should create another replacement thread, to traverse the jungle maze beginning from the Start Location again. But this time, it should
  • 14. access the ‘global Maze resource’ to learn and avoid the barriers and danger areas discovered by its predecessor threads! H) In this way, the ‘sacrifice’ of the destroyed threads are not in vain, as its knowledge (of locations of the barriers / danger areas) have been recorded in the ‘global Maze resource’ that can be accessed by future generations of created threads to aid their survival in order to discover a path to End Location! I) As you probably guess by now, the access to the ‘global Maze resource’ should be protected via usage of mutex locks. Whether a thread is: · Updating its discovery of the path to barrier / danger areas OR · Accessing the ‘global Maze resource’ to learn about the discovered locations of the barriers / danger areas Only 1 thread can access it at any one time! J) Once the program is completed and tested to be working successfully, you are highly encouraged to add on “new features” to the program that you feel are applicable to the task of finding the shortest path thru a maze. Additional marks may be awarded subject to the relevancy and correctness of the new functionalities.
  • 15. K) Your program should be written in C++, and using the library functions available in header file ‘pthread.h’, to handle all aspects of thread creation, management and synchronization. L) To encourage good program design, you should consider using different *.cpp class files to encapsulate groups of related methods/functions. Additional Resources · After all students have gone through this document, your tutor will hold a special session to discuss / elaborate on the requirements of this assignment. · In addition, your tutor will hold a Q & A sessions to clarify any issues/doubts you may have on the analysis and design of this multi-threaded program. To ensure a fruitful session, all students must come prepared with their list of questions, so that everybody’s time is efficiently utilized. Deliverables 1) The deliverables include the following: a) The actual working shell program (hard+soft copies), with comments on each file, function or block of code to help the tutor understand its purpose. b) A word document (hard+soft copies) that elaborates on:
  • 16. · (Interpreted) requirements of the program · Diagram / Illustrations of program design · Summary of implementation of each module in your program · Reflections on program development (e.g. assumptions made, difficulties faced, what could have been done better, possible enhancements in future, what have you learnt, etc) c) A program demo/evaluation during lab session. You must be prepared to perform certain tasks / answer any questions posed by the tutor. 2) IMPT: Please follow closely, to the submission instructions in Appendix C, which contains details about what to submit, file naming conventions, when to submit, where to submit, etc. 3) The evaluation will be held during lab session where you are supposed to submit your assignment. Some time will be allocated for you to present / demonstrate your program during the session. Grading Student’s deliverable will be graded according to the following criteria: (i) Program fulfills all the basic requirements stipulated by the assignment
  • 17. The requirements includes some/all of the following: · Ability to handle maze of different sizes · No. of danger areas uncovered · No. of barriers uncovered · No. of threads utilized · Validity of the single solution path (a series of Point locations leading from Start to End locations (ii) Successful demonstration of a working program, clarity of presentation and satisfactory answers provided during Q & A session. (iii) Additional efforts in enhancing the program with features over and above task requirements, impressive, “killer” presentation and demonstration, etc. (iv) After the submission of deliverables, students will be required undergo an evaluation process (to determine fulfillment of task requirements.) Further instructions will be given by the Tutor during the subsequent respective labs. Please pay attention as failure to adhere to instructions may result in deduction of marks.
  • 18. Tutor’s note: In the real working world, satisfactory completion of your tasks is no longer enough. The ability to add value, communicate and/or demonstrate your ideas with clarity is just as important as correct functioning of your program. The grading criteria is set to imitate such requirements on a ‘smaller scale’. APPENDIX A (Sample contents for Maze ‘mazedata.txt’) Length : 20 Breadth : 10 // ------------------------------ // ----- Start of Maze Data ----- // ------------------------------ // 'S' denotes Starting position // 'E' denotes Ending position // '#' denotes Barrier
  • 19. // 'X' denotes Danger Area #################### #S # # # # # ## ## ### ### # # # # E # ## # # X # X ## # # X ### ##### # # # # # # ### # ### ### ## # ##### # # # #################### APPENDIX B
  • 20. (Output solution stored in a generated text, based on the maze configuration in Appendix A) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # # # # # # # # # # # # # # # # # 1 # S # # # 2 # # # # # # # # # # # # 3 # # # # E # 4 # # # # X # X # # # 5 # X # # # # # # # # # 6 # # # # # # # # 7 # # # # # # # # # # # # # # # 8 # # # 9 # # # # # # # # # # # # # # # # # # # #
  • 21. _length : 20 _breadth : 10 _startLocation : [ 1, 1 ] _endLocation : [ 17, 3 ] No. of paths discovered : 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 1 S 2 3 E 4 5 6
  • 22. 7 8 9 _length : 20 _breadth : 10 _startLocation : [ 1, 1 ] _endLocation : [ 17, 3 ] No. of paths discovered : 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # # # # # # # # # # # # # # # # # 1 # S # # # 2 # # # # # # # # # # # #
  • 23. 3 # # # # E # 4 # # # # X # X # # # 5 # X # # # # # # # # # 6 # # # # # # # # 7 # # # # # # # # # # # # # # # 8 # # # 9 # # # # # # # # # # # # # # # # # # # # Thread 'POOH' has been created !! Total no. of steps : 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 S 2
  • 24. 3 E 4 5 6 7 8 9 Total no. of steps : 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 # S 2
  • 25. 3 E 4 5 6 7 8 9 Total no. of steps : 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 # S 2 # 1 3 E
  • 26. 4 5 6 7 8 9 Total no. of steps : 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 # S 2 # 1 3 2 E
  • 27. 4 # 5 6 7 8 9 Total no. of steps : 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 # S 2 # 1 3 # 2 E 4 #
  • 28. 5 6 7 8 9 Total no. of steps : 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # 1 # S 2 # 1 4 # 3 # 2 3 E 4 #
  • 29. 5 6 7 8 9 Total no. of steps : 6 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S 5 2 # 1 4 # 3 # 2 3 E 4 # 5
  • 30. 6 7 8 9 Total no. of steps : 6 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S 5 # 2 # 1 4 # 3 # 2 3 E 4 # 5
  • 31. 6 7 8 9 Thread 'POOH' hits a DEAD END near [2, 1] !! Thread 'TIGGER' has been created !! Thread 'ROO' has been created !! =============================================== ============ Elapsed Time : 0 Latest Update ... =============================================== ============ Dead End Paths Found : 1
  • 32. Barriers Discovered : 8 Danger Area Discovered : 0 Total no. of steps : 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 5 6 7
  • 33. 8 9 Total no. of steps : 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 6 7 8
  • 34. 9 Total no. of steps : 6 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 5 6 # 7 8
  • 35. 9 Total no. of steps : 7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 6 5 6 # 7 8 9
  • 36. Total no. of steps : 7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 8 9
  • 37. Total no. of steps : 8 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 8 9 Total no. of steps : 8
  • 38. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 8 9 Total no. of steps : 9
  • 39. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 8 9 Total no. of steps : 9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 40. 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 9 Total no. of steps : 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 41. 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 9 9 # Total no. of steps : 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # #
  • 42. 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 # 9 9 # Total no. of steps : 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # #
  • 43. 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 # 9 10 9 # Total no. of steps : 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S #
  • 44. 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 # 9 10 9 # # Total no. of steps : 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S #
  • 45. 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 6 5 6 # 7 # 7 # 8 # 8 # 9 10 # 9 # # Thread 'TIGGER' hits a DEAD END near [2, 1] !! =============================================== ============ Elapsed Time : 1 Latest Update ...
  • 46. =============================================== ============ Dead End Paths Found : 2 Barriers Discovered : 22 Danger Area Discovered : 0 Thread 'TIGGER' hits a DEAD END near [2, 8] !! =============================================== ============ Elapsed Time : 2 Latest Update ... =============================================== ============ Dead End Paths Found : 3 Barriers Discovered : 22
  • 47. Danger Area Discovered : 0 Thread 'ROO' hits a DEAD END near [2, 1] !! =============================================== ============ Elapsed Time : 3 Latest Update ... =============================================== ============ Dead End Paths Found : 4 Barriers Discovered : 22 Danger Area Discovered : 0 Total no. of steps : 7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # #
  • 48. 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 6 # # 7 # # 8 # # 9 # # Total no. of steps : 8 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # #
  • 49. 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 6 # # 7 7 # # # 8 # # 9 # # Total no. of steps : 8 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S #
  • 50. 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 6 # # 7 7 # # # 8 # # 9 # # Total no. of steps : 9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S #
  • 51. 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 6 # # 7 8 7 # # # # 8 # # 9 # # Total no. of steps : 9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 #
  • 52. 3 # 2 3 E 4 # 4 # 5 # 5 6 X 6 # # 7 8 7 # # # # 8 # # 9 # # Thread 'TIGGER' stepped into DANGER at [4, 5] !! =============================================== ============ Elapsed Time : 4 Latest Update ... ===============================================
  • 53. ============ Dead End Paths Found : 4 Barriers Discovered : 26 Danger Area Discovered : 1 Thread 'TIGGER' is dead! It's sacrifice shall not be in vain! Creating new thread 'GOLPHER' Thread 'GOLPHER' has been created !! Thread 'POOH' hits a DEAD END near [2, 8] !! =============================================== ============ Elapsed Time : 5 Latest Update ... =============================================== ============
  • 54. Dead End Paths Found : 5 Barriers Discovered : 26 Danger Area Discovered : 1 Total no. of steps : 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 X 6 # # 7 8 9 #
  • 55. 7 # # # # 8 # # 9 # # Total no. of steps : 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # #
  • 56. 8 # # 9 # # Total no. of steps : 12 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 3 # 2 3 E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # #
  • 57. 8 # # 9 # # Total no. of steps : 13 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # # 3 # 2 3 12 E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # #
  • 58. 9 # # Total no. of steps : 13 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # # 3 # 2 3 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # #
  • 59. 9 # # Total no. of steps : 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # #
  • 60. Total no. of steps : 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # 1 # S # 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # #
  • 61. Total no. of steps : 16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # 1 # S # 15 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # # Total no. of steps : 16
  • 62. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # 1 # S # 15 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # # Total no. of steps : 17
  • 63. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # 1 # S # 15 16 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # # Total no. of steps : 17 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 64. 0 # # # # 1 # S # 15 16 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # 9 # # Total no. of steps : 17 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 65. 0 # # # # 1 # S # 15 16 # 2 # 1 # 14 # 3 # 2 3 13 12 # E 4 # 4 # 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # # 8 # # Thread 'ROO' hits a DEAD END near [2, 8] !! 9 # # =============================================== ============ Elapsed Time : 6
  • 66. Latest Update ... =============================================== ============ Dead End Paths Found : 6 Barriers Discovered : 38 Danger Area Discovered : 1 Thread 'ROO' hits a DEAD END near [5, 1] !! =============================================== ============ Elapsed Time : 7 Latest Update ... =============================================== ============ Dead End Paths Found : 7
  • 67. Barriers Discovered : 38 Danger Area Discovered : 1 Total no. of steps : 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # 1 # S # # 2 # 1 # # 3 # 2 3 13 12 # E 4 # 4 # 14 11 # 5 # 5 6 X 10 # 6 # # 7 8 9 # 7 # # # #
  • 68. 8 # # 9 # # Note : · There are many pages of other intermediate output that is not feasible to show in this Appendix. · We are now skipping straight to the ending portion of the output. · Below output show the LAST FEW STEPS of the thread exploration leading to the discovery of a single, solution path from Start Location ‘S’ to End Location ‘E’ !! Total no. of steps : 51 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # # # # # # # # # # # 1 # S # # 23 24 25 26 33 34 35 36 37 2 # 1 # # # 22 # # 27 32 # # # 38 # # 3 # 2 3 # 21 20 # 28 31 # 40 39 50 49 #
  • 69. 4 # 4 # # 19 # 29 30 41 # # 48 # 5 # 5 6 X # # # 18 # # # # 42 45 46 47 # 6 # # 7 8 9 # 17 # # 43 44 # # 7 # # # # 10 # # # 16 # # # # # # # 8 # # 11 12 13 14 15 # 9 # # # # # # # # # # # # # # # # # Thread 'ROO' just found a solution! Well done!! Finished Finding a SAFE PATH !! Printing submitted maze solution ... Printing solution for Tan Ah Beng, id : 1001001 --------------------------------------------------------------------------- ----------------- Total no. of steps : 50
  • 70. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 # # # # # # # # # # # # # # 1 # S # # 23 24 25 26 33 34 35 36 37 2 # 1 # # # 22 # # 27 32 # # # 38 # # 3 # 2 3 # 21 20 # 28 31 # 40 39 E 49 # 4 # 4 # # 19 # 29 30 41 # # 48 # 5 # 5 6 X # # # 18 # # # # 42 45 46 47 # 6 # # 7 8 9 # 17 # # 43 44 # # 7 # # # # 10 # # # 16 # # # # # # # 8 # # 11 12 13 14 15 # 9 # # # # # # # # # # # # # # # # # Total no. of Threads submitting info : 3 Duplicated Paths (to Barriers) submitted : 155
  • 71. Duplicated Paths (to Danger Area) submitted : 0 Total no. of Barrier ('#') discovered : 90 out of 105 !! Total no. of Danger Area ('X') discovered : 1 out of 3 !! Printing Thread Statistics !! --------------------------------------------------------------------------- ----------------- Stats for Thread ID : 3070360432 Found