From 6d140e90210836162e085a66eb43da32d456988d Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 5 Nov 2012 17:59:08 -0500 Subject: [PATCH] Add the dummy class, and clean up the base algorithm --- baseAlgorithm.java | 4 ++-- dummyAlgorithm.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 dummyAlgorithm.java diff --git a/baseAlgorithm.java b/baseAlgorithm.java index e19d944..d5fffdb 100644 --- a/baseAlgorithm.java +++ b/baseAlgorithm.java @@ -7,10 +7,10 @@ public class baseAlgorithm{ memoryBlock = new int[memorySize]; } - void allocate(){ + void allocate(int jobID, int jobSize, int jobTime){ /* This method to be overloaded by each algorithm */ } - void deallocate(){ + void deallocate(int jobSize, int beginningLocation){ } } diff --git a/dummyAlgorithm.java b/dummyAlgorithm.java new file mode 100644 index 0000000..58851b5 --- /dev/null +++ b/dummyAlgorithm.java @@ -0,0 +1,17 @@ +public class dummyAlgorithm{ + + int[] memoryBlock; + + void dummyAlgorithm(int memorySize){ + /* Constructor needed for each algorithm */ + memoryBlock = new int[memorySize]; + } + + void allocate(int jobID, int jobSize, int jobTime){ + /* This method to be overloaded by each algorithm */ + return System.out.println("Allocating job " + jobID + " with size: " + jobSize + " for: " + jobTime + " milliseconds."); + } + void deallocate(int jobSize, int beginningLocation){ + return System.out.println("Removing job with size: " + jobSize + " beginning at: " + beginningLocation); + } +}