全球FlexSim系统仿真中文论坛
标题:
[求助]用任务序列实现搬箱子
[打印本页]
作者:
hubangzhi
时间:
2012-3-7 10:11
标题:
[求助]用任务序列实现搬箱子
用任务序列控制操作员在两个暂存区之间搬运箱子,基本实现,但是有时候操作员会不搬箱子,空跑一趟或多趟,求助。。。。
3 ^1 y. u2 P5 V$ g
[attach]486[/attach]
作者:
CraneJan
时间:
2012-3-7 15:32
1#
hubangzhi
+ f- }8 w/ [4 c' y/ l
9 G* O& A8 g3 f" b
if(content(current)>1)
) H( w; |1 |2 p$ N8 o n
{
2 [' A5 @8 i4 a6 y% d- ]
treenode ts=createemptytasksequence(centerobject(current,1),0,0);
# ~7 C- b0 ^% M+ S( |( R w8 ~ q; g
$ g W* V4 x, C7 x4 c) N
inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
# U7 l$ p4 U9 ~, A/ p
inserttask(ts,TASKTYPE_FRLOAD,item,current);
" N1 N" B+ J+ d2 [
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
0 _% G6 A; o4 U- T+ V, {
inserttask(ts,TASKTYPE_TRAVEL,centerobject(current,2),NULL);
5 k8 [) ~6 v7 l! i% N- `6 m
inserttask(ts,TASKTYPE_FRUNLOAD,item,centerobject(current,2));
2 s5 D4 M. m) A) Z! ~
+ l2 V3 z( B3 y3 W- t
dispatchtasksequence(ts);
) D, n- N9 v+ I' q& Y
}
4 X, J, u; ^/ b; j
: O! [! m! D( S" C b0 @
) z7 m' x$ w; L8 O- u, l D6 t9 d, U
这样应该可以了吧……
作者:
hubangzhi
时间:
2012-3-11 22:42
2#
CraneJan
. T! c0 D3 ]* X. z8 t+ Z W
$ Q" ]3 B d4 K4 R& a. c
/ a r5 \( `9 t) \
o啦 太感谢了哈
作者:
qhg1982
时间:
2013-5-15 15:05
原模型的代码是:
$ K0 k) f7 I* f/ N8 ?
+ t2 F, y }! J Z/ E+ x; o+ M
if(content(current)>1)
1 m# ], }" [6 p3 s J5 f
{
* g- [ v) [% |; a' ?, j( b
treenode item1=rank(current,1);
( ?0 u+ D5 @" \, v; L+ A& V" ^+ h
treenode item2=rank(current,2);
+ G2 }! [3 o! y1 K# e$ @
7 g' T+ f' Z. A( d7 O7 M
treenode ts=createemptytasksequence(centerobject(current,1),0,0);
9 R* `0 b1 G7 |2 a0 I
r0 G, A( c/ O& o2 o6 H3 {8 i
inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
. z+ {* C4 ^) y4 w# O
inserttask(ts,TASKTYPE_FRLOAD,item1,current,0);
h9 |2 G6 Y1 f4 E0 z& H. O
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
4 _4 E) T1 X6 G) u4 Q5 M8 |
inserttask(ts,TASKTYPE_TRAVEL,centerobject(current,2),NULL);
5 ?% {5 C: _: O4 d
inserttask(ts,TASKTYPE_FRUNLOAD,item1,centerobject(current,2),0);
r9 h& Y2 N( I+ M) h9 y, p4 r
# _7 {# j7 f" G J& K4 L- [
dispatchtasksequence(ts);
$ C: M0 E2 [- O, U0 W
}
7 a$ n$ d/ x# W! |
2 S# y, j8 o6 p3 g- x2 |% y; Z
只是用rank函数获取了流动实体的指针,为啥不行呢?
作者:
天性518
时间:
2013-5-16 12:18
4#
qhg1982
6 S2 `" X% b( ~& A; E, s& a
- q1 t3 O9 \1 t
2 D, S2 Y5 S. K! ?; R4 V
这些因为操作员每次只会去版item1,你把发生器3产生实体的方式改成到达序列,你再去观察模型,就会发现:操作员搬走item1这个实体之后,他就不会再搬了,这是因为暂存区中没有item1这个实体了让他来搬了
作者:
qhg1982
时间:
2013-5-22 08:46
谢谢!
作者:
JYF-芳
时间:
2020-12-1 09:57
请问此问题解决了?我也遇到同样问题了,求教!十分感谢!
作者:
wangchangping
时间:
2020-12-21 23:14
进来学学任务序列
欢迎光临 全球FlexSim系统仿真中文论坛 (http://www.flexsimasia.com/)
Powered by Discuz! X3.3