Prev: while
Next: object handles
From: Jordan Avro on
1. Reading the configuration of the sweep area
The program should read a file minegrid.csv, which contains 25 x 25 values representing
the configuration of the area. The free locations are represented with 0 and the forbidden with 1.
Mines are indicated by the value 2. The program should ask the user to enter the Base location,
e.g. using x and y coordinates. If the location is out of range or forbidden, the user should be
prompted to re-enter them until valid values are entered.

2. Experimenting with initial strategies
Implement possibly the simplest strategy for detecting mines by finding a path from
the Base to each mine. The robot does not know where the mines are located, and so should move
up and down each row (or column) until it hits a block. If it can’t move because of a block it should
turn right or left, then continue. The robot can revisit the same location, but cannot move to a
forbidden location. It must check every cell in the grid for mines.
The program should ask the user to set a limit for the maximum number of steps the robot is
allowed (e.g. 1000 steps), so that the robot doesn’t wander indefinitely. The program
should display each step the robot takes formatted as columns of x and y coordinates.
• If the maximum number of steps is reached, it should display
Maximum steps reached
• When the robot identifies a mine (say at x = 3, y = 11 after 30 steps) it should display:
Mine found in position (3, 11) after 30 steps
• When the robot has completed its search it should display:
Sweep completed in 30 steps

3.Showing the robot’s progress
The program should ask the user to select a strategy: B for the basic strategy or X for The smarter
Strategy and the maximum number of moves to make. It should then count the number of times
the robot visits a particular square as it tries to find the mines.
Visualize the grid and the movement of the robot as a colour map using the MATLAB
imagesc function using the visits matrix. Finally, use the getframe and movie2avi functions
to create a movie of the visits matrix after each step so we can see the behaviour dynamically.
From: us on
"Jordan Avro" <javro2009(a)hotmail.com> wrote in message <hst8mr$e9r$1(a)fred.mathworks.com>...
> 1. Reading the configuration of the sweep area
> The program should read a file minegrid.csv, which contains 25 x 25 values representing
> the configuration of the area. The free locations are represented with 0 and the forbidden with 1.
> Mines are indicated by the value 2. The program should ask the user to enter the Base location,
> e.g. using x and y coordinates. If the location is out of range or forbidden, the user should be
> prompted to re-enter them until valid values are entered.
>
> 2. Experimenting with initial strategies
> Implement possibly the simplest strategy for detecting mines by finding a path from
> the Base to each mine. The robot does not know where the mines are located, and so should move
> up and down each row (or column) until it hits a block. If it can&#8217;t move because of a block it should
> turn right or left, then continue. The robot can revisit the same location, but cannot move to a
> forbidden location. It must check every cell in the grid for mines.
> The program should ask the user to set a limit for the maximum number of steps the robot is
> allowed (e.g. 1000 steps), so that the robot doesn&#8217;t wander indefinitely. The program
> should display each step the robot takes formatted as columns of x and y coordinates.
> &#8226; If the maximum number of steps is reached, it should display
> Maximum steps reached
> &#8226; When the robot identifies a mine (say at x = 3, y = 11 after 30 steps) it should display:
> Mine found in position (3, 11) after 30 steps
> &#8226; When the robot has completed its search it should display:
> Sweep completed in 30 steps
>
> 3.Showing the robot&#8217;s progress
> The program should ask the user to select a strategy: B for the basic strategy or X for The smarter
> Strategy and the maximum number of moves to make. It should then count the number of times
> the robot visits a particular square as it tries to find the mines.
> Visualize the grid and the movement of the robot as a colour map using the MATLAB
> imagesc function using the visits matrix. Finally, use the getframe and movie2avi functions
> to create a movie of the visits matrix after each step so we can see the behaviour dynamically.

what have YOU done so far to solve YOUR particular problem...

us
From: EE Student on
"Jordan Avro" <javro2009(a)hotmail.com> wrote in message <hst8mr$e9r$1(a)fred.mathworks.com>...
> 1. Reading the configuration of the sweep area
> The program should read a file minegrid.csv, which contains 25 x 25 values representing
> the configuration of the area. The free locations are represented with 0 and the forbidden with 1.
> Mines are indicated by the value 2. The program should ask the user to enter the Base location,
> e.g. using x and y coordinates. If the location is out of range or forbidden, the user should be
> prompted to re-enter them until valid values are entered.
>
> 2. Experimenting with initial strategies
> Implement possibly the simplest strategy for detecting mines by finding a path from
> the Base to each mine. The robot does not know where the mines are located, and so should move
> up and down each row (or column) until it hits a block. If it can&#8217;t move because of a block it should
> turn right or left, then continue. The robot can revisit the same location, but cannot move to a
> forbidden location. It must check every cell in the grid for mines.
> The program should ask the user to set a limit for the maximum number of steps the robot is
> allowed (e.g. 1000 steps), so that the robot doesn&#8217;t wander indefinitely. The program
> should display each step the robot takes formatted as columns of x and y coordinates.
> &#8226; If the maximum number of steps is reached, it should display
> Maximum steps reached
> &#8226; When the robot identifies a mine (say at x = 3, y = 11 after 30 steps) it should display:
> Mine found in position (3, 11) after 30 steps
> &#8226; When the robot has completed its search it should display:
> Sweep completed in 30 steps
>
> 3.Showing the robot&#8217;s progress
> The program should ask the user to select a strategy: B for the basic strategy or X for The smarter
> Strategy and the maximum number of moves to make. It should then count the number of times
> the robot visits a particular square as it tries to find the mines.
> Visualize the grid and the movement of the robot as a colour map using the MATLAB
> imagesc function using the visits matrix. Finally, use the getframe and movie2avi functions

> to create a movie of the visits matrix after each step so we can see the behaviour dynamically.



Do you know Anthony... He was aking for help on this same problem.... Perhaps you guys go to school together, maybe you could work together on it? What have you tried so far and where are you stuck?
From: Jordan Avro on
"EE Student " <np7(a)cec.wustl.edu> wrote in message <hstdkp$10o$1(a)fred.mathworks.com>...
> "Jordan Avro" <javro2009(a)hotmail.com> wrote in message <hst8mr$e9r$1(a)fred.mathworks.com>...
> > 1. Reading the configuration of the sweep area
> > The program should read a file minegrid.csv, which contains 25 x 25 values representing
> > the configuration of the area. The free locations are represented with 0 and the forbidden with 1.
> > Mines are indicated by the value 2. The program should ask the user to enter the Base location,
> > e.g. using x and y coordinates. If the location is out of range or forbidden, the user should be
> > prompted to re-enter them until valid values are entered.
> >
> > 2. Experimenting with initial strategies
> > Implement possibly the simplest strategy for detecting mines by finding a path from
> > the Base to each mine. The robot does not know where the mines are located, and so should move
> > up and down each row (or column) until it hits a block. If it can&#8217;t move because of a block it should
> > turn right or left, then continue. The robot can revisit the same location, but cannot move to a
> > forbidden location. It must check every cell in the grid for mines.
> > The program should ask the user to set a limit for the maximum number of steps the robot is
> > allowed (e.g. 1000 steps), so that the robot doesn&#8217;t wander indefinitely. The program
> > should display each step the robot takes formatted as columns of x and y coordinates.
> > &#8226; If the maximum number of steps is reached, it should display
> > Maximum steps reached
> > &#8226; When the robot identifies a mine (say at x = 3, y = 11 after 30 steps) it should display:
> > Mine found in position (3, 11) after 30 steps
> > &#8226; When the robot has completed its search it should display:
> > Sweep completed in 30 steps
> >
> > 3.Showing the robot&#8217;s progress
> > The program should ask the user to select a strategy: B for the basic strategy or X for The smarter
> > Strategy and the maximum number of moves to make. It should then count the number of times
> > the robot visits a particular square as it tries to find the mines.
> > Visualize the grid and the movement of the robot as a colour map using the MATLAB
> > imagesc function using the visits matrix. Finally, use the getframe and movie2avi functions
>
> > to create a movie of the visits matrix after each step so we can see the behaviour dynamically.
>
>
>
> Do you know Anthony... He was aking for help on this same problem.... Perhaps you guys go to school together, maybe you could work together on it? What have you tried so far and where are you stuck?

HEY,
I have a pretty solid way of placing the robot as the boundaries to set are not that hard. But in terms of the next part 'searching for the mines' is a whole new step. I have set it up that the robot cannot go on walls and cannot go outside the boundaries, and for movement i used a "randi (4)" statement with 1 to 4 being up,down,left,right. What im really struggling to do is to save in a matrix where the robot has been so i can attempt at telling the robot not go search the same spot twice. Any ideas on how to do that, with an example? Because with that hopefully i can set up 2 options for the user.
For the Anthony question, don't know him. What was his post called? I'll have a look.
From: EE Student on
"Jordan Avro" <javro2009(a)hotmail.com> wrote in message <hsv91f$aaq$1(a)fred.mathworks.com>...
> "EE Student " <np7(a)cec.wustl.edu> wrote in message <hstdkp$10o$1(a)fred.mathworks.com>...
> > "Jordan Avro" <javro2009(a)hotmail.com> wrote in message <hst8mr$e9r$1(a)fred.mathworks.com>...
> > > 1. Reading the configuration of the sweep area
> > > The program should read a file minegrid.csv, which contains 25 x 25 values representing
> > > the configuration of the area. The free locations are represented with 0 and the forbidden with 1.
> > > Mines are indicated by the value 2. The program should ask the user to enter the Base location,
> > > e.g. using x and y coordinates. If the location is out of range or forbidden, the user should be
> > > prompted to re-enter them until valid values are entered.
> > >
> > > 2. Experimenting with initial strategies
> > > Implement possibly the simplest strategy for detecting mines by finding a path from
> > > the Base to each mine. The robot does not know where the mines are located, and so should move
> > > up and down each row (or column) until it hits a block. If it can&#8217;t move because of a block it should
> > > turn right or left, then continue. The robot can revisit the same location, but cannot move to a
> > > forbidden location. It must check every cell in the grid for mines.
> > > The program should ask the user to set a limit for the maximum number of steps the robot is
> > > allowed (e.g. 1000 steps), so that the robot doesn&#8217;t wander indefinitely. The program
> > > should display each step the robot takes formatted as columns of x and y coordinates.
> > > &#8226; If the maximum number of steps is reached, it should display
> > > Maximum steps reached
> > > &#8226; When the robot identifies a mine (say at x = 3, y = 11 after 30 steps) it should display:
> > > Mine found in position (3, 11) after 30 steps
> > > &#8226; When the robot has completed its search it should display:
> > > Sweep completed in 30 steps
> > >
> > > 3.Showing the robot&#8217;s progress
> > > The program should ask the user to select a strategy: B for the basic strategy or X for The smarter
> > > Strategy and the maximum number of moves to make. It should then count the number of times
> > > the robot visits a particular square as it tries to find the mines.
> > > Visualize the grid and the movement of the robot as a colour map using the MATLAB
> > > imagesc function using the visits matrix. Finally, use the getframe and movie2avi functions
> >
> > > to create a movie of the visits matrix after each step so we can see the behaviour dynamically.
> >
> >
> >
> > Do you know Anthony... He was aking for help on this same problem.... Perhaps you guys go to school together, maybe you could work together on it? What have you tried so far and where are you stuck?
>
> HEY,
> I have a pretty solid way of placing the robot as the boundaries to set are not that hard. But in terms of the next part 'searching for the mines' is a whole new step. I have set it up that the robot cannot go on walls and cannot go outside the boundaries, and for movement i used a "randi (4)" statement with 1 to 4 being up,down,left,right. What im really struggling to do is to save in a matrix where the robot has been so i can attempt at telling the robot not go search the same spot twice. Any ideas on how to do that, with an example? Because with that hopefully i can set up 2 options for the user.
> For the Anthony question, don't know him. What was his post called? I'll have a look.



I thought this looked like a fun problem so I gave it a try. Im not sure why you would want to make the movements random, or based on randi, but if thats what you want to do thats up to you. Also, you may not want to completely disallow moving onto a previous square, this can cause you to get stuck places, especially if your movements are random. The way I went about it was after moving to a new square I looked checked the value of all the adjacent squares to determine what they are. If the value equaled the value associated with a mine I recorded it in a "location of mines" matrix. Based on the value of the adjacent squares I then had possible move choices which were the possible moves that were not walls or mines, you always have either 4 or 8 potential moves depending on if you can move diagonally before dissallowing choices absed on boundries and mines. Each time you move to a
new square you can record that it a seperate matrix and each wquare you check the value of can be recorded in a seperate matrix or map. Recorded the data should be the easy part, determining the way to intelligently tell you robot where to go is tougher. I found the best way was to pick new squares based on the number of adjacent squares to the possible new move that have not been checked, with a constraint to continue moving in the same direction if possible - this was assuming you cant predetermine the location of the mines. If you could predetermine the location of the mines, say usinfg the find function, then I would set a target and use a vector based approach to pick the move that would creat the shortest radius to the target but then you need to account for ways to navigate around the walls. As far as recording where youve been you should at least now the row and column you
are standing on, and the iteration number you are on, thats all you need to record where youve been. Another thing you might check out is a couple previous matlab coontests called ants and army ants, they have a similar scenario to this problem and may lend you some ideas.
 |  Next  |  Last
Pages: 1 2
Prev: while
Next: object handles