设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14259|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 t4 q5 q4 f# S) ~
9 t' a! f+ n: E+ y: U4 X/ ]/ ?3 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。; A  Y0 q  S: }! J: C
# t! {! R( ?) u
begin P_read arriving
, C8 B1 h4 ^0 R7 t* e* M/ e    while 1=1 do begin3 A: i/ T5 ^, r! g( B& N
        read A_tote from "data.txt" with delimiter "\n"
" H- g6 h" j2 M. d        read A_time from "data.txt" with delimiter "\n"
5 j! |+ ]5 m- I6 B3 _        read A_leave from "data.txt" with delimiter "\n"9 p4 {) e+ N: ]* C' y, J5 i  V
        read A_picks from "data.txt" with delimiter "\n"0 G% d: f) R7 m% p. c5 W+ O
        set load type to A_tote
" S) @+ C6 s6 E* o: Y3 a        if A_tote="tote 1" then set A_induct to 1
$ l# l2 L; H9 a! b        else if A_tote="tote 2" then set A_induct to 2
- |4 a7 ?7 Z- C7 e3 u0 G6 E) F            else set A_induct to 3   
" b" u. E" [; c3 T        set A_i to 0
% {& Z( q8 {; ?+ w' @        clone 1 load to P_induction
" K: _- A: G; |/ J, B- C7 h        wait for A_time sec
. p8 p/ W/ S" s. i( [. y0 g    end
* [) {, X/ R( T0 q/ e0 s, R- Wend6 a. T6 P$ I9 l4 S# j" h. a1 ^

- n1 a6 f. \* p% Q1 E/ Ibegin P_induction arriving+ _; U" `* X+ x" E' t/ Y, a8 M$ z* V
    if A_induct=1 then clone 1 load to P_pick1
4 w5 z, \- B- L# ]1 ^    else if A_induct=2 then clone 1 load to P_pick2; a8 e. k% M4 r$ g
        else clone 1 load to P_pick3  U; D  i- F. T7 Z
end6 y+ \* i& k# }+ Q. E3 _3 O* m

5 r( l- V: S# G+ P4 Mbegin P_pick1 arriving
4 ?) K* |1 c% c, w; _    set A_i to 11 d9 m" Y; `* @" }+ j' z( T
    move into Q_induct1+ s0 z+ J+ i' G" {- D% E# @! o- {
    move into pickaisle.induct1
3 E! `% X2 U% X' j* l# w    while A_i<=30 do begin
# e4 T% K) r9 z; K9 P9 K        travel to pickaisle.con(A_i)
+ r/ `( T5 ]: ]0 C  H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& [, y" S, c0 y6 n8 W5 Q        else wait for 10 sec# c# J1 p! Y+ `& ?0 ?7 ?! M6 m/ @
        if A_i=A_leave then send to die2 ^: J+ _5 p0 {8 a( V, V
        else inc A_i by 1
4 J# s/ q/ `, z* D/ v0 ]    end7 N0 n3 r4 }1 r" A
end/ b) V( o6 Q$ ~9 c4 Y
* p6 f  Z# G- m7 ~( f( }
begin P_pick2 arriving
6 ?' _0 P+ \4 W3 l+ N1 R    set A_i to 11. \/ B( o2 @& `$ `; \- F6 o6 @
    move into Q_induct2
) c+ u9 }4 }+ l$ U    move into pickaisle.induct2* W$ L4 D5 N% X) a. r
    while A_i<=30 do begin. g" _0 T9 m4 v$ c; r: v
        travel to pickaisle.con(A_i)
/ b4 q6 S. @. |5 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \( ?0 a) v/ J6 \( U/ @1 z8 Z& D        else wait for 10 sec
" [  Y8 O$ y& I6 S7 U        if A_i=A_leave then send to die5 L) g- k* Y$ [, Z3 I! ]
        else inc A_i by 1
9 |" W0 a4 {; @2 y    end
' H* V2 E* ]; b4 n5 c0 }1 t! a- P8 Iend
- y% K) p2 y; B7 x& F! y, z' P$ ~& }2 E: l& C  t
begin P_pick3 arriving$ s9 B: J; H6 {) I& k) y
    set A_i to 21$ E2 h, b6 L- U4 s& w$ M
    move into Q_induct3
9 C( f% s; x; C2 v8 U, I3 z( \    move into pickaisle.induct3
; q( C2 E9 l/ X' f    while A_i<=30 do begin
7 d: ?4 N) R+ a4 Y: H2 ]6 n; B! y9 g        travel to pickaisle.con(A_i)
0 U4 y! |3 B- O* n* N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 c9 b6 F9 w9 W4 R4 p2 Y8 z        else wait for 10 sec
( b2 ?) \; s- M3 u! Y) J- O, o        if A_i=A_leave then send to die. o' d; q( k: N% T; y8 b' Y8 F
        else inc A_i by 1
" x0 h% ^3 k1 y$ E1 I& `    end; w  A6 }! E! j: A, W; y
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是个什么东东?( r! }% M9 g5 U- z8 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 M1 a2 P1 ^3 [, Q

; g- u2 Q& n2 Z0 H+ t; rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 V/ ~7 [0 i& _$ I0 d& H( O. \4 D5 @. I6 }3 V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: `- ~. G  I6 m$ r3 P' j" p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 E. E8 ?4 k- ?+ l0 A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 }4 M3 v( o  w  H) M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 o% Q0 O* n3 g4 tbegin P_induction arriving
7 P6 W0 I: S( Q+ O! @    clone 1 load to P_pick(A_induct)
- Y4 p9 h: E1 P" c8 P) C4 F  i3 v+ fend最大的系6 ~$ l8 }; K$ S4 r0 ^) M, i& l
/ v+ ]. Q; E4 D- F; Q
begin P_pick arriving* J  v$ I3 N5 b% `1 n
    set A_i to procindex * 10 + 1
! B4 [# S1 M$ F" k9 O' ^6 h" l    move into Q_induct(procindex)
: ]+ W# ?. N+ Q- L9 [$ w6 J    move into pickaisle.induct(procindex)
* g1 h" j5 a# z/ C    /*check the type of pickaisle.induct(i), for your last problem.*/
4 O$ r3 h: z$ T) \, U4 A  }4 I) V5 o+ {, y9 u" E& P( r
    while A_i<=30 do begin) R: P  g; `0 T' M
        travel to pickaisle.con(A_i)
+ O0 L: s8 f" y+ r; o3 j( T7 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& |) i, N6 ?5 z7 {  [2 J- j9 @
        else wait for 10 sec
" Q* n7 e% I8 k7 q2 Y        if A_i=A_leave then send to die3 \( s* w) u0 g8 z% _" |
        else inc A_i by 1
! }& _( ^+ C7 m' G4 P% r    end# N8 ~6 C$ t* r  L0 j. P
end
- z  [3 n6 S/ S* L7 U, o6 w0 J: A1 r& z  d4 o. c
其中的procindex为整形,代表当前process的序号。/ X/ s; V2 H9 a: l( ], \+ q
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-6-25 17:25 , Processed in 0.013197 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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