设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13868|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' Y, B: |4 l, N7 F
% A; Q) h8 O, _! d$ @9 e0 l8 r我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。; Y, h) f; ]# Z

$ K/ v1 m, V" [! p* Ibegin P_read arriving- h# ^/ B* H6 s2 S! @
    while 1=1 do begin: y1 m9 Y& Q/ M% N! Q' z
        read A_tote from "data.txt" with delimiter "\n"
# t* M% k! P6 b+ D# z9 B        read A_time from "data.txt" with delimiter "\n"
& ], m6 ~; B7 q        read A_leave from "data.txt" with delimiter "\n"" x- O% c# T7 n1 ]. g
        read A_picks from "data.txt" with delimiter "\n"
: m8 H6 L; t5 x1 t        set load type to A_tote" |4 d( s9 D& _- }+ y9 s3 f2 O
        if A_tote="tote 1" then set A_induct to 1  Q$ J) S* K# U0 Z2 B
        else if A_tote="tote 2" then set A_induct to 2
; h0 h! c. J* _' ^            else set A_induct to 3    1 [. d+ \( B3 n2 E/ ]/ q! i
        set A_i to 05 y1 r$ S: P2 V2 f9 @
        clone 1 load to P_induction
) ?! z  s" r3 x  Q* z        wait for A_time sec/ q1 q, Z+ s. m5 r& v2 O: o
    end
. q8 i8 h* Y4 L1 rend
, a% n1 \" S/ S1 e8 O
4 n/ V+ R4 _0 p1 u$ R2 ~0 Z+ xbegin P_induction arriving
& y! t; E; o3 l/ w8 L    if A_induct=1 then clone 1 load to P_pick1! M/ Q% d2 ?& F6 @8 c; s. n
    else if A_induct=2 then clone 1 load to P_pick2# M/ `/ ~) r6 s! s% L: ?/ g5 l; T- P
        else clone 1 load to P_pick3
6 r% V5 S! c3 a0 l# Y4 v# g3 iend1 Y- {( v1 u7 Z+ M* r7 C8 R# c7 k

) x% u! N) s. w* p. h+ Ybegin P_pick1 arriving4 J- `$ g) I9 C* z9 s/ z
    set A_i to 13 u6 W! _, N3 i* J* A
    move into Q_induct1
6 G/ G1 r0 @& N* j, D    move into pickaisle.induct1! o$ p& R) w' s) k' o
    while A_i<=30 do begin
" I9 m( z# Q- X) _        travel to pickaisle.con(A_i)
7 |7 x4 p/ ]" m' H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v; [# |! N4 x( r, i) j8 {" i        else wait for 10 sec) C! q+ w! W! o+ d
        if A_i=A_leave then send to die) u# K0 U/ M: L
        else inc A_i by 1
0 g: J- g/ i8 T, T; E" C    end& h- V+ Y& b- Q& X+ K2 ]
end; a, _4 T" J) Q

0 H& e2 P2 C! B; ^9 @begin P_pick2 arriving" x) e) C- C  O+ i/ i$ F
    set A_i to 11
# |8 c" f5 a& G% L: L2 i    move into Q_induct2
% f( O. w/ m' B6 k/ R- G. v5 q5 y    move into pickaisle.induct2
" |1 b( e! U9 I) `    while A_i<=30 do begin
9 P- @2 w. Y& i/ q( r! I3 X) v        travel to pickaisle.con(A_i); `2 y' v: T( }& t$ _; d% b$ I+ v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  a2 m. J2 l9 i7 x' A' B        else wait for 10 sec8 ~4 D$ ^  y- W' a& @9 T
        if A_i=A_leave then send to die
/ m* j2 g- E0 p        else inc A_i by 17 f8 y" E3 f" u- h
    end. t! _& Q. z% n5 u
end4 z* o4 q& F: h) N: z
. ^* \* w8 ^/ r
begin P_pick3 arriving
* L4 E' g/ L1 q5 a+ ^  G3 W    set A_i to 21
) X6 G; O" ]8 i$ I; ^  Q) q    move into Q_induct3& \! T/ Q# z! R
    move into pickaisle.induct3
* {1 f+ F5 n: J9 i  X2 w+ x    while A_i<=30 do begin
) h/ G! E/ F4 O- o5 P& [        travel to pickaisle.con(A_i)% R5 \. j* u- |) {' a. D) r- Y- W7 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( y. M2 ]4 l; u
        else wait for 10 sec- h; I/ a* \! y# o" J2 i+ K
        if A_i=A_leave then send to die
, D" V: e7 H5 |& ?) S6 d8 ?        else inc A_i by 1
, G; B5 E3 L$ R7 L: z- G    end0 Q- T$ h/ f) d4 J- D1 \
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
$ ~( g# e% c) n9 q! amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" X2 E8 M6 V- I' E0 p( k; H  ~9 X( ~1 N/ Z9 ?2 ]  @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. t' @+ G6 C& W0 \
" j% b* u3 `+ Q; O) R7 w( S
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' U7 a( D5 v" e& M% c% F: F! x2 c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# ?- x+ i5 W& j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 K: d# K+ j" [5 }! K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' K4 H! j% U7 ?- F! d0 q( G
begin P_induction arriving
; K: \; t! m, A+ ~% A    clone 1 load to P_pick(A_induct)
/ s' X7 F! H( T* Q) \0 x2 d6 X+ eend最大的系
5 v- ^1 E3 P, e0 w4 H9 t' W/ |: J6 K: k  A
begin P_pick arriving& v" g) ~( g( G" ?/ R
    set A_i to procindex * 10 + 1  f( Q- ?9 ?, w: C8 ]
    move into Q_induct(procindex)
) g* [2 E: Z; L, v  x    move into pickaisle.induct(procindex)
  j! |  _4 t* P+ B  ~    /*check the type of pickaisle.induct(i), for your last problem.*/8 D0 Y. @$ w) R5 \9 ~0 g9 ]+ ]

( ]9 s& W# x  w/ k; o" P    while A_i<=30 do begin7 K* u- A& h5 `- t# @) M& b
        travel to pickaisle.con(A_i)
. Y: i% D5 K- D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 J3 |) Q4 W+ h
        else wait for 10 sec
5 H& w2 \) u4 J8 a/ v        if A_i=A_leave then send to die
" R: @5 \) B  K% G1 U, u  k6 ~* [7 K        else inc A_i by 1" Y/ H7 [4 W8 o/ S" w# X
    end
3 F! _: c2 a, u% x8 qend4 y1 R7 w: A- }' P$ Y0 S
* b1 o2 n% {' P
其中的procindex为整形,代表当前process的序号。% ]0 t7 U8 P3 q" u
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-5-13 12:57 , Processed in 0.017863 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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