设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11662|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 g( l) f) U2 t' Y9 }! A( E' e, |. B* l% |1 r+ k5 x  u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 W2 ]% r8 `7 C' F' T: B: @" ~' J
5 V6 f- c6 {2 Z! O. Z
begin P_read arriving
5 r1 y4 a0 ?2 F6 B. C+ x    while 1=1 do begin
  ^# O9 J& s% n( Y& s* M( B        read A_tote from "data.txt" with delimiter "\n"
6 z! B/ q7 O. S0 ]8 k$ w; o2 F3 q        read A_time from "data.txt" with delimiter "\n"
- k. B- n3 F  U1 k% k        read A_leave from "data.txt" with delimiter "\n"
4 C' D$ g7 ]; f. t        read A_picks from "data.txt" with delimiter "\n"
' F/ h  i) f. I, k6 \/ y( }" h        set load type to A_tote
0 M! g& N7 R; b% F  f( E6 u. y; t        if A_tote="tote 1" then set A_induct to 1
( B* R, S$ F  ], D        else if A_tote="tote 2" then set A_induct to 2
! ?% X4 t& c6 l% C# N: r, [2 |            else set A_induct to 3      ?+ ^4 V! P, V. z' g: l
        set A_i to 0, k7 r3 A0 D* ]# a
        clone 1 load to P_induction
% D( M" H' A! d5 r        wait for A_time sec- x0 I% z; S* Z' J
    end
( l" t, S; u: Z" Z; B* \end, i8 Z8 p: P: K. Q4 B
5 @- b3 y/ R' V" e
begin P_induction arriving
$ Z) c; G- C) a; L6 n    if A_induct=1 then clone 1 load to P_pick1
; h8 K4 \+ @( o! c  U* K4 f  O" C    else if A_induct=2 then clone 1 load to P_pick25 M. q- H0 H( |  `  r& h2 O
        else clone 1 load to P_pick35 }& N/ H3 Z6 A8 K) c6 i  A' `
end) K+ n$ |% `9 G1 w

  k" p, R9 k  Qbegin P_pick1 arriving& _% u2 l+ |0 t3 i' v2 _" S4 t
    set A_i to 10 ?4 D% t8 ~' m" F- l. `# s
    move into Q_induct1
$ p. s  M- b) j1 R6 `    move into pickaisle.induct18 |; U6 b9 [& M: U$ B$ G
    while A_i<=30 do begin
, Y$ c2 I; A/ }( m* w) z        travel to pickaisle.con(A_i)
; f4 p; l$ R& V- |( |2 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 X" N. K4 t9 k4 w        else wait for 10 sec. ?( T) L9 Q. N" J' i8 q% D; ^2 e
        if A_i=A_leave then send to die8 b0 s( J, t% a2 N
        else inc A_i by 1! [# _+ P( P' h6 v/ v+ L; n1 V! x
    end
  b: |  }0 g  {" v+ C7 t; p  rend4 b1 `, f* O  Y3 r; I

1 v7 N0 A4 d, q2 bbegin P_pick2 arriving& M1 R" Z7 u  m6 v' B. }
    set A_i to 117 w- ~) u: c* J' q5 k
    move into Q_induct2
- z; s6 C+ _- A    move into pickaisle.induct2/ S! W3 F% q2 _, B/ ?: p; O& ^
    while A_i<=30 do begin
6 V0 x0 J  x+ u% s6 W        travel to pickaisle.con(A_i)
; s1 f( t- v6 B! R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ b% t' D9 k4 U! S8 S0 O8 c! d        else wait for 10 sec
% H1 r; K3 c2 U0 N0 ~        if A_i=A_leave then send to die* Y. ^1 t* c5 o% a+ w
        else inc A_i by 1
6 c5 b9 c3 {# Q% e1 p" D) Q- g    end" Q" o; t8 N4 i7 x
end
( J. q8 P- @: V7 R/ [, K5 O  c$ Y/ z! V* `5 j  d1 x5 I
begin P_pick3 arriving
6 `3 [+ F/ W/ m; u    set A_i to 213 y3 L, p, ], G3 j) N
    move into Q_induct3
8 M; j+ I. d+ J+ ?& G    move into pickaisle.induct3. v- Q; W0 l; g0 o, `
    while A_i<=30 do begin3 X! O% Z/ x! |: U) o3 ?% b
        travel to pickaisle.con(A_i)' s% W/ G. S5 B7 t1 L3 s6 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B, R8 t4 H2 I        else wait for 10 sec
- [( c" M  Y6 S+ d        if A_i=A_leave then send to die, ]4 J1 e7 C, V8 M& W
        else inc A_i by 1$ }' N1 z2 x1 |- W
    end
- t# B  \/ t/ ~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是个什么东东?5 A$ Y3 {' I" z7 y+ q3 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 A9 b: [3 g8 x8 q0 C
: [- E; z( O: M2 T$ ]9 q# @6 Y& z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 B7 I$ I) T7 v. l" n$ r

5 I7 H- i7 t" ], g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# F* Y3 Y) g  Y" v6 g! \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 {7 n& u  o( K. [8 O! Z0 B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( _) I9 R1 b2 j- C- y' c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- X$ `: s6 e. K+ Z( D( C
begin P_induction arriving* h1 F% ~9 `3 @% p
    clone 1 load to P_pick(A_induct). |# m0 k; `! r& u, J. U
end最大的系% q' R7 d0 _  D! A/ p( j

1 H- S( I' b6 i; t$ hbegin P_pick arriving
' g* [4 A; R/ a( F    set A_i to procindex * 10 + 1! r! C, W% r+ D, t7 H
    move into Q_induct(procindex)
& K; H8 H& j  q; Q( i' [4 ]    move into pickaisle.induct(procindex): R& [: L  I3 X) q6 {# p
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 o" }. R2 z& U
" X) \. w) l$ h$ z  F) j- v    while A_i<=30 do begin" Q& s$ ]$ h. N* H
        travel to pickaisle.con(A_i)
4 I& a5 [$ X! N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  {4 o6 @! e& r# g. Z: L6 x$ S+ S
        else wait for 10 sec0 @( S2 N; W. k. K" ?$ u$ |$ @
        if A_i=A_leave then send to die" }' H2 s  e8 J9 Y# F3 V) u9 t
        else inc A_i by 1
3 d" p: B! p' K7 t6 K, U6 k    end% }1 s6 o6 w+ o" d8 x' a
end2 m& M1 |" j3 @- A& D7 t

5 p" \' P  ]# g. K& @& y其中的procindex为整形,代表当前process的序号。3 Y& g% Q* I6 r% F* H8 j/ ~
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, 2025-11-26 11:38 , Processed in 0.022487 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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