设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11758|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, q1 n. B' Q- R2 g# S0 z1 T% a: U; O+ D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' x% \6 z! o1 J4 i6 f0 q: H/ Z
; R8 Z1 U) h" ^
begin P_read arriving
1 h" _3 _) F% @9 f8 t    while 1=1 do begin. H* l' T; s/ H2 C
        read A_tote from "data.txt" with delimiter "\n"
6 X) R1 W2 b$ \% p% p7 W        read A_time from "data.txt" with delimiter "\n"
3 A: D+ P9 T( c        read A_leave from "data.txt" with delimiter "\n"# R: r6 U" H) _' ~$ n0 V1 q
        read A_picks from "data.txt" with delimiter "\n"" O7 i. r* h9 V. [8 x/ N
        set load type to A_tote5 {' L% G( t# Q' O* w& b/ c1 P& G
        if A_tote="tote 1" then set A_induct to 1
' c5 j' T& X0 y1 B- _, O1 b* F        else if A_tote="tote 2" then set A_induct to 20 Q. T$ m( O$ P
            else set A_induct to 3    . ^- I7 ?$ b/ z$ R/ c3 w  f8 X
        set A_i to 0
; l9 J0 u; r& r1 a6 W/ |' `' [; r        clone 1 load to P_induction. ]8 F( N8 w* P/ J, K
        wait for A_time sec2 W' d5 c& R: A1 S- W
    end# k6 o& {# B, d) w$ i
end" j7 Y8 z% j6 t6 N

  G" }4 L! E' }( ]' r! x5 m9 \* qbegin P_induction arriving1 M' B4 Q% M. ]! Q2 Q% S! K
    if A_induct=1 then clone 1 load to P_pick18 g& p: E0 s% }# _% m; q) o: n
    else if A_induct=2 then clone 1 load to P_pick2
+ {6 K0 F9 I4 j7 h9 t. t( k        else clone 1 load to P_pick3
7 c+ v' {, L5 B  D1 Q* x' m% Tend
: B; p+ Z. P; B, |( W3 W4 {7 L" o. G2 n" n- g0 a( V/ d
begin P_pick1 arriving
, _% M! r$ Y2 q( z  f8 Y0 T    set A_i to 18 h3 R, v2 ?) \/ E4 G) H1 d
    move into Q_induct18 o, @2 ^7 w; U" U
    move into pickaisle.induct1
- M& q0 M/ {/ k, I6 Q- o! y    while A_i<=30 do begin
* C# S$ |# Z* k2 e$ C* d4 T! g; _/ s; I        travel to pickaisle.con(A_i)8 A" z2 ]9 Q6 M. V: v' n" R" t$ U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V9 E$ B# k5 O) _7 ^4 O/ P        else wait for 10 sec
) L8 |0 }* c7 h7 [        if A_i=A_leave then send to die
2 b; n9 n& b4 Y        else inc A_i by 1
5 s; K2 b' H% N4 D    end
9 F! `% \- i( R1 G" H; rend
7 h2 x- B- O- v' q3 d* G  z: z# u: F" D/ T( p5 U$ v
begin P_pick2 arriving6 @2 Q% A0 ~5 E4 g; n
    set A_i to 11; T1 c+ X/ J5 N" q) J
    move into Q_induct2/ F( @8 s% g) A9 M
    move into pickaisle.induct28 Y" d2 L% g( G- o
    while A_i<=30 do begin
4 U1 w. X: q: ^! ^9 j) n+ s0 s* Q        travel to pickaisle.con(A_i)7 _, B, S4 X% C9 H0 ~: Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' M+ c2 O1 h, u* g0 \        else wait for 10 sec  s  F! w* F6 f: L) L" @# q
        if A_i=A_leave then send to die
" p( X( c5 b* l' {$ G0 ?        else inc A_i by 1+ ]# E; u* _2 W4 n/ A' U
    end
) U5 q% x  v# Qend
* F* k4 u- [5 h0 i4 W; [: U
+ z9 l5 p+ l* H6 @; xbegin P_pick3 arriving
1 E' \7 {4 e7 ~    set A_i to 21
3 R- N# `6 d) ]" R( b1 B) d# T6 e* J    move into Q_induct3
  s- q' y& \) Y8 \* W    move into pickaisle.induct3
+ j* S# C0 F6 i8 O, R! W0 g( P* d    while A_i<=30 do begin
5 }& E+ i) {2 t6 v: g0 o        travel to pickaisle.con(A_i)- i* [5 o3 s7 W8 X! ]. [! \1 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- H  U7 j1 o6 R) p
        else wait for 10 sec0 G& i2 G' b& V/ o0 L* f
        if A_i=A_leave then send to die
- m! c$ b: `' x$ B+ ~+ @        else inc A_i by 1
) Z2 z4 M$ l4 w% r: N    end2 o5 U; M* d8 Y& g- @8 i) _
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 W6 y! t) r7 Q& fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) s: O/ o- }( q; M/ x; G) E; x3 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% `+ Y1 ^: G3 M& T7 @' s5 q4 l7 o
. \- d( p# H& w6 Y( X  D6 Y- L5 w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 W9 q- S( l  A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- i- L8 Y8 g2 Q0 M' F- @. d; K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ i( I1 E- Q* q/ P. d% B
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 Z3 m) C# m; K" Tbegin P_induction arriving
: |/ B% E7 l( t) t$ r, \. z7 i; A    clone 1 load to P_pick(A_induct)$ z. p2 j+ h3 N' W4 N4 E
end最大的系! Y; p# g/ D; f2 ?2 b. A, n7 q$ C

# `5 _. W1 U7 R6 i" Gbegin P_pick arriving; F2 H' \1 j% C0 g) z* y
    set A_i to procindex * 10 + 1
& [9 I+ ]4 U* J' _    move into Q_induct(procindex)
! l" R+ ~: z$ ?7 {1 x# d1 Z- l    move into pickaisle.induct(procindex)
1 j- m3 M0 L, y9 v5 K6 A0 r    /*check the type of pickaisle.induct(i), for your last problem.*/! M% Q6 A( P! e3 c8 X- |$ K

0 v/ Y* v4 q' N8 M, M    while A_i<=30 do begin; j0 Y* }6 \8 `
        travel to pickaisle.con(A_i)
! N! p) a6 a6 H' u3 i4 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ K8 R4 l2 M0 w3 i( L
        else wait for 10 sec
1 r: L3 `0 Q! ]$ Z4 Q# V        if A_i=A_leave then send to die
7 f* h* P* j( r+ o8 W9 {( U        else inc A_i by 1
0 Z, T0 H1 ]( C' _9 N# }    end  ^7 [+ R5 X6 u
end
; S7 D& J. u5 x0 J- z+ |6 N
' T( D8 a# d" _! E' J' W2 X5 C% m其中的procindex为整形,代表当前process的序号。1 d" r  S( b$ l7 \8 i4 A3 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-12-2 23:59 , Processed in 0.019161 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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