-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.h
59 lines (48 loc) · 1.36 KB
/
Cargo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
using namespace std;
#include <string>
#include "Truck.h"
#include "Time.h"
class Cargo
{ // Time Members in The Cargo
Time PT; //prep. time
int LT; //loading time
Time WT; //waiting time
Time CDT; // cargo delivery time
char types;
const int ID;
int DeliveryDist;
const Truck* Loadingtrcuk;
int Cost;
public:
// constructor
//inialize all data
Cargo(int i, char c, int Dst, int cst, int L,Time t);
//.......... Setters...........//
void SetPt(const Time& t); //truck call it
void SetLt(const int& t); //read from input
void SetWt(const Time& t); //truck call = Truck::MT - PT
void SetDeliveryDist(const int& dist); //
void SetCost(const int& ct);
void setCDT(const Time&);
void setTypes(char c);
void setLoadingTruck(const Truck *); // setting the holding truck
//......... Getters .........//
//Get Time
const Time& GetPt() const;
const int GetLt() const;
const Time& GetWt() const;
const Time& getCDT() const;
//Get Cargo Properties
int GetCost() const;
int GetDist() const;
int getType() const;
const int getID() const;
int getPriority() const;
const Truck* getLoadingTruck() const;
//Get Checkers
bool AutoPCheck(const Time & currentTime, int AutoP) const; // checking the Auto-promotion
bool MaxWCheck(const Time & currentTime, int MaxW)const; //checking the Maximum weight
//Output
void output(ofstream&) const;
};