PHP Code:
#ifndef CUSTOMER_H
#define CUSTOMER_H
//---------------------------------------------
//File:Customer Class Definition
//Models a generic customer for queing networks
//---------------------------------------------
class Customer {
public:
//Constructor for Customer, initializes its ID#
Customer();
Customer(double newAttr, int newID, double newWork,int newArrivalP);
int GetArrivalPeriod(double periodLength);
//attribute--can be used to store any value
double attribute;
//ID number for this object
int ID;
//workload for customer, assigned on arrival
double workload;
int arrivalPeriod; //period that customer arrives in
};
//-------MEMBER FUNCTIONS--------------------------------------------
///Constructor
Customer::Customer()
{
attribute=0; //set to 0 for now
ID=-1; //give this Customer a dummy ID
workload = 0; //set to 0 for now
}
Customer::Customer(double newAttr, int newID, double newWork, int newArrivalP){
attribute = newAttr;
ID = newID;
workload = newWork;
arrivalPeriod = newArrivalP;
}
int Customer::GetArrivalPeriod(double periodLength){
int arrivPeriod; //arrival period of customer entering service
arrivPeriod = int(ceil(attribute / periodLength));
return arrivPeriod;
}
//-------End of Customer Class-----------------------------------------
#endif