Build a simulation of a mouse trying to find piece of cheese

Assignment Help Simulation in MATLAB
Reference no: EM132268008

Mini Project - Mouse and Cheese

Introduction - A biological research firm wants you to build a simulation of a mouse trying to find a piece of cheese in a maze. In the function you will write, you will have a representation of the mouse, cheese, and obstacles in a maze. In this representation:

  • The number 0 represents an empty space without a mouse, cheese, or an obstacle.
  • The number 1 represents the mouse.
  • The number 2 represents the cheese.
  • The number 3 represents obstacles.

An example of this is shown below:

1889_figure.png

You can create this example with the following code:

x = zeros(10,10);

x(2, 2) = 1;

x(9, 8) = 2;

x(3, 3) = 3;

x(5, 3) = 3;

x(5, 6) = 3;

x(7, 4) = 3;

x(8, 6) = 3;

Feel free to use this example to test your code, but do note that the code you will write should work on a matrix of any size.

You can also visualize a matrix by using the imagesc(matrixName) command, where matrixName is the name of the matrix you want to visualize. Note that for this project, when you visualize a matrix in this way, mice will be blue, obstacles will be yellow, and cheese will be green. Empty spaces will be purple.

Procedure - You should write a function that takes one input, a maze with the locations of obstacles, mouse, and cheese already in place. Your code should return two outputs:

  • cheeseFound, a Boolean variable that says whether the mouse found the cheese.
  • finalState, a matrix of the last state of the maze.

Your code should simulate the mouse going through the maze by iterating through the sequence of moves it makes. The mouse has the following set of rules:

1. The mouse always knows the vertical and horizontal distance between itself and the cheese because of its excellent sense of smell. Your program should perform the appropriate commands to determine how far the mouse is from the cheese at the start, and then update that distance as the mouse moves.

2. The mouse only moves vertically and horizontally (up, down, left, or right).

3. The mouse must move within the maze by increments of 1 space.

4. The mouse cannot leave the maze.

5. The mouse always knows the last move it made, and cannot move back to the previous square it was just in.

Attachment:- Assignment File.rar

Reference no: EM132268008

Questions Cloud

Explain some of the behaviors of the same-sex adult : Explain some of the behaviors of the same-sex adult that you learned as a child and now demonstrate. Based on social cognitive theory, explain how you might.
Evaluate the control types and tightness of the controls : Evaluate the control types and the tightness of the controls with reference to the optimum balance of control and autonomy imposed on employees.
What do you think the intention was for act 1 : What connections do you see between the use of Three-Act tasks and the kind of math teaching you think I'm trying to promote in our class?
Describe the impact of social context on obedience : In Week 2, you were introduced to the bystander effect (Darley & Latané, 1968). The perceived diffusion of responsibility makes bystanders less likely.
Build a simulation of a mouse trying to find piece of cheese : Mini Project - Mouse and Cheese - A biological research firm wants you to build a simulation of a mouse trying to find a piece of cheese in a maze
Contribution is deductible for each type : How much if any contribution is deductible for each type and provide your recommendation as to which one he should choose and explain why?
How children might make up words like swimmed or teached : Which of these perspectives best explains how children might "make up" words like "swimmed" or "teached"? (And I don't mean just any made up words.
Turnkey projects-franchising and offshore production : Write a short notes on turnkey projects, franchising and offshore production.
Share a piece of news about an ethnocentric experience : Share a piece of news about an ethnocentric experience or event. How is this an example of ethnocentrism? What people were affected? How could ethnocentrism

Reviews

len2268008

3/27/2019 10:34:26 PM

Before reading this assignment, remember that the Guide to Mini Projects is ALWAYS part of the instructions for EVERY Mini Project Assignment. Please go back and read it before beginning. Feel free to use above example to test your code, but do note that the code you will write should work on a matrix of any size.

Write a Review

Simulation in MATLAB Questions & Answers

  Calculate the stress intensity factor

Use the three-parameter zone finite element method or the boundary collocation method to calculate the stress intensity factor K, at the crack tip for the plate

  Build a simulation using newtons laws of motion

Build a new and different simulation of your own using Newtons laws of motion and Show the code and describe how it works

  Write the specification of load mover

Write the specification of LOAD MOVER detailed of the whole design and precise for automatic control section and divide the design into various modules and Is the kernel required if yes which one?

  Design the automatic control section using statecharts

Aim of this project is to design an embedded system which can move loads from one place to another. The system can be operated manually, automatically and wirelessly.

  Need an expert who can model a drill in simulink

Need an expert who can model a drill in Simulink. Working model of a drill needing for an improvment to behave more realistically as a drill to drill through plastic block.

  Project is on load frequency control using fpid

Project is on load frequency control using FPID tuned using GA and PSO algorithm and the system is a two area system.

  Number of packets received with time

Let x be the number of packets received with time -

  Build a matlab based graphical user interface

Build a Matlab based graphical user interface (GUI) that operates in conjunction with a base Matlab/ Simulink simulation program. Any base simulation is considered acceptable.

  Build a matlab based graphical user interface

Build a Matlab based graphical user interface (GUI) that operates in conjunction with a base Matlab/ Simulink simulation program. Any base simulation is considered acceptable.

  Simulate the standardised sum of independent

Simulate the standardised sum of independent and identically distributed variates - Fit a linear regression model as in Q5, and plot your estimates for β0 and β1 as N increases, together with a line indicating their true values. Supply your code.

  Plot the original periodic square wave

Plot the original periodic square wave on the same graph. Comment on the difference between the original periodic square wave and its truncated Fourier series presentation.

  Use matlab to plot the function

Plot the original periodic square wave on the same graph. Comment on the difference between the original periodic square wave and its truncated Fourier series presentation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd