全球FlexSim系统仿真中文论坛
标题:
[求助]用任务序列实现搬箱子
[打印本页]
作者:
hubangzhi
时间:
2012-3-7 10:11
标题:
[求助]用任务序列实现搬箱子
用任务序列控制操作员在两个暂存区之间搬运箱子,基本实现,但是有时候操作员会不搬箱子,空跑一趟或多趟,求助。。。。
+ Z7 T* k- W U$ w/ Z
[attach]486[/attach]
作者:
CraneJan
时间:
2012-3-7 15:32
1#
hubangzhi
$ ^+ t& ]& t8 ~! `. h
5 Q4 u$ }8 e4 }$ m6 J3 w
if(content(current)>1)
+ f' \7 F) U6 D( l/ r8 F; K" W
{
! e9 X4 i3 y4 B: W3 F. w
treenode ts=createemptytasksequence(centerobject(current,1),0,0);
5 t& I0 ^6 h, g$ U8 |8 w6 n! _
4 `1 b3 Z* K# ]7 F9 x
inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
6 e9 _3 P& b( r6 B% T" `
inserttask(ts,TASKTYPE_FRLOAD,item,current);
: z9 d! [3 B8 O% o3 n
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
6 E/ y2 z* I" i5 W& E: V2 U0 K
inserttask(ts,TASKTYPE_TRAVEL,centerobject(current,2),NULL);
; K; G) Y8 q# \* {
inserttask(ts,TASKTYPE_FRUNLOAD,item,centerobject(current,2));
, |+ ^1 q' S# W( `
" Q4 C% P# [' l3 X P1 L
dispatchtasksequence(ts);
2 i- D& u3 k# g0 F3 f* w9 t( {
}
% W; M: r) r. B9 K
6 K" Z6 T9 ?6 p1 f% C% A
/ X7 c6 e5 ?/ R0 S
这样应该可以了吧……
作者:
hubangzhi
时间:
2012-3-11 22:42
2#
CraneJan
! m- V" z) r4 W; `
$ W1 [3 ?, a) C
. r- ~0 {! B' |" i. z5 x" i/ U
o啦 太感谢了哈
作者:
qhg1982
时间:
2013-5-15 15:05
原模型的代码是:
4 X. t4 Y; F9 v9 M
! Y! ^: ^" R! g+ p; D$ S
if(content(current)>1)
# s$ X" R, q$ Z1 y4 C. G' t
{
% ~; c4 M! } c# D+ T9 {1 [! _
treenode item1=rank(current,1);
$ e0 r0 Z! i. w4 \4 T( x
treenode item2=rank(current,2);
6 D& b% \1 w. @" P' f
% R5 @! n" a# Q+ w E
treenode ts=createemptytasksequence(centerobject(current,1),0,0);
4 h5 p/ F" U8 k* d9 x
9 I$ T7 I, ]- F `8 D
inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
& J; f V7 B5 s% ?3 }) Q
inserttask(ts,TASKTYPE_FRLOAD,item1,current,0);
- `6 O# R2 l& m7 a8 v
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
( L& q% m. B1 Y& i
inserttask(ts,TASKTYPE_TRAVEL,centerobject(current,2),NULL);
4 b. g8 R ^2 z& f; f+ E( H
inserttask(ts,TASKTYPE_FRUNLOAD,item1,centerobject(current,2),0);
5 i3 J2 C0 h' o( U2 f7 s; B b3 b
: }: z9 n; y/ d3 C8 L
dispatchtasksequence(ts);
( \2 ?: t' u* h8 \
}
; W- i3 m/ S( r! _, i+ M4 ~ ?
! U; q- a# A* E. S D: d" \; X$ H6 ^
只是用rank函数获取了流动实体的指针,为啥不行呢?
作者:
天性518
时间:
2013-5-16 12:18
4#
qhg1982
# R" s0 m, E2 i4 u8 r
" r4 p: S9 o/ H- X4 j; k9 l. q
& M, G! p6 f! p& J3 L2 M; D
这些因为操作员每次只会去版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