function Init(q,nd,j1,j2,b1,b2,qcap,VC);

global Demands;
global j01 j02 betta1 betta2 Num devicenum quant capacity
global NextOutTime NextInTime Devices finishednum inputnum refusednum Queue
global curtime time queuetime worktime TimeCount queuenum
global queueamount workamount sysamount tmpsysusage tmpqueuetime tmpworktime

quant = q;
devicenum = nd;
j01 = j1;
j02 = j2;
betta1 = b1;
betta2 = b2;
Num = VC;
capacity = qcap;

curtime = 0;
queuenum=0;

time = zeros (1,2*Num);
queuetime = 0;
worktime = 0;
TimeCount = 0;

tmpqueuetime = zeros(1,2*Num);
tmpworktime = zeros(1,2*Num);
queueamount = zeros(1,2*Num);
workamount = zeros(1,2*Num);
sysamount = zeros(1,2*Num);
tmpsysusage = zeros(1,2*Num);

Demands = zeros(4,Num);

NextOutTime = zeros(1,devicenum);
for i=1:devicenum
    NextOutTime(i) = inf;
end;

NextInTime = 0;

finishednum = 0;
inputnum = 0;
refusednum = 0;

Devices = zeros(1,devicenum);

Queue = zeros(1,1);

