00001 /********************************************************************** 00002 * 00003 * Filename : BAPBPVESPacker.h 00004 * Author : Chen Li Wen 00005 * 00006 * Version : 1.0 00007 * Date : Nov. 11, 1998 00008 * 00009 * Description : This is an abstract class. It's the parent class for 00010 * all packers of my BAP packing system. It inherits 00011 * from class BAPPacker. 00012 * 00013 * Reference : nil 00014 * 00015 * Notes : nil 00016 * 00017 * Changes : Currently, it's the parent class of BAPSSPacker and 00018 * BAPMSPacker, the single-section packer and teh multiple 00019 * section packer. 00020 * 00021 * Copyright : Copyright (c) 1998 00022 * All rights reserved by 00023 * Resource Allocation and Scheduling Group 00024 * Department of Computer Science 00025 * School of Computing 00026 * National University of Singapore 00027 * 00028 **********************************************************************/ 00029 00030 00031 #ifndef __BAPBPVESPACKER_H__ 00032 #define __BAPBPVESPACKER_H__ 00033 00034 00035 #include "Vessel.h" 00036 #include "BAPPacker.h" 00037 #include "BAPPackage.h" 00038 00039 00040 #include <LEDA/list.h> 00041 00042 00043 // 00044 // Class inherits from class BAPPacker 00045 // 00046 00047 class BAPBPVESPacker : public BAPPacker 00048 { 00049 public: 00050 00051 // 00052 // All packer classes will be created based on 00053 // an object of class BAPPackage. It contains 00054 // all information needed by all packers inside. 00055 // 00056 00057 BAPBPVESPacker(BAPPackage & aPackage); 00058 ~BAPBPVESPacker(); 00059 00060 00061 // 00062 // Access function 00063 // Section number from 1 to n 00064 // 00065 00066 int GetPackingWidth(int aSectNumber) const; 00067 int GetDensity(int aSectNumber) const; 00068 00069 00070 // 00071 // Get the set of vessels for the given section 00072 // 00073 00074 list<Vessel> VesselSetForSection(int aSectNumber) const; 00075 00076 00077 // 00078 // The virtual function Solve() inherits from parent class. 00079 // The attribute "mPackage" also inherits from it. 00080 // 00081 00082 virtual void Solve() = 0; 00083 00084 protected: 00085 00086 // 00087 // We first init them to the densities of vessels in each 00088 // section; then we will calculate the actual packing 00089 // width for this packing algorithm. 00090 // 00091 00092 list<int> mPackingWidth; 00093 list<int> mDensity; 00094 00095 00096 void CalcPackingWidth(); 00097 00098 00099 private: 00100 00101 // 00102 // Utility to initialize packing width 00103 // 00104 00105 void InitPackingWidth(); 00106 void CalcDensity(); 00107 00108 }; 00109 00110 #endif 00111