简体   繁体   English

将代理位置保存在“seize”块中并在“move-to”块中使用位置

[英]Save agent location in a “seize” block and use location in a “move-to” block

My model is a basic warehouse situation model.我的模型是一个基本的仓库情况模型。 Trucks enter the model, are seized by an empty loading dock resource and then offloaded by the forklifts.卡车进入模型,被空的装卸码头资源占用,然后由叉车卸载。 The trucks location (loading bay 1, loading bay 2 etc.) is determined by the available resource that gets seized.卡车位置(装货区 1、装货区 2 等)由被占用的可用资源决定。 My "move-to" block then has the "move to location of seized resource" option ticked.我的“移动到”块然后勾选了“移动到占用资源的位置”选项。 In this case, the truck half of the model is working as expected.在这种情况下,模型的卡车一半按预期工作。

The forklift half is a little harder.叉车的一半有点硬。 I have been advised to inject pallet agents into the model instead of splitting them off the incoming trucks.有人建议我将托盘代理注入模型中,而不是将它们从进来的卡车中分离出来。 The problem is that I can't specify the location of the agents to a specific resource.问题是我无法为特定资源指定代理的位置。

How can I save the location of the newly parked truck (loading bay 1, loading bay 2 etc.) in a variable, and then call on that same variable to inject the agents into that location?如何将新停放的卡车(装货区 1、装货区 2 等)的位置保存在变量中,然后调用相同的变量将代理注入该位置? The nodes that are acting as the loading bays, are the home locations of specific resources (loading bays).充当装载区的节点是特定资源(装载区)的归属位置。

When I save the location (varAgentLocation = getNetworkNode();) I have to set the variable type to type "custom" (INode) to void errors.当我保存位置 (varAgentLocation = getNetworkNode();) 时,我必须将变量类型设置为键入“custom”(INode)以消除错误。 The if I type "varAgentLocation" in the location box of the source, I get an error stating that the types are not the same (INode and InitialLocationType)如果我在源的位置框中键入“varAgentLocation”,我会收到一个错误,指出类型不相同(INode 和 InitialLocationType)

Using home locations for your (non-moving) loading bay resources is unnecessary.不需要为您的(非移动)装载区资源使用家庭位置。

Just have them as custom resource agent types (eg, agent type LoadingBay , not vanilla Agent ) with a type Node parameter that you set at model startup to be the relevant space markup nodes.只需将它们作为自定义资源代理类型(例如,代理类型LoadingBay ,而不是 vanilla Agent )与您在模型启动时设置为相关空间标记节点的类型Node参数。 (You need to have the resource pool add the resource agents to a custom (initially empty) population of LoadingBay s you've created beforehand; this allows you then to loop through the resource agents at model startup to setup any parameters, etc. for them.) (您需要让资源池将资源代理添加到您预先创建的LoadingBay的自定义(最初为空)群体中;这允许您在模型启动时循环访问资源代理以设置任何参数等。他们。)

Then probably the most coherent way is to那么可能最连贯的方法是

  • Copy this value into a variable within your Truck agent via the on-seize action of your Seize block.通过Seize块的 on-seize 操作将此值复制到Truck代理中的变量中。

  • Have your Pallet agents created with a reference to the Truck agent they came from (in a variable or parameter).使用对它们来自的Truck代理的引用(在变量或参数中)创建您的Pallet代理。 There are various design alternatives for whether the pallets exist beforehand (where you might use an Unbatch block to 'release' them) or whether you create them on the fly.对于托盘是否预先存在(您可以使用Unbatch块来“释放”它们)或是否即时创建托盘,有多种设计替代方案。

  • When you inject pallet agents into, say, a Source block, set that to have the arrival node (which can be a dynamic expression) getting the relevant node from the 'parent' Truck agent (eg, something like agent.arrivalTruck.loadingBayNode ).例如,当您将托盘代理注入Source块时,将其设置为让到达节点(可以是动态表达式)从“父”卡车代理(例如, agent.arrivalTruck.loadingBayNode东西)获取相关节点.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM