From 964248fda737c0597dbe2d6dac5cc822f8914219 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 26 Nov 2012 00:01:56 -0500 Subject: [PATCH] Finalized tester class, in file, updated log --- in.txt | 40 ++++++++++++++++++++++++++++++++++++++++ log.txt | 13 +++++++------ memoryManagement.java | 8 ++++++-- 3 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 in.txt diff --git a/in.txt b/in.txt new file mode 100644 index 0000000..234db10 --- /dev/null +++ b/in.txt @@ -0,0 +1,40 @@ +2,1029 +7,364 +6,3704 +3,1966 +2,1644 +8,4967 +8,4719 +7,1022 +6,4983 +2,3439 +2,1330 +8,2701 +9,1963 +10,1615 +2,1919 +1,1853 +5,2029 +1,835 +5,4555 +7,876 +1,581 +8,3074 +5,1937 +2,1874 +3,3942 +10,2605 +8,2643 +10,2648 +3,2724 +4,4525 +2,3590 +3,5034 +1,1196 +6,3967 +3,1146 +6,4342 +9,1231 +6,1547 +9,3207 +3,4139 diff --git a/log.txt b/log.txt index ac4d35e..6ca2ada 100644 --- a/log.txt +++ b/log.txt @@ -1,11 +1,12 @@ Memory Management Log --------------------------- -Job Amount: 200 +Job Assignment: in.txt +Job Amount: 40 Memory Size: 100 --------------------------- Final Times (All times in milliseconds) -Threaded time: 0 -Best fit time: 0 -Worst fit time: 0 -First fit time: 28094 -Next fit time: 26375 +Threaded time: 5372 +Best fit time: 3 +Worst fit time: 3 +First fit time: 3705 +Next fit time: 3706 diff --git a/memoryManagement.java b/memoryManagement.java index 7b9b6a3..ff48d86 100644 --- a/memoryManagement.java +++ b/memoryManagement.java @@ -71,7 +71,7 @@ public class memoryManagement{ System.out.println("complete"); System.out.println(jobLength+" jobs found on file"); } - + //Send jobs to algorithm, time is calculated and printed out after completion //Note that we use `jobLength - 1` to compensate for the id above //Threaded Fit @@ -119,9 +119,13 @@ public class memoryManagement{ System.out.println("complete"); System.out.println("Elapsed time for next fit allocation algorithm to complete " + jobLength + " jobs is " + timeEnd[4] + " milliseconds"); - System.out.println("Printing to log..."); + System.out.print("Printing to log..."); out.println("Memory Management Log"); out.println("---------------------------"); + if(read.equals("")) + out.println("Job Assignment: Random"); + else + out.println("Job Assignment: " + read + ".txt"); out.println("Job Amount: " + jobLength); out.println("Memory Size: " + MEMORYSIZE); out.println("---------------------------");