NOTE: This assignment is adapted from Operating System Concepts with
Java, 7th edition, by Silberschatz, Galvin, and Gagne.
Write a program the simulates the FIFO and LRU page-replacement algorithms.
Your program should be designed around these classes:
- PageGenerator
- will be used to generate an array of page references
with page numbers ranging from 0 to 9. The constructor for
PageGenerator will accept the number of page references as
a parameter. The class should also have a getReferenceString()
method that returns a reference to array of page references.
- FIFO
- will extend the provided
ReplacementAlgorithm class
by implementing the abstract insert() method so that it will
correctly count page faults based on the FIFO algorithm.
- LRU
- will extend the provided
ReplacementAlgorithm
class
by implementing the abstract insert() method so that it will
correctly count page faults based on the LRU algorithm.
- Test
- will be used to test your FIFO and LRU implementations.
It should be invoked as:
java Test <reference string size> <# of page frames>
Follow these guidelines when working with your partner to complete this homework assignment:
- One person will create a private git repository in BitBucket. Then share
the repository (including write privileges) with your partner and the
instructor (terrys@gmail.com).
- The initial repository should have a README document and should include the
provided ReplacementAlgorithm.java source file.
- Once the initial repository is created in BitBucket each team member can clone
it and begin work.
- One team member will be responsible for writing the PageGenerator class
and the FIFO class. The other team member will be responsible for writing
the LRU class and the Test class.
- The PageGenerator class needs to be written right away. The team
member responsible for it should have the finished and pushed to the BitBucket
repository by Monday 25 March.
- After PageGenerator is working each team member can pull the code
from BitBucket and start work on the remaining segments independently. When
finished the code will need to be merged. There should be at least two commits
from each team member in the final product.
The above instructions apply to teams with 2 members. For the 3 member team duties should
be divided as follows:
- Member A
- create README, create shared repository (and share it),
write PageGenerator class, make sure final tests are coherent and demonstrate
bug-free code for a variety of cases.
- Member B
- Create FIFO class (and test it).
- Member C
- Create LRU class (and test it).
- Billy, Jeremy
- Daniel, WeiChin
- Justin, Laci
- Jair, JungWook
- Angelica, Jennifer
- Matt, Klayton, Avery
Each group's completed assignment must be posted in a private BitBucket prior to
the start of class on the due date. The BitBucket repository must be accessible
by the instructor.
Source code according the following criteria:
Correctness/Completeness |
14 |
pts |
Documentation |
2 |
pts |
Java Conventions |
2 |
pts |
Use of VCS |
4 |
pts |
Total |
22 |
pts |