Закрыт

Write some Software

Consider following algorithms for placing processes into holes in memory: best fit. Your assignment is to write a simulator that will take processes of varying sizes, load them into memory according to each of those rules, and swap processes out as needed to create a larger hole. Following assumptions are made:

1. Memory size is 128MB

2. Size of each process will be some number (integer) in the range 1 to 128MB.

3. An initial list of processes and their sizes is loaded from a file. These processes should be loaded into a queue of processes waiting to be loaded into memory.

4. Memory is initially empty. (We will ignore the operating system.)

5. If a process needs to be loaded but there is no hole large enough to accommodate it, then one or several processes should be swapped out, one at a time, until there is a hole large enough to hold the process that needs to be loaded.

6. If processes need to be swapped out, then the process that has been “in memory” the longest should be the one to select.

7. When a process has been swapped out, it goes to the end of the queue of processes waiting to be swapped in.

8. Once a process has been swapped out for a third time, we assume that that process has run to completion, and it is not re-queued. Note: not all processes will be necessarily swapped out for a third time.

9. The simulation terminates when the queue of processes are empty.

Input

The "process file" will be in the following format:

Process id <space> process size (an integer).

Here is a sample process file:

1234 13

5678 99

9101 2

Output

Your program should do the following:

1. Each time a process is loaded into memory, a memory map and statistics line should be printed as according to following example:

2. Memory Map showing all the memory filled and empty.

3. Statistics:

Number of processes in memory = 5

Number of holes = 3

Memory usage = 41%,

Cumulative memory = 40

• Memory usage refers to the percent of memory that is currently occupied by processes,

• Cumulative memory (in percent) gives the average of all the memory usage up until and including the current process load.

4. When the queue is empty, following should be printed:

Total process loaded = 33

Average number of processes in memory= 14.4

Average number of holes = 6.3

Навыки: Java, Архитектура ПО

Показать больше: statistics architecture, statistics algorithms, software algorithms, line algorithms, best algorithms, architecture statistics, algorithms software, software write php program, free software write book, software write book, write protect usb program, java program examples elevator select floor fire alarm, write assembly languages program add number, write simple excel program, write read file program, software write protect software, software write technical manual

О работодателе:
( 0 отзыв(-а, -ов) ) Saudi Arabia

ID проекта: #10330467

9 фрилансеров(-а) готовы выполнить эту работу в среднем за $189

eperfections

I am top ranked java programmer. I can do this complex memory simulation project.

$555 USD за 10 дней(-я)
(464 отзывов(-а))
7.5
$100 USD за 2 дней(-я)
(245 отзывов(-а))
6.7
khannanav

We have a team of expert developers with more than 10 years of rich industry experience and would be the best fit for the work.

$155 USD за 3 дней(-я)
(11 отзывов(-а))
5.5
$105 USD за 3 дней(-я)
(5 отзывов(-а))
4.4
anuragiitk

I am an IITK graduate, 9 year experienced software professional and I have got top notch developers in my team, who have got experience across a span of technologies. The members in my team have worked with top notch t Больше

$266 USD за 3 дней(-я)
(26 отзывов(-а))
5.7
XcodeQuidfg

Thank you for viewing my profile you can check have 5***/5*** also have 100% complete rate you can check happy customer. always trying to get customer satisfaction. I have gone through your project requirement Больше

$137 USD за 7 дней(-я)
(20 отзывов(-а))
3.5
amsik2009

Hello. I've made such initial data 1234 13 5678 99 9101 2 13 13 14 1 987 14 8523 100 and have as a result something like this MPos Size PID 0 13 1234 13 115 Empty Number of processes in memo Больше

$50 USD за 1 день
(1 отзыв)
0.7
vickyzia

This problem can be solved in java by making a class to represent the process and apply the rules accordingly as required in the project. With me everything will be done according to the requirements.

$111 USD за 3 дней(-я)
(0 отзывов(-а))
0.0
$222 USD за 15 дней(-я)
(0 отзывов(-а))
0.0