You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AnyLogic中如何从Storage System初始库存正确提取物料?

AnyLogic Storage System初始库存物料提取正确方法

一、推荐方案:直接用Retrieve模块触发提取

无需用Source模块循环操作,直接利用Storage System配套的Retrieve模块完成提取:

  • 在模型启动事件(Main的On startup)或业务触发点,调用Retrieve模块的start()方法,比如retrieveAll.start();
  • 配置Retrieve模块:
    • 选择目标为你的Storage System实例
    • 若要提取全部初始库存,勾选Extract all items;若按数量提取,设置Number of items to extract参数
  • 后续连接Enter模块(对接自由空间运输机),再将运输流程指向发货码头矩形节点即可。

二、自定义筛选提取(按条件取货)

如果需要按物料属性筛选提取,不要手动循环storage.items再重新存入,用Storage System的官方API:

  • 先获取符合条件的物料列表:
    // 示例:筛选类型为"Box"的物料
    List<YourItemAgent> targetItems = storage.getItems(item -> item.itemType.equals("Box"));
    
  • 对每个物料调用retrieve()方法完成状态变更,再送入Enter模块:
    for(YourItemAgent item : targetItems){
        storage.retrieve(item); // 让物料脱离仓储系统管理,同时标记为可运输
        enterModule.take(item); // 送入运输机的Enter模块
    }
    

三、避坑提示

  • 不要手动将提取出的物料重新存入Storage System,这会导致物料状态混乱,Retrieve模块只识别仓储系统中处于存储状态的物料,retrieve()方法会自动完成状态转换。
  • 确保Enter模块的Type of entity entering设置为你的物料代理类型,避免实体类型不匹配的报错。

内容的提问来源于stack exchange,提问作者Srinjoy Chatterjee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 06:42:33