00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __VESSEL_H__
00034 #define __VESSEL_H__
00035
00036
00037 #include "PackDef.h"
00038 #include "BAPBase.h"
00039
00040
00041
00042 class Vessel
00043 {
00044 public:
00045
00046
00047 Vessel();
00048
00049 Vessel(int aID, int aLength = 0, int aArriveTime = 0,
00050 int aDepartureTime = 0, Bool aStatus = FALSE,
00051 int aWharfMark = -1, int aNumTimeZones = 0,
00052 int aBigDensity = 0, int aAverageDensity = 0);
00053
00054 Vessel(const Vessel& aVessel);
00055
00056
00057 ~Vessel();
00058
00059
00060 Vessel& operator=(const Vessel& aVessel);
00061
00062
00063 void Print(int aWidth = 1, int aDetail = 0) const;
00064
00065
00066 int GetVesID() const;
00067 int GetVesLength() const;
00068 int GetVirtualLength() const;
00069 int GetArriveTime() const;
00070 Bool GetPackStatus() const;
00071 int GetBigDensity() const;
00072 int GetPackingSpace() const;
00073 int GetDepartureTime() const;
00074 int GetAverageDensity() const;
00075 int GetNumberTimeZones() const;
00076 int GetWharfMarkAssignedTo() const;
00077 int GetVirtualWharfMark() const;
00078
00079
00080 void SetVesID(int aID);
00081 void SetVesLength(int aLength);
00082 void SetVirtualLength(int aVirtualLength);
00083 void SetArriveTime(int aArriveTime);
00084 void SetPackStatus(Bool aStatus);
00085 void SetBigDensity(int aBigDensity);
00086 void SetDepartureTime(int aDepartureTime);
00087 void SetAverageDensity(int aAverageDensity);
00088 void SetNumberTimeZones(int aNumTimeZones);
00089 void SetWharfMarkAssignedTo(int aWharfMark);
00090 void SetVirtualWharfMark(int aVirtualWharfMark);
00091
00092
00093
00094
00095
00096 friend int
00097 compare(const Vessel& Lhs, const Vessel& Rhs);
00098
00099
00100 friend int
00101 Comp_VesID_Increase(const Vessel& Lhs, const Vessel& Rhs);
00102 friend int
00103 Comp_VesID_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00104
00105
00106 friend int
00107 Comp_Length_Increase(const Vessel& Lhs, const Vessel& Rhs);
00108 friend int
00109 Comp_Length_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00110
00111
00112 friend int
00113 Comp_WharfMark_Increase(const Vessel& Lhs, const Vessel& Rhs);
00114 friend int
00115 Comp_WharfMark_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00116
00117
00118 friend int
00119 Comp_ArriveTime_Increase(const Vessel& Lhs, const Vessel& Rhs);
00120 friend int
00121 Comp_ArriveTime_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00122
00123
00124 friend int
00125 Comp_DepartTime_Increase(const Vessel& Lhs, const Vessel& Rhs);
00126 friend int
00127 Comp_DepartTime_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00128
00129
00130 friend int
00131 Comp_BigDensity_Increase(const Vessel& Lhs, const Vessel& Rhs);
00132 friend int
00133 Comp_BigDensity_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00134
00135
00136 friend int
00137 Comp_AverageDensity_Increase(const Vessel& Lhs, const Vessel& Rhs);
00138 friend int
00139 Comp_AverageDensity_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00140
00141
00142 friend int
00143 Comp_NumberTimeZone_Increase(const Vessel& Lhs, const Vessel& Rhs);
00144 friend int
00145 Comp_NumberTimeZone_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00146
00147
00148 friend int
00149 Comp_PackingSpace_Increase(const Vessel& Lhs, const Vessel& Rhs);
00150 friend int
00151 Comp_PackingSpace_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00152
00153
00154 friend int
00155 Comp_Duration_Increase(const Vessel& Lhs, const Vessel& Rhs);
00156 friend int
00157 Comp_Duration_Decrease(const Vessel& Lhs, const Vessel& Rhs);
00158
00159
00160 friend ostream& operator<<(ostream& aOutput, const Vessel& aVessel);
00161 friend istream& operator>>(istream& aInput, Vessel& aVessel);
00162
00163
00164 friend Bool
00165 IsOverlap(const Vessel& Lhs, const Vessel& Rhs);
00166
00167
00168
00169 friend int
00170 Comp_Gerg(const Vessel& Lhs, const Vessel& Rhs);
00171
00172
00173 friend Bool
00174 operator==(const Vessel& Lhs, const Vessel& Rhs);
00175
00176 private:
00177
00178 int mID;
00179 int mLength;
00180 int mArriveTime;
00181 int mDepartureTime;
00182 Bool mStatus;
00183 int mWharfMark;
00184 int mNumTimeZones;
00185 int mBigDensity;
00186 int mAverageDensity;
00187
00188
00189 int mVirtualLength;
00190 int mVirtualWharfMark;
00191 };
00192
00193
00194 #endif