BAPS/packing/BP/PackHeuristics.h

00001 /**********************************************************************
00002  *
00003  * Filename    : PackHeuristics.h
00004  * Author      : Chen Li Wen
00005  *
00006  * Version     : 1.03
00007  * Date        : July 15, 1998
00008  *
00009  * Description : Interface file for class PackHeuristics. This class 
00010  *               contains some packing heuristics such as FF, BF and WF.
00011  *
00012  * Reference   : nil
00013  *
00014  * Notes       : nil
00015  *
00016  * Changes     : Add in function Random_Fit. (CLW, 29/06/98)
00017  *               Add in function Next_Fit. (CLW, 29/07/98)
00018  *
00019  * Copyright   : Copyright (c) 1998
00020  *               All rights reserved by
00021  *               Resource Allocation and Scheduling Group
00022  *               School of Computing
00023  *               Department of Computer Science
00024  *               National University of Singapore
00025  *
00026  **********************************************************************/
00027 
00028 #ifndef __PACK_HEURISTICS_H__
00029 #define __PACK_HEURISTICS_H__
00030 
00031 #include "FreeSpace.h"
00032 #include "FreeBlock.h"
00033 
00034 #include <LEDA/string.h>
00035 
00036 class PackHeuristics
00037 {
00038    public:
00039       PackHeuristics();
00040       ~PackHeuristics();
00041 
00042       // Functions to find free block for vessel
00043       // For online algorithms
00044       int FindFreeBlock(FreeSpace& aFreeSpace, int aVesLength, 
00045                         FreeBlock& aFreeBlock, string aPackAlgo,
00046                         int& aPosition);
00047 
00048       // Function to find free block for vessel
00049       // For offline algorithms
00050       int FindFreeBlock(FreeSpace& aFreeSpace, int aVesLength,
00051                         FreeBlock& aFreeBlock, string aPackAlgo);
00052       
00053       // First Fit
00054       int First_Fit(FreeSpace& aFreeSpace, int aVesLength, 
00055                         FreeBlock& aFreeBlock);
00056       // Best Fit
00057       int Best_Fit(FreeSpace& aFreeSpace, int aVesLength, 
00058                         FreeBlock& aFreeBlock);
00059       // Worst Fit
00060       int Worst_Fit(FreeSpace& aFreeSpace, int aVesLength, 
00061                         FreeBlock& aFreeBlock);
00062       // Random Fit
00063       int Random_Fit(FreeSpace& aFreeSpace, int aVesLength, 
00064                         FreeBlock& aFreeBlock);
00065 
00066       // Next Fit
00067       int Next_Fit(FreeSpace& aFreeSpace, int aVesLength, 
00068                    FreeBlock& aFreeBlock, int& aPosition);
00069 };
00070 
00071 #endif

Generated on Tue Sep 9 15:40:10 2008 for BAP by  doxygen 1.5.3