设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13179|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: T( b$ t1 X9 s% M6 V3 C; W1 f& ^: B$ n. ^( w# Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( L6 W/ ]" z" P

  K$ ]: x2 q2 u+ t1 M/ b8 pbegin P_read arriving, _; ^2 @! v9 u- ?
    while 1=1 do begin7 c: p8 B) S1 @
        read A_tote from "data.txt" with delimiter "\n"
* F9 m% I5 u8 _* @  _        read A_time from "data.txt" with delimiter "\n"
3 J) A! I7 p, q3 x) u5 A        read A_leave from "data.txt" with delimiter "\n"$ N: Q9 x5 C; o9 G4 P- X/ y
        read A_picks from "data.txt" with delimiter "\n"3 S$ V3 \* X0 t) [
        set load type to A_tote
& O3 E* [- T# J4 L6 ]        if A_tote="tote 1" then set A_induct to 1
8 X. K5 M8 S. K        else if A_tote="tote 2" then set A_induct to 22 }% p4 f' Q( i  `) u. {" c" z
            else set A_induct to 3   
+ d5 W5 A% C1 M0 s4 `: i        set A_i to 0/ y, A2 d+ h, J
        clone 1 load to P_induction
& ]' R4 X) B, u        wait for A_time sec" p. r' Z2 I6 g4 x! b( l& @, Q- x
    end
. J& e% |' C6 V' i- {% w( nend
$ Q* Z& W: m. K7 [9 y2 X( i( I0 A7 A3 J' T! g, E* G# e  G9 B
begin P_induction arriving
. W9 X7 Z3 l6 S2 F    if A_induct=1 then clone 1 load to P_pick1
$ F; g8 b& j  [2 c  t, X% }    else if A_induct=2 then clone 1 load to P_pick2
, {) V( k# R, }2 `, L1 ~        else clone 1 load to P_pick3
/ D! _3 O4 `& ?  L: l3 x1 nend( z$ v' l/ F* _3 F

' h' E2 N; r9 G; c3 Xbegin P_pick1 arriving
2 w0 C6 s) x; _2 H1 F5 M) `    set A_i to 1
$ J7 Q5 `+ a8 f) k* @: `! g    move into Q_induct1
+ R  g5 A6 ?- B* _    move into pickaisle.induct1
* E8 t1 z/ b4 I$ v' ^    while A_i<=30 do begin
# Z0 Y: s1 V# {( n# v1 i+ C        travel to pickaisle.con(A_i)# x) s( b# Y( F; V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& s5 m' w. v: V' i9 l6 C  R        else wait for 10 sec
( r! x; S0 i" W& _# ^2 Z        if A_i=A_leave then send to die8 L$ }& L/ S+ B) j1 M% p% ?
        else inc A_i by 1( s8 Q6 o8 ?2 e" t
    end7 a0 G( `( q& N# a6 o0 D
end+ d9 v0 ]3 m: T8 c& g# B! z

% Y4 R# }2 E, f8 S. m' j  nbegin P_pick2 arriving
1 v2 ]4 Z, g9 N' f2 j: i" J$ l. S    set A_i to 11
0 o$ |7 P) ]: e6 B3 r* m    move into Q_induct2
4 p! E( a2 l5 r+ t8 l1 c+ t( w    move into pickaisle.induct22 j0 @% n: I5 U3 t5 B
    while A_i<=30 do begin
; h. o2 D3 E# E        travel to pickaisle.con(A_i)- v% S2 Y, [" X0 {1 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 V% S# N6 c5 w+ o        else wait for 10 sec
( O# W8 r) d2 W2 Z' z9 Q; @$ O        if A_i=A_leave then send to die
( G  M. Q5 N7 m8 B        else inc A_i by 1
8 F$ s( z8 t. z* j; C    end  B# W% Q3 A0 t1 n# `
end: E9 O3 A  H( z4 U

( w7 M" k( R  C3 ~4 s+ Hbegin P_pick3 arriving+ H# u: u' d9 I  c
    set A_i to 21
, F- i/ u- N5 G% F) o" V    move into Q_induct37 ^, Y; j0 ]$ l/ Q. C) a- }: k
    move into pickaisle.induct32 j; H7 K: l4 X( R! j
    while A_i<=30 do begin1 \# K1 |) E0 u8 b8 f, d
        travel to pickaisle.con(A_i); u& y- S0 q5 g+ S$ W9 R4 E- l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ R5 a3 i8 z! R3 q. v# z        else wait for 10 sec+ \  ?4 o/ S4 `' {- Z1 D
        if A_i=A_leave then send to die+ x6 O9 a  u! H& r* Z$ w8 ~% q+ Q, Q. [
        else inc A_i by 1
" r4 h1 W& D  s5 D    end
3 O5 H( }% o9 send

最佳答案

查看完整内容

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是个什么东东?5 h9 y, P7 Q+ ?2 S! e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 p- @  c3 L: @: a: O/ K8 _9 t, K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 h% U4 s# y! l7 @" t' i' m: |: q- `) F5 g- X5 U$ x. S
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, h, w" h; t8 [. L" S* t: X9 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 |2 G$ w/ [2 V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 b8 ]; i& W6 }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. s5 r- J7 q2 Q: P0 L& ?* pbegin P_induction arriving' o& ~8 ?$ s: b2 _7 S
    clone 1 load to P_pick(A_induct)
, ^; a, S1 F" Gend最大的系
6 z2 a& e/ b! A' N1 k
1 T& a6 k4 H- D  W0 X) L# `2 @begin P_pick arriving
8 v0 K$ w8 D- D6 a% ^* z    set A_i to procindex * 10 + 1
' F  [' a$ r' a, T    move into Q_induct(procindex)
* O5 p& }. p8 A+ o6 b) u    move into pickaisle.induct(procindex)2 ?# S  F* N5 d; E8 G
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 b; k* i( x( n: O/ p! u, M' g5 r# q  C- {9 l8 G
    while A_i<=30 do begin7 j/ ^% ~' Y6 |3 L; d
        travel to pickaisle.con(A_i)
. Q3 T( a' R. y. [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, X5 J* K" ~" Y        else wait for 10 sec
( P$ G! S: u- F  W6 K4 Q" y9 F        if A_i=A_leave then send to die& G" j3 j8 ?* }, q  e# f
        else inc A_i by 1& l; V; Q' G# \7 S7 R+ A# s' Q9 t6 t
    end
4 e& K' `# q1 M0 x8 v0 rend
' o2 s+ h$ I) P9 K
( p" Y  a& C" @9 u* _! c其中的procindex为整形,代表当前process的序号。
1 a7 F& f1 x. N* ?2 a8 h& T1 g  Rstation和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-3-24 21:21 , Processed in 0.020713 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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