ment]: Boolean read GetCanDropParcelFor;
property CanTakeParcelFrom [Source: TElement]: Boolean read GetCanTakeParcelFrom;
property Container: TParcel read FContainer write FContainer;
property ParcelPresent: Boolean read GetParcelPresent;
property CanTake: Boolean read GetCanTake;
property CanDrop: Boolean read GetCanDrop;
property Id: integer read FId write FId;
published
property Name: string read FName write FName;
property Sheme: TObject read FSheme write SetSheme;
property SourceCount: integer read GetSourceCount;
property Sources [Index: integer]: TElement read GetSource;
property OnSourceValidate: TIsRightElement read FOnSourceValidate write FOnSourceValidate;
property OnDestinationValidate: TIsRightElement read FOnDestinationValidate write FOnDestinationValidate;
property BeforeTake: TBeforeAfterAction read FBeforeTake write FBeforeTake;
property AfterTake: TBeforeAfterAction read FAfterTake write FAfterTake;
property BeforeDrop: TBeforeAfterAction read FBeforeDrop write FBeforeDrop;
property AfterDrop: TBeforeAfterAction read FAfterDrop write FAfterDrop;
end;
TElementClass = class of TElement;
TGenerator = class
private
FMean: TCustTime;
FDisp: TCustTime;
FRandomType: TRandomType;
function GetRandom: TCustTime;
public
constructor Create;
property Mean: TCustTime read FMean write FMean;
property Disp: TCustTime read FDisp write FDisp;
property RandomType: TRandomType read FRandomType write FRandomType;
property Time: TCustTime read GetRandom;
end;
TShop = class (TElement)
private
FGenerator: TGenerator;
FEndWorkTime: TCustTime;
procedure Pass (SourceIndex: integer); override;
function GetProcessed: Boolean;
protected
function GetCanTake: Boolean; override;
function GetCanDrop: Boolean; override;
property EndWorkTime: TCustTime read FEndWorkTime write FEndWorkTime;
public
constructor Create; override;
destructor Destroy; override;
procedure DropParcel; override;
property Generator: TGenerator read FGenerator;
property Processed: Boolean read GetProcessed;
procedure Work; virtual;
end;
TChannel = class (TShop)
public
procedure Pass (SourceIndex: integer); override;
end;
TSource = class (TShop)
private
procedure TakeParcel (SourceIndex: integer); override;
public
procedure Pass (SourceIndex: integer); override;
procedure AskForParcel; override;
end;
TAccumulator = class (TElement)
private
FParcels: TList;
FLimited: Boolean;