Курсовая работа: Моделирование систем
for s := 0 to LastElement.SourceCount - 1 do
if FSourceElements.IndexOf(LastElement.Sources[s])<0 then
FSourceElements.Add(LastElement.Sources[s]);
end;
SwapPointers(Pointer(FSourceElements),Pointer(FLastElements));
FSourceElements.Clear;
GetRecipientsOrder;
end;
procedure TQSheme.GetOrder;
begin
FindFinishElements;
GetRecipientsOrder;
end;
procedure TQSheme.TakeParcelsFromFinishElements;
var i : integer;
Parcel : TParcel;
begin
for i := 0 to FFinishElements.Count-1 do
with TElement(FFinishElements[i]) do
if CanDrop then begin
Parcel := Container;
NewEvent(EV_PASS,nil,FFinishElements[i],Parcel.Info);
DoBeforeDrop(FFinishElements[i]);
DropParcel;
DoAfterDrop(FFinishElements[i]);
Parcel.State := psPassed;
end;
end;
procedure TQSheme.Step;