[b] [url=http://www.flexsim.asia/redirect.php?goto=findpost&pid=3198&ptid=1270]8#[/url] [i]warren520[/i] [/b]
简单说一下模型的思路吧:
首先当Queue中有临时实体进入时,就会启用Queue的进入触发器,然后判断各个Operator的状态,如果有一个Operator的状态为idle,那么就给它发一个消息,该Operator收到消息后会主动检查Dispatcher中是否有Tasksequence,如果有的话,就请求Dispatcher中Tasksequencequeue的第一个Tasksequence,并开始执行该任务。如果有两个Operator的状态为idle时,就随机选择一个Operator发消息,然后被选择的Operator会执行类似上面的操作。
注:Dispatcher中Pass to中,需要return -1。具体请见帮助文件中的如下说明:
If 0 is returned, then the task sequence will be queued up using the below mentioned queue strategy, and then will be dispatched to the first available mobile resource. If -1 is returned, then the Dispatcher will do absolutely nothing. In such a case you would use the movetasksequence() and dispatchtasksequence() commands to execute dispatching logic yourself.
此外大家也可以尝试使用[b]createsendmessagetask(),createstandardtask(),[/b]以及[b]transfernode()[/b]等函数,也可以在[b]Script[/b]中写代码进行控制。