设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13935|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 k! o( }' `3 Y9 t4 z# Q  A1 h+ H7 s* K, }" M% v& m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* K  O( {) K( U6 t# x, i
) a# ^. o4 j( Q
begin P_read arriving
& o) {3 V& p; D# Y- \! P% A    while 1=1 do begin5 a# d' X5 |: c$ R6 Q3 X" D& h
        read A_tote from "data.txt" with delimiter "\n"5 f- f% P" c5 s. M. b3 a
        read A_time from "data.txt" with delimiter "\n"% \, b1 D+ J7 [, R1 b/ a
        read A_leave from "data.txt" with delimiter "\n"  }! I- M! o- N. k( q
        read A_picks from "data.txt" with delimiter "\n"
0 i" u3 P. U' N& V5 v: ~        set load type to A_tote
6 y8 i' R. ^$ P: W; ~; \5 i        if A_tote="tote 1" then set A_induct to 1; n9 U) E. F; Y2 x; J0 O9 R
        else if A_tote="tote 2" then set A_induct to 2
" I% W2 y2 `6 n4 a& V& P, G            else set A_induct to 3   
" m7 ?6 Q9 l6 b9 P& _- F# o        set A_i to 0, o0 z6 I! N: n6 S; j
        clone 1 load to P_induction
: S- W! |) M5 t" h; u0 t        wait for A_time sec" R+ F3 C- d( E+ W- L
    end
' F% ^. \6 a% W+ k+ B2 c. G/ gend; l8 w8 b  v/ O* U# h# T! B

6 p& T/ m: R+ |/ M8 X( k- U" kbegin P_induction arriving
. Q8 b- \1 Y4 Y9 N/ E8 X, i$ z$ \* m    if A_induct=1 then clone 1 load to P_pick1
+ `' K# P4 o9 G# P* D; e    else if A_induct=2 then clone 1 load to P_pick2
4 }3 C# H, j$ k5 w# [3 ~* b3 Y9 ~: ~% ]        else clone 1 load to P_pick3. X4 k- p8 D( v- a$ w. h
end
7 [+ O  O; \* Q. I! F+ s' |& G, \7 B' ]. [& f; _% d/ u+ ~4 \, O
begin P_pick1 arriving! v7 ^2 |) `" V+ @/ q' s
    set A_i to 1
$ p  A3 v/ H  v1 U$ h% F; }    move into Q_induct1/ z7 N8 @  ?& I6 S% ~) S
    move into pickaisle.induct15 O! @0 O) X/ M- q4 {
    while A_i<=30 do begin) I9 b5 n: o) ^3 M2 i! T+ u
        travel to pickaisle.con(A_i)
( y& S, x& i/ @) O( a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ h4 `6 w0 m7 A# T6 s! U+ ]        else wait for 10 sec
- G7 M# y; k9 _" L) U- v        if A_i=A_leave then send to die: D+ `3 H; u8 F
        else inc A_i by 1  K, d6 L1 e4 N0 e* d
    end8 f$ `3 V+ p' X' e6 M/ _! m. m
end$ m$ _3 L# g2 e2 A) |* m0 L! o

; p) J1 A0 O1 q' i% A( T1 ebegin P_pick2 arriving$ A) l2 I6 c- y+ w) M. J; n
    set A_i to 11
' G/ |1 {( b/ S    move into Q_induct2  c$ G4 D9 v; |+ |
    move into pickaisle.induct2
2 @0 `7 e7 d% W9 p. v8 g- L    while A_i<=30 do begin
7 p: U/ Z4 Z* f        travel to pickaisle.con(A_i)9 E9 \7 l, n7 l; T$ E( `: G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 J0 {! W9 Y; P. F6 q        else wait for 10 sec& w, }  W3 c" k5 n$ [
        if A_i=A_leave then send to die% @  B& T  ?) U( Q+ S6 x, f
        else inc A_i by 1
2 _6 m7 E* `- z" i, A( D3 g  k    end: y+ ^/ T3 D3 r$ A' p
end
* Y5 Y& ^% g# \: Q& b0 G5 e  t
. @8 K! [( U: l' w+ D  wbegin P_pick3 arriving3 }6 E* I/ {; o. D: s; O; z
    set A_i to 21
0 j9 z7 o( M- R/ b( g; l    move into Q_induct3$ x5 C5 V$ X& O+ u: m3 A" P) ~
    move into pickaisle.induct3
+ _! c* |4 m. U  f    while A_i<=30 do begin
* e4 p, M0 `: t  Q* K, `        travel to pickaisle.con(A_i)/ U' S- L* m: G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* W' i/ P+ Y. b8 k        else wait for 10 sec% }- B1 Q( r8 z( f- A
        if A_i=A_leave then send to die; p$ A6 F. S4 |( K/ T
        else inc A_i by 1
% Y3 |  P2 W+ a6 @5 ?3 J    end: [  R5 c5 l) D; q4 ]
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是个什么东东?
! I/ X! r$ j6 [$ i' [2 Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ X, i  O" Q/ K6 b: o; L- U

7 j2 ^: D: U, U' eAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 H  c+ _6 D$ k/ R6 }. x1 J

0 `3 h7 P1 {  k  J; Y/ x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; ]4 q6 H! f+ A$ ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 D  b% P, h% q, }( u6 ^) i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 d. v1 K% d1 s$ f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- _  I6 l9 c$ {9 C9 v
begin P_induction arriving
4 s, M% ^6 X9 |% U% G  X; l3 J& ?    clone 1 load to P_pick(A_induct)/ @/ U& B" y, d. @8 O3 f
end最大的系, H5 `4 U/ K! s/ x: i( k$ T, \# k
' W7 L$ h; [- E  n$ L
begin P_pick arriving
% E; b. p+ Z% E    set A_i to procindex * 10 + 1+ f! Y# ~6 ]+ R! r" n# M
    move into Q_induct(procindex)" Z- j# `5 Z9 z) q" }  s. s
    move into pickaisle.induct(procindex)' H" S0 K8 W# O" U
    /*check the type of pickaisle.induct(i), for your last problem.*/, h2 I9 N3 L! m8 N$ Z, v6 x

& g; }$ i# y  U0 F- x    while A_i<=30 do begin
( m5 y8 w9 h0 d/ x        travel to pickaisle.con(A_i)6 {2 A6 o/ S% L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! g. I& i7 Y! m  N& m) Y$ K+ L
        else wait for 10 sec/ \* L+ c$ {! ]* o
        if A_i=A_leave then send to die* t) a/ Q& L( V. g4 q5 X/ f: b
        else inc A_i by 1
. Z! j6 o& V5 n0 d% @9 T    end
9 S, _. V( i8 O% D4 Mend
- |" O, J" j5 r; ]6 W( X$ A7 E
+ f, h7 M5 w5 g9 W其中的procindex为整形,代表当前process的序号。% |1 P, a) G8 P- ]3 G( f" w
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-20 18:23 , Processed in 3.275594 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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