logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Create a vector of Point structs. The vector should contain all the points from (1,1) to the bounds... ie (1,1) (1,2) (2,1)...

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

perlin noise is a technique to generate textures (and landscapes) using gradient noise. The textures will be "random" but pixel values change in a gradient manor. Ken Perlin won an Academy Award for his algorithm.

The dcurses library gives us the ability to draw colors to the screen and Perlin noise gives us texture information! We will display a Perlin noise image in the terminal using the 24 colors of grayscale in the ANSI pallet (colors 232-255).

In order to speed up our computation time we will use threads to calculate different parts of the texture in parallel.

Your README should include an analysis of how the number of threads increases or decreases the runtime. Is there a point where more threads runs slower? List out multiple trials (runs) for different numbers of threads.

Implementation

The easiest path to getting the most points might be:

  1. Create a vectorof Point structs. The vector should contain all the points from (1,1) to the bounds... ie (1,1) (1,2) (2,1)...
  2. Randomly shuffle the vector
  3. Loop through the vector and print out all of the points (Are they in random order?)
  4. Change your loop to generate a Perlin noise value for each point
  5. Print out the noise value as a color (noise*23+232)
  6. Get the current time in milliseconds at the start of main
  7. Get the time after the loop (How much time has elapsed?)
  8. Process a command line argument for the Perlin seed
  9. Convert your code to work with a single thread generating all the noise values (Do you need a join?)
  10. Convert your code to have two threads share the work of generating the noise values (Do you need a mutex?)
  11. Process a command line argument for the number of threads
  12. Does the processing time change with the number of threads? Start a README.txt
  13. Get dcurses.c to compile with your C++ code
  14. Use the example code to have the threads draw to the screen
  15. Get an A
(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

656 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

522 Answers

Hire Me
expert
Husnain SaeedComputer science

683 Answers

Hire Me
expert
Atharva PatilComputer science

567 Answers

Hire Me

Get Free Quote!

385 Experts Online