抓取区块,控制代理位置依赖的资源使用。

huangapple go评论56阅读模式
英文:

Seize block, controlling agent location depending resource used

问题

以下是翻译好的部分:

我知道在下面的示例中,有一种更优雅的方法来处理它(例如,使用Service块)。但是,我想更好地理解Seize/Delay/Release块。

下面示例的目标:

  • 当Seize块从资源池normalRooms中获取资源时,代理应该从节点nodeWaitingArea重新定位到节点nodeNormalRooms。
  • 当Seize块从资源池largeRooms中获取资源时,代理应该从节点nodeWaitingArea重新定位到节点nodeLargeRooms。

我没有问题找到正确的目标位置,但我不知道如何控制从“等候区”到正确位置(nodeNormalRooms或nodeLargeRooms)的重新定位。

我认为这是通过延迟块中的“代理位置”来实现的,但这仅接受静态值。最佳解决方法是什么?

英文:

I am aware that in the following example there is a more elegant way to go about it (e.g. using Service block. However, I want to understand the Seize/Delay/Release blocks a bit better.

Objective of example shown below:

  • When seize block takes from resource pool normalRooms, agent is to be relocated from nodeWaitingArea to node nodeNormalRooms.
  • When seize block takes from resource pool largeRooms, agent is to be relocated from node nodeWaitingArea to node nodeLargeRooms.

抓取区块,控制代理位置依赖的资源使用。

I have no problem finding correct target location - but I don't know how to control the relocation from the "Waiting area" to the correct location (nodeNormalRooms or nodeLargeRooms).

I assume it is by "Agent Location" in the delay block - but this only accepts static values. What is the best way to solve this?

答案1

得分: 0

我认为最好在延迟之前添加一个“moveTo”块...这样你可以控制新位置。

此外,在延迟块的“on enter”操作中,你可以使用 agent.jumpTo(newNode);

英文:

I think it's better to just add a moveTo block before the delay... in which case you can control the new location.

Also on the on enter action of the delay block you can use agent.jumpTo(newNode);

huangapple
  • 本文由 发表于 2023年6月8日 18:56:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431118.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定