当前位置:首页 > 库存系统最优采购批量Witness建模与仿真
最大库存的中值; costRate (1) = 50 !每日每吨 PE的库存成本;
costRate (2) = 1000 !每次采购与运输的基本费用,包括通信费、运输基本费用; costRate (3) = 10 !每吨运输费率
!每次采购总成本=costRate(2)+costRate(3)*PurchaseBatch
_____________________________________________________________
ELEMENT NAME: Customer Element Type: Part
Type:
Variable attributes Group number:
1
Inter Arrival Time: 1.0
First Arrival at: 1.0
Maximum Arrivals: Unlimited
Input / Output Rules
Output:
PUSH to CorpDoor
Actions Create: PEBatch = DayNeed ()
RecordRealValue (stockSeries,StockQty) RecordQty (5) = MeanVariable (stockSeries)
RecordQty (7) = RecordQty (5) * TIME * costRate (1) / 1000
RecordQty (9) = RecordQty (8) + RecordQty (7)
_____________________________________________________________
ELEMENT NAME: PE Element Type: Part
Type:
Variable attributes Group number: 1
Maximum Arrivals: 0
Actions Create: PEBatch = PurchaseBatch SendPurchase = 0
RecordQty (4) = RecordQty (4) + PEBatch !总采购量增加
_____________________________________________________________
ELEMENT NAME: CorpDoor Element Type: Buffer Quantity:
1 Capacity:
1000
Input Option: Rear Output Option:
First
Search From: Front
_____________________________________________________________
Page 5 of 9
ELEMENT NAME: 发货员 Element Type: Quantity: Priority: Type:
Machine 1 Lowest Single 0.1
Cycle Time:
Input / Output Rules
Input:
PULL from CorpDoor PUSH to SHIP Using Path
Output:
Actions
Start:
DIM GiveoutQty AS REAL IF StockQty < PEBatch
GiveoutQty = StockQty
RecordQty (1) = RecordQty (1) + PEBatch - GiveoutQty !缺货量增加
ELSE
GiveoutQty = PEBatch
ENDIF
StockQty = StockQty - GiveoutQty
RecordQty (3) = RecordQty (3) + GiveoutQty !消耗量增加,送出量增加 PurchasingDecision ()
_____________________________________________________________
ELEMENT NAME: Road Element Type: Quantity: Priority: Type:
Conveyor 1 Lowest Queuing 10 1.0
Length: Index Time:
Maximum Capacity: 10
Input / Output Rules
Input:
IF SendPurchase = 1 PULL from PE out of WORLD Wait
ELSE
ENDIF
PUSH to SHIP
RecordQty (6) = RecordQty (6) + 1
RecordQty (8) = RecordQty (8) + PEBatch * costRate (3) / 1000 + costRate (2) StockQty = StockQty + PEBatch
Output: Join:
Actions
Front:
!下面统计是否库存超出最大库存量,如果超出,则将超出部分累加起来
IF StockQty > MaxWarnStock
RecordQty (2) = RecordQty (2) + StockQty - MaxWarnStock
Page 6 of 9
ENDIF
_____________________________________________________________
ELEMENT NAME: Roadout Element Type: Path Source Element:
发货员 Destination Element: SHIP Traverse Time:
5.0 Update Interval:
0.01
_____________________________________________________________
ELEMENT NAME: PEBatch Element Type: Attribute Quantity:
1
_____________________________________________________________
ELEMENT NAME: costRate Element Type: Variable Quantity:
3
_____________________________________________________________
ELEMENT NAME: MaxWarnStock Element Type: Variable Quantity:
1
_____________________________________________________________
ELEMENT NAME: MinSafeStock Element Type: Variable Quantity:
1
_____________________________________________________________
ELEMENT NAME: PurchaseBatch Element Type: Variable Quantity:
1
_____________________________________________________________
ELEMENT NAME: RecordQty Element Type: Variable Quantity:
9
_____________________________________________________________
ELEMENT NAME: SendPurchase Element Type: Variable Quantity:
1
Page 7 of 9
_____________________________________________________________
ELEMENT NAME: StockQty Element Type: Variable Quantity:
1
_____________________________________________________________
ELEMENT NAME: stockSeries Element Type: Variable Quantity:
0
_____________________________________________________________
ELEMENT NAME: avgStock Element Type: Function Type:
Integer Parameters:
0
Actions Execution: RETURN RecordQty (5)
_____________________________________________________________
ELEMENT NAME: DayNeed Element Type: Function Type:
Integer Parameters:
0
Actions
Execution:
RETURN NORMAL (7777,1758)
_____________________________________________________________
ELEMENT NAME: lostRate Element Type: Function Type:
Real Parameters:
0
Actions
Execution:
RETURN RecordQty (1) / RecordQty (3) * 100
_____________________________________________________________
ELEMENT NAME: OverRate Element Type: Function Type:
Real Parameters:
0
Actions Execution:
RETURN RecordQty (2) / RecordQty (4) * 100 _____________________________________________________________
Page 8 of 9
ELEMENT NAME: PurchasingDecision Element Type: Type: Actions
Parameters:
Function Void 0
Execution: IF StockQty < MinSafeStock AND NPARTS (Road) = 0 SendPurchase = 1 !当该变量为1时,表示发出采购订单 ELSE
SendPurchase = 0 !该变量为0时,不发出采购订单
ENDIF
_____________________________________________________________
ELEMENT NAME: sumCost Element Type: Function Type:
Integer Parameters:
0
Actions
Execution: RETURN RecordQty (9)
_____________________________________________________________
Page 9 of 9
共分享92篇相关文档