?? arriveevent.cpp
字號(hào):
#include<iostream.h>
#include"event.h"
#include"arriveEvent.h"
#include"leaveEvent.h"
#include"orderEvent.h"
#include<assert.h>
#include<stdlib.h>
#include"customerGroup.h"
#include"simulation.h"
#include"storeSimulation.h"
#include"random.h"
extern storeSimulation store;
arriveEvent::arriveEvent(unsigned int t,customerGroup* g)
:group(g),event(t)
{}
void arriveEvent::processEvent()
{
random m_randomvalue;
cout<<"Customer group of size "<<group->groupsize
<<" , arrives at time"<<time<<'\n';
if(group->groupsize<store.freeChairs){
store.freeChairs-=group->groupsize;
event*oe=new orderEvent(time+m_randomvalue.between(2,8),group);
assert(oe!=0);
store.scheduleEvent(oe);
}
else
cout<<"No space:group leaves.\n";
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -