Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Random-Walks-Project/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (13 sloc)
838 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Random-Walks-Project | |
--- | |
### CSE 3504 Project 1 | |
#### Julie Pham and Tony Pham | |
##### Part 1 | |
Simulate a self-avoiding random walk in a finite lattice of 100x100, where the starting point (0,0) is exactly in the middle of the lattice. The simulation stop when the walker is trapped. A trap occurs when at any point in the path, there is no option available for the next step as all available directions have been visited before or out of the borders of the lattice. | |
###### Main Idea | |
1. Generate the 4 coordinates that surround the current one. | |
2. Write filter function which calls built-in filter(lambda, next-positions) | |
3. Pick a random coordinate from the filtered coordinates using built-in random function. | |
4. In main recursive function, keep track of the number of steps taken. | |
###### Random Walk API | |
`gen-coords curr-coord` |