全球FlexSim系统仿真中文论坛

标题: FlexSim新技术主题4_任务序列概念说明1 [打印本页]

作者: Clay666    时间: 2019-6-24 13:41
标题: FlexSim新技术主题4_任务序列概念说明1
1.    Custom Built TaskSequences自定义任务序列
Youcan create custom task sequences using 3 simple commands:
创建任务序列需要用到如下三个简单命令。
createemptytasksequence()
inserttask()
dispatchtasksequence()
First, create a task sequence by using createemptytasksequence().Then insert tasks into the task sequence by successive inserttask() commands.Finally dispatch the task sequence with dispatchtasksequence().
首先,通过使用指令createemptytasksequence() 创建任务序列。然后在任务序列中插入分布任务,最后将该任务序列分配给任务执行器来执行。
The following example tells a forklift to travel to an object,referenced as "station", then load a flow item, referenced as"item."
下面这个例子就描述了一个叉车运行至某个物体,参考为"station",装载一个临时实体,参考为"item."
treenode newtasksequence = createemptytasksequence(forklift, 0 ,0 );
inserttask(newtasksequence, TASKTYPE_TRAVEL, station);
inserttask(newtasksequence, TASKTYPE_LOAD, item, station, 2);
dispatchtasksequence(newtasksequence);
! c7 a; |0 \  ?, {1 k4 k8 t# h
If you are confused by the "treenode" syntax, refer thehelp on the FlexSim tree structure. In brief terms, "treenodenewtasksequence" creates a reference, or pointer, to the task sequence asa FlexSim node so that it can be used later when tasks are added to the tasksequence.
如果你对treenode有所困惑,请参考FlexSim帮助文件。简单地说,"treenode newtasksequence"创建了一个引用或一个指针,指向了一个FlexSim的节点,这样稍后能将任务加入这个任务序列的节点之中。

- l8 N1 y' g0 F: ^9 q0 y) T
The createemptytasksequence command takes three parameters. Thefirst parameter is the object that will handle the task sequence. This shouldbe a dispatcher or task executer object. The second and third parameters arenumbers, and specify the task sequence's priority and preempting values,respectively. The command returns a reference to the task sequence that wascreated.
% D+ p* K( Y' z0 T# H, C( F3 k- u+ ]
Createemptytasksequence指令包含了三个参数,第一个参数表示将由那个对象执行本任务序列,他应该是一个任务分配器或者任务执行器。第二个和第三个参数是数字,表示了本任务序列的优先等级和终端人物。本命令返回新创建的任务序列的引用。
1 J" X, C3 C0 ?& r% L' ~
The inserttask command inserts a task onto the end of the tasksequence. Each task that you insert has several values associated with it.First, it has a type value, which defines what type of task it is. It also hasa reference to two involved objects for the task, referred to as involved1 andinvolved2. These involved objects and what they mean depend upon the task type.For some task types both involved parameters are needed and have meaning,whereas for others, the involved objects are not used. Some task types may useone involved object, and some have involved objects which are optional. Referto the documentation on task types forinformation on what a specific task type's involved objects represent. The taskcan also have up to four number values. These are task variables, referred toas var1, var2, var3, and var4. Again, their meaning depends on the task type. For the loadtask below, notice that var1 was specified as 1. For a load task, thisspecifies the output port through which the item will leave the station.
9 c9 X9 b" X% R2 |0 f' L7 r) r
Inserttask指令在任务序列的尾端插入一个任务。每个插入的任务都有相应的若干属性值。首先,它有一个类型值,定义了本任务的类型。它还有一个对涉及本任务对象的引用。涉及到的对象和具体含义取决于本任务的类型。对有些任务类型来说,所有的参数都是必须的并具有相应的含义,但有些任务类型并不需要全部的参数。请参考帮助文件的task types部分。 任务也包含四个数字类型值,他们是本任务的变量,其具体含义也取决于任务类型。对于如下的装载任务而言,var1规定为1,对于一个装载任务,这个参数值1意味着临时实体将要离开的端口。
( V3 R0 P4 {0 e2 x" D
The inserttask command takes two or more parameters, which specifythe task's values. The first parameter is a reference to the task sequence intowhich the task is inserted. The second is the type of task. This can be chosenfrom an enumerated list of task types. The third andfourth parameters reference the two involved objects. If a specific involvedobject is not used or is optional for a task type, then you can simply passNULL into the inserttask command, or even leave that parameter out if there areno number variables that you need to specify either. The fifth through ninthparameters are optional, and define var1-var4. By default, these values arezero.
4 z0 j$ H5 q6 R& Q
Inserttask会包含多个参数。第一个参数是任务序列的引用,表示本任务被插入哪个任务序列。第二个参数是任务类型。第三个和第四个任务是涉及到的对象实体的引用。如果一个规定的引用对象没被使用或者是个可选项,可直接使用NULL代替。第五至第九个参数变量是可选的,定义了var1-var4.其默认值一般为0.
, U' J3 _) L" v' K  r8 i! W0 Y+ _/ Z
Optional Parameters可选参数
Even though many of the parameters of the inserttaskcommand are technically optional, depending on the task type, you will stillneed to specify them. Also, parameters need to still be specified in theircorrect order. If, for example, you want to specify var1 of the task, but don'tcare what involved1 or involved2 are, you will still need to pass the NULLvalue into parameters 3 and 4, even though they are optional, in order tocorrectly pass var1 in as parameter 5.
即使在insterttask指令中很多参数都是技术性可选的,你仍然需要规定他们。同时,参数需要按照正确的指令进行设定。例如:你需要设定var1,但并不介意涉及到的引用对象1和2,你仍然需要将参数3和4设定为NULL,即使他们是可选的,这样只是为了正确的传递参数5的var值。
- D7 c5 H+ W  T" a, O
, a* t8 ~' R% Q' {6 P

- o4 ?/ m  ~6 ^# R! Y2 a

# J; B7 n5 e6 \  f$ |  f+ b

, k6 I! s0 z, R2 h# b& Q/ V# ~; q, M

  }! I2 B  V8 z1 p




欢迎光临 全球FlexSim系统仿真中文论坛 (http://www.flexsimasia.com/) Powered by Discuz! X3.3