Курсовая работа: Моделирование систем
end;
end;
function TQSheme.NewParcel: Pointer;
var P : Pointer;
begin
P := FParcelsClass.Create;
FParcels.Add(P);
Result := P;
end;
procedure TQSheme.NewEvent(AEvent : Integer; ASender, ASource: TObject; AInfo : TInfo);
var P : PEventRec;
begin
GetMem(P,SizeOf(TEventRec));
with P^ do begin
Event := AEvent;
Sender := ASender;
Source := ASource;
Info := AInfo;
SysTime := FSysTime;
end;
FEventQueue.Add(P);
end;
function TQSheme.GetCounts(Index : integer): integer;
var i : integer;
begin
Result := 0;
for i := 0 to FParcels.Count-1 do
if Ord(TParcel(FParcels[i]).State) = Index then Inc(Result);
end;