Source Code for BAP

(Sept 2002, 12-Oct-2002) [Updated: Feb-2007]

You are given a working code -- BAPS.tar.gz for the BAP. (Please save file as BAPS.tar.gz to untar successfully in Unix. Read the README file in there, especially on the two environment variables to add --- BAPHOME and BAPTMP.)

This code is modified from BAP codes developed by the RAS Research Group, SoC, NUS. This code solves the complete BAP problem (both partitioning and packing). The code consists of three major components, namely

To help you understand the BAPS Software, I have included the following notes. This should help you with coding your own Partitioner.


BAP Base Class Headers

BAPBase is the interface file for generic BAP base class.   All objects of BAP domain inherit from this class. BAPPackage is a data structure to keep all the data and information required by the partitioner and packers. It also provides you the methods to interact with the data.  BAPSolver takes the package as a parameter, and calls the partitioners and packers to solve the BAP problem.

BAPBase.h*
BAPPackage.h**
BAPPacker.h*
BAPPartitioner.h*
BAPSolver.h*
def.h*
util.h*

BAP Base Class Source Code

The main program is baps.cpp, where the BAP package is initialized, and solvers are invoked. BAPSolver takes the package as a parameter, and call partitioners and packers to solve the BAP problem. You need to modify the method BAPSolver::DoPartitioning() to make the program incorporate your own partitioner.

BAPBase.cpp
BAPPackage.cpp
BAPPacker.cpp
BAPPartitioner.cpp
baps.cpp** Updated on 17th, Oct 2002
BAPSolver.cpp**
util.cpp

BAP Trivial Partitioner Source

The Trivial Partitioner is included for your reference. It does random vessel assignment (and so we do not expect good results). However, you can use it to help you write your own partitioner code.

In fact, we strongly urge you try to understand the Trivial Partitioner before you start coding your own partitioner. BAPTVPartitioner  is a trivial but complete example for the partitioner. With a good understanding on it, you will not panic when writing your own partitioner code.

BAPTVPartitioner.cpp** Updated on 21st, Oct 2002

BAPTVPartitioner.h**
BAPTVSection.cpp
BAPTVSection.h*
BAPTVVessel.cpp
BAPTVVessel.h*

BAP Packer Codes (.h and .o files)

The Packer code (executables and .h only) is also given, minus the source .cpp files. Many different BAP packing algorithms are included in these codes. You do NOT need to read this part of the code to do your project. (But, if you have the time or if you want to know more about the packer, you are welcomed to read them.)

BAPBPPacker.h

BAPBPVESPacker.h
BAPSSAPPPacker.h
BAPSSOFFPacker.h
BAPSSPacker.h
BPParamMgr.h
DataMgrDef.h
Event.h
EventList.h
FreeBlock.h
FreeSpace.h
Interval.h
IntervalSet.h
PackDef.h
PackHeuristics.h
SortVessel.h
Vessel.h
VesselTransform.h

* indicates the files that you need to read and understand in order to work smoothly with your own partitioner.


DOxygen Output of the BAPS Source

The entire source code of the BAPS source has also been run through doxygen (with the help of Cheng You Jiang, 2005) and you can see the output here This may be easier to browse with since it also has the class diagrams as well as class hierarchy diagrams.


BAP Partitioning Resources, CS5234, NUS