本文整理汇总了C++中Customer::get_serv_time方法的典型用法代码示例。如果您正苦于以下问题:C++ Customer::get_serv_time方法的具体用法?C++ Customer::get_serv_time怎么用?C++ Customer::get_serv_time使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::get_serv_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
cashier1.inc_timer();
cashier2.inc_timer();
cashier3.inc_timer();
cashier4.inc_timer();
cashier5.inc_timer();
//while customers can still be served
if( sim.get_cnt() < 570 )
{
//set cust to temporarily hold front of custInput
cust = custInput.front();
//if the front of queue is ready to join line
while( cust.get_arrival_time() == sim.get_cnt() )
{
//set the customer to the first available/shortest
//lane; if none are open turn them away
if(
cashier1.get_status() == 'a' &&
(cashier2.get_status() == 'i' ||
cashier1.get_in_line() <= cashier2.get_in_line()) &&
(cashier3.get_status() == 'i' ||
cashier1.get_in_line() <= cashier3.get_in_line()) &&
(cashier4.get_status() == 'i' ||
cashier1.get_in_line() <= cashier4.get_in_line()) &&
(cashier5.get_status() == 'i' ||
cashier1.get_in_line() <= cashier5.get_in_line())
)
{
//adding customers serv time to cashiers queue
cashier1.add_customer( cust.get_serv_time() );
//removing customer from input we added to queue
custInput.pop();
//setting cust to new front so while checks correctly
cust = custInput.front();
}
else if(
cashier2.get_status() == 'a' &&
(cashier1.get_status() == 'i' ||
cashier2.get_in_line() <= cashier1.get_in_line()) &&
(cashier3.get_status() == 'i' ||
cashier2.get_in_line() <= cashier3.get_in_line()) &&
(cashier4.get_status() == 'i' ||
cashier2.get_in_line() <= cashier4.get_in_line()) &&
(cashier5.get_status() == 'i' ||
cashier2.get_in_line() <= cashier5.get_in_line())
)
{
cashier2.add_customer( cust.get_serv_time() );
custInput.pop();
cust = custInput.front();
}
else if(
cashier3.get_status() == 'a' &&
(cashier2.get_status() == 'i' ||
cashier3.get_in_line() <= cashier2.get_in_line()) &&
(cashier1.get_status() == 'i' ||
cashier3.get_in_line() <= cashier1.get_in_line()) &&