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

  Design a DTMF decoder which is capable of decoding

MATLAB Assignment - DTMF Decoder - The objective of this lab is to design a DTMF decoder, which is capable of decoding a three- digit extension number

  Develop a fuzzy forecasting system using matlab

Develop a fuzzy forecasting system using Matlab Toolbox. The system performs a forecasting task for power marketing price. The data used in this assignment is from the real world and it has been split up into two parts.

  Compute average value and standard deviation of population

Compute the average value and standard deviation of the population. In your Excel sheet, fill the average value cell with a red background and outline the standard deviation cell with a black border.

  Build a simulation model to model given process

uild a simulation model in SIMUL8 to model this process. Find the average total time each type of customer spends in the system, as well as the number of balks. Also, find the maximum length of each queue, and both server utilisations.

  How can you get the amplitude and phase response

Given a complex system transfer function H(w)=Re(H(w))+jlm(H(w)). How can you get its amplitude and phase response? Suppose a system transfer function H(w) has a phase function of p(w), which is unwrapped.

  Describe the component plots as time approaches infinity

In a separate cell (called Summary Cell ) compare the results of Case I and Case II in terms of - Stability, Direction of the phase plot with respect to equilibrium point and initial condition and Describe the component plots as time approaches infin..

  Employ the use of word comparison instructions to control

Utilizing a single timer. employ the use of Word Comparison instructions to control our simulated traffic light. The sequence of operation and timing durations are set out in following timing diagram.

  Discuss the direction of the phase plot

In a separate cell (called Summary Cell) - Discuss the direction of the phase plot with respect to its starting point, where the pulse turns off and at its final value

  Simulate using beam propagation method

Simulate using BPM (Beam propagation method) the following wave guid?

  What is the span of the columns

(a) Generate a random 3x5 matrix ?? with entry integers uniformly between -100 and 100. Hint: Search for help on the functions rand and randi. (b) Put the matrix ?? in reduced echelon form using the command rref. (c) Are the columns of A linearly ..

  Find the transfer function for both systems analytically

ECE 366 ProjectFind the transfer function for both systems analytically. Sketch the magnitude responses to verify that they are all-pass systems

  Build a hopfield network

CPNS 33200 Computational Neuroscience - Neural Networks Lab I: Unsupervised Learning - Build a Hopfield network to store the good and bad prototypes

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