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.
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* |
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 |
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* |
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.)