全球FlexSim系统仿真中文论坛

搜索
查看: 2048|回复: 0
打印 上一主题 下一主题

FlexSim新技术主题4_任务序列概念说明2

[复制链接]
跳转到指定楼层
1#
Clay666 发表于 2019-7-1 17:29:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1.    Task SequencePreempting任务优先级
Every task sequence has a preempting value. Preempting is used tobreak a task executer away from its current operation to execute a moreimportant operation. For example, operator A's most important responsibility isto repair machines. When there are no machines to repair, however, it shouldalso transport material throughout the model. If a machine breaks down whileoperator A is in the middle of transporting a flowitem somewhere, then theoperator should stop whatever he is doing and repair the machine, instead offinishing the transport operation. To do this, you will need to use apreempting task sequence to break the operator away from his current operation.
每个任务序列都有一个打断等级。打断意味着任务执行器中断当前操作去执行一个更重要的任务。例如,操作员A的最重要任务是修理机器,当现在没有机器需要修理时,他应该转运模型中的材料,一旦机器停机但此时A正在运送一个临时实体,那么A应该立即中断现在手头的工作开始修理机器,而不是将当前手头的运送临时实体的任务完成后再来修理机器。为了实现这样的仿真模型,你需要使用任务中断来中断操作员当前执行的任务。
To create a preempting task sequence,specify a non-zero value in the preempt parameter of thecreateemptytasksequence() command.
createemptytasksequence(operator, 0,PREEMPT_ONLY);
创建任务序列中的中断等级,该参数一般为一个非零值。
There are four possible preempt values. These values tell the taskexecuter what to do with the original task sequence(s) that have beenpreempted.
该值有四个可选项,其决定了任务执行器将如何中断当前的任务。
·       0 - PREEMPT_NOT - This valueis non-preempting.本值意味着无中断。
·       1 - PREEMPT_ONLY - If a tasksequence has this value, then the task executer will preempt the currentlyactive task sequence and put it back in its task sequence queue to be finishedlater. When a task sequence is preempted, it is automatically placed at thefront of the task sequence queue. When the task executer eventually comes backto the original task sequence, the current task in that task sequence will bedone over again, since it was not finished. Also, you can specify a series oftasks to do over again when it comes back to the task sequence using the TASKTYPE_MILESTONE task. Thispreempt value is the most common used.
如果任务序列中选择这个参数,那么任务执行器将中断当面任务,将当期任务放入任务池中,等待稍后执行。当一个任务被中断后,他将自动放回任务池的前端,当任务执行器返回执行任务池中的任务时,被中断的任务将继续执行。同时,你也可以采用 TASKTYPE_MILESTONE定义一系列任务重新执行。这个中断参数最经常使用。
·       2 - PREEMPT_AND_ABORT_ACTIVE - If a tasksequence has this value, then the task executer will stop the currently activetask sequence and destroy it, so that it will never come back to that originaltask sequence.
如果任务序列中选择了本参数值,那么任务执行器将停止当前的激活任务并摧毁它,这样这个初始人员将不会再继续执行。
·       3 - PREEMPT_AND_ABORT_ALL - If a tasksequence has this value, then the task executer will stop the currently activetask sequence, destroy it, and destroy all task sequences in its task sequencequeue.
如果任务序列中选择了本参数值,那么任务执行器将停止当前的激活任务并摧毁它,并摧毁任务池中的所有任务序列。
To query or change the preempting and/or priority values of a tasksequence, you can use the getpreempt(), setpreempt(), getpriority(), andsetpriority() commands. For more information on these commands, refer to the CommandsHelper.
如果你要排序任务的打断等级和优先级,你可以采用getpreempt(),setpreempt(), getpriority(), setpriority()。更多详情请参见指令帮助文件。
Interaction Between Multiple Preempting Task Sequences
If a task executer is currently working on a preempting tasksequence, and it receives a new task sequence that is also preempting, it willuse the priority value of the task sequence to determine which task sequence todo. If the priority value of the new task sequence is higher than the priorityvalue of the one it is currently working on, the task executer will preempt itscurrent task sequence and execute the new one. If the priority value of the newtask sequence is less than or equal to the priority of the task sequence it iscurrently working on, then the task executer will not preempt the active tasksequence, but will queue up the new task sequence just like any other tasksequence it receives. If it must queue up the task sequence, it will not takethe preempt value into account for its queueing logic unless you explicitlytell it to in the queue strategy.
如果一个任务执行器正在执行一个中断任务同时又收到了一个中断任务,他将利用任务优先级来判断到底执行哪个任务序列。如果新任务的优先级高于现有任务的优先级,那么它将中断当前任务执行新任务。如果新任务的优先级低于或与现有任务相等,那么它将继续执行当前任务并将新的任务放入任务池中。在放入任务池中时,除非有所定义的排队策略,否则不保存中断任务相关属性。
Queueing a Preempting Task Sequence
If a preempting task sequence does not actually preempt atask executer, then it will be queued up like any other task sequence. If youwant to have preempting task sequence be brought to the front of the queue,then either make your preempting task sequences have higher priority than allother task sequences, or take preempting into account in the queue strategy.
如果一个中断任务实际上并没有被中断,它将像其他任务序列一样进入任务池排序。如果你希望该中断任务能被优先执行那么需要将其设定为较高的优先级。
Preempting Travel Tasks on Networks with TrafficControls
中断大车运行任务在网络路径交通规划中的应用
Preemption can have some undesirable side effects if a taskexecuter is traveling along a network with TrafficControls when the preemptionhappens. If preemption occurs when a task executer is traveling along a networkedge, then the task executer will be "taken off" that edge andconnected in an "inactive" travel state (the red line) to the nextnetwork node he would have arrived at had he finished traveling the edge. Ifthe network node is a member of a traffic control whose area starts at thatnode (in other words, the task executer wasn't in the area yet when he waspreempted), then the task executer will be "forced" into the trafficcontrol area, meaning this may cause the number of objects in the area toexceed the maximum for that traffic control area. To avoid this, special logichas been added to the task executer's preemption mechanism, so that if he ispreempted from a travel task directly to another travel task, then instead ofbeing taken off the edge and connected to the next node, the preemption willcall redirectnetworktraveler(), which will essentially keep him traveling as hewas before on the edge, but his final destination will be changed so that whenhe arrives at the end of the edge, he will continue on a new path to the newdestination. Note that this will only happen if the preemption mechanism candetect that the first durative task that the task executer will perform afterthe preemption is another travel task. By durative we mean any task that willtake some amount of time to perform.
中断会在任务执行器通过一个带有交通控制路径网络时产生不良的副作用。如果在任务执行器沿着网络边缘行进时发生抢占,则任务执行器将“脱离”该边缘并以“非活动”行进状态(红线)连接到他将到达的下一个网络节点如果他走完了边缘。如果网络节点是其区域从该节点开始的流量控制的成员(换句话说,当他被抢占时,任务执行者不在该区域中),那么任务执行器将被“强制”进入流量控制区域,这意味着这可能导致区域中的对象数量超过该流量控制区域的最大值。为了避免这种情况,在任务执行者的抢占机制中添加了特殊逻辑,这样如果他从旅行任务直接抢占到另一个旅行任务,那么抢占将不会被取下边缘并连接到下一个节点。执行redirectnetworktraveler()命令,这将基本上让他像以前一样在边缘旅行,但是他的最终目的地将被改变,以便当他到达边缘的末端时,他将继续前往新目的地的新路径。请注意,只有在抢占机制可以检测到在抢占之后任务执行者将执行的第一个持续任务是另一个旅行任务时,才会发生这种情况。持续性是指任何需要花费一些时间才能执行的任务。
The following tasks are durative:
·       TASKTYPE_TRAVEL
·       TASKTYPE_LOAD
·       TASKTYPE_UTILIZE
·       TASKTYPE_DELAY
Whereas the following are not:
·       TASKTYPE_SETNODENUM
·       TASKTYPE_TAG
·       TASKTYPE_MOVEOBJECT
If the preemption detects that the nextdurative task is not a travel task, then it will take the taskexecuter off the edge as described above, in which case the task executer maybe forced into a traffic control area.
如果抢占检测到下一个持续性任务不是旅行任务,那么它将使任务执行器离开边缘,如上所述,在这种情况下,任务执行器可以被强制进入交通控制区域。
Preempting With Dispatchers
If a preempting task sequence is given toa dispatcher, the dispatcher will not consider the preempt value of the tasksequence unless you explicitly tell it to. If the dispatcher is set to dispatchto the first available task executer, then it will do just that, and not sendthe preempting task sequence immediately to a task executer. If you want thedispatcher to dispatch preempting task sequences immediately, then you willneed to specify such logic in its Pass To function.
如果一个中断任务给到了任务分配器,任务分配器将不会考虑该任务的中断属性,除非你明确地告知。如果任务分配器设定为第一个可用任务执行器,那么它也会如此同时并不会立即发送打断任务至任务执行器。如果你需要通过任务执行器发送打断任务,那么你需要对此作出特殊规定。
A task executer may be connected back to adispatcher by dragging an A-connect from the task executer to the dispatcher.If this is done, then when the TaskExecuter receives a preempting task it willpass its current task back to the dispatcher. The dispatcher will thenredistribute that task according to its dispatching logic. Tasks returned tothe dispatcher in this manner are returned in their current state so that thenext task executer will begin where the previous task executer left off. Thismay cause some odd behavior that you should take into consideration whenassigning preempting tasks. For example, if a task executer is traveling withan item when it is preempted, the task executer that receives this task willperform the travel and unload tasks without ever picking up the item from thefirst task executer. Instead, the item will "magically" appear at theright location when the unload completes. In order to prevent these oddbehaviors you may want to query the task executer's state to determine if it isin a "preemptable" state (as you define it) before assigning the newtask.
任务执行器通常与任务分配器之间为A连接。当任务执行器收到一个中断任务时,他将会将他的现有任务返回给任务分配器。任务分配器就会根据其内置的调度策略重新分配该任务。返回的任务将会保持其状态,这样下个任务执行器将继续该任务。这可能会导致模型有些奇怪的行为。例如,如果任务执行器在被中断时随临时实体一起行走,则接收此任务的任务执行者将执行行走和卸载任务,而无需从第一任务执行器中获取该项目。相反,当卸载完成时,该项将“神奇地”出现在正确的位置。为了防止这些奇怪的行为,您可能需要在分配新任务之前查询任务执行者的状态以确定它是否处于“可抢占”状态(如您所定义)。
8 K  F6 d  w% R1 M1 S
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|全球FlexSim系统仿真中文论坛 ( 京ICP备14043114号-2 )

GMT+8, 2024-4-20 03:24 , Processed in 0.063158 second(s), 13 queries .

Powered by Discuz! X3.3© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表