etProcessed: Boolean;
begin
Result: = (TQSheme (Sheme). SysTime> = FEndWorkTime);
end;
function TShop.GetCanTake: Boolean;
begin
Result: = not ParcelPresent and Processed;
end;
function TShop.GetCanDrop: Boolean;
begin
Result: = ParcelPresent and Processed;
end;
procedure TShop.Work;
begin
FEndWorkTime: = TQSheme (Sheme). SysTime + FGenerator.GetRandom;
end;
procedure TChannel.Pass (SourceIndex: integer);
begin
inherited;
Container.State: = psWork;
end;
procedure TSource.TakeParcel (SourceIndex: integer);
begin
Container: = TQSheme (Sheme). NewParcel;
end;
procedure TSource.Pass (SourceIndex: integer);
begin
inherited;
Container.State: = psBorn;
end;
procedure TSource.AskForParcel;
begin
if CanTake then Pass (-1);
end;
constructor TAccumulator.Create;
begin
FLimited: = False;
FParcels: = TList.Create;
inherited;
end;
destructor TAccumulator.Destroy;
begin
FParcels.Free;
end;
function TAccumulator.GetParcel (Index: integer): TParcel;
begin
Result: = FParcels [Index];
end;
function TAccumulator.GetCanDrop: Boolean;
begin
if Empty then AskForParcel;
if not Empty then Container: = FParcels.First;
Result: = not Empty;
end;
function TAccumulator.GetCanTake: Boolean;
begin
Result: = FreeSpacePresent;
end;
function TAccumulator.GetFreeSpacePresent: Boolean;
begin
Result: = (Capacity <> FParcels.Count) or (not Limited);
end;
function TAccumulator.GetEmpty: Boolean;
begin
Result: = FParcels.Count = 0;
// if not Result then Container: = FParcels.First;
end;
procedure TAccumulator.DropParcel;
begin
if not Empty then FParcels.Delete (0);
inherited;
end;
function TAccumulator.GetCapacity: integer;
begin
Result: = FCapacity;
end;
function TAccumulator.GetParcelCount: integer;
begin
Result: = FParcels.Count;
end;
procedure TAccumulator.SetCapacity (Value: integer);
begin
FLimited: = True;
FCapacity: = Value;
end;
procedure TAccumulator.ClearContainer;
begin
FParcels.Clear;
inherited;
end;
procedure TAccumulator.Pass (SourceIndex: integer);
begin
inherited;
Container.State: = psStore;
end;
procedure TA...