Question: (In C++ if possible) 8A. Create a class asteroid (or roid for short) and randomly place them in 3d space. Each has an id number,

(In C++ if possible)

8A. Create a class asteroid (or roid for short) and randomly place them in 3d space. Each has an id number, a mass, and an array of size three that contains the %mass for three important natural resources, these percentages MUST sum to less than 100, and usually are far less, the rest of the mass is considered waste. The average sum is 21% for all asteroids. You can consider each then to have a mean of 21/3 or 7% with a standard deviation of 4. No percentage can be negative. These asteroids lay in a ring of radius 50 from a center of rotation (our star). Their radius from the ring has a mean of 8 and a standard deviation of 5. They are uniformly distributed along the ring (0 to 2PI) AND from the ring. No two asteroids can exist in the same location as any other. Allow the user to enter N, the number of asteroids, generate all the values, display the data to the screen, then create a 3d gnuplot of this ring of asteroids.

8B. Imagine we are far in the future, we are mining asteroids from problem 8A above, for natural resources. To achieve this we have created a suite of bots. Survey bots (SB), mining bots (MB) and transport bots (TB). Create a class asteroid (or roid for short). You are to create a list of queues of these bots. A queue for each type of bot. Each bot as a unique identifier (int). Allow the user to enter just how many of each kind is to be created. These bots function as follows: Given a list of asteroids The survey bots begin to search through random asteroids, if they find an asteroid whose sum is greater than 15, they send a message to the next available mining bot. The mining bot will travel there (instantaneously for this project) and begin operations. When a number of time steps equal to the percent sum is over, the mining bot returns to the queue to wait for its next assignment. A transport bot is dispatched to pick up the resources. This is a time stepping simulation, controlled by the user, you need only print to the screen when bots are doing something, a run time sample follows:

How many asteroids? 100

How many survey? 3

How many mining? 6

How many transport? 2

Ready:

Survey bots 1, 2, 3 dispatched

Time 1:

SB1 searching asteroid 55

SB2 searching asteroid 27

SB3 searching asteroid 60

Time 2:

SB1 searching asteroid 4

SB1 resources found, sum = 18

MB1 dispatched to asteroid 4

SB2 searching asteroid 9

SB3 searching asteroid 100

Time 3:

..etc

Time 18:

MB1 finished at asteroid 4

MB1 returns to queue

TB1 dispatched to asteroid 4

SB1 searching asteroid 89

.etc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!