设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15568|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& \" D1 A) e6 k0 E7 F) i6 Q' a- p

- A8 f4 D0 F: \9 E- ?' I: x我的问题是,在每个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中的数值,不知道会不会有什么不妥。! e9 T0 I% N1 g! Y- }
( b+ l, |$ ]7 Y& d
begin P_read arriving: N( E2 ~0 i! [
    while 1=1 do begin
3 O, W2 o# X3 j; L        read A_tote from "data.txt" with delimiter "\n"
4 Z% P( b' G0 ^$ f0 o. l; j        read A_time from "data.txt" with delimiter "\n"
$ c- C7 l, h& ]- m( s, g/ l5 P+ L+ f        read A_leave from "data.txt" with delimiter "\n"
3 A/ Z3 X, h1 F& H% {0 w1 k        read A_picks from "data.txt" with delimiter "\n"
- H, U' L; Z! w$ n        set load type to A_tote
6 Y7 R6 o- x4 f' i+ d! [; J4 o        if A_tote="tote 1" then set A_induct to 1
: J) Q( R, E/ ^( P& [! J        else if A_tote="tote 2" then set A_induct to 2
# k: K5 ~. A* T: r            else set A_induct to 3   
2 N0 P% ?8 y9 d" P" Z' Z6 ^        set A_i to 09 s, n& w- t. ~# l
        clone 1 load to P_induction
  h- a5 ~3 y: H        wait for A_time sec% i* j, T  @% f- C
    end; z+ I8 r- b9 Q2 t* b, f: e( r
end4 y7 G4 F# Q3 @$ `" I& K
# e: l+ p0 K# |% g4 Y
begin P_induction arriving
: Z$ G7 m0 w, l' j    if A_induct=1 then clone 1 load to P_pick1$ y. N2 b5 L0 [  p3 q! e' A9 |
    else if A_induct=2 then clone 1 load to P_pick2$ E0 k" b8 a. z  J% \" [
        else clone 1 load to P_pick3
7 J! N' D. e, o5 c0 p+ j- y* q4 ]end3 e7 c6 u4 b* ]5 W; I9 x& M
) t& L8 k( F, D0 t  I8 H
begin P_pick1 arriving5 v( u  T$ J# F- D# {- F
    set A_i to 1
- b+ D- N( b- h/ N7 f    move into Q_induct1
2 I& r7 F7 P6 ~* q+ s% J    move into pickaisle.induct17 P5 {# D* y: i7 h( i
    while A_i<=30 do begin, n6 X- P7 S' v" L" l  C
        travel to pickaisle.con(A_i)
( s: J: b5 J3 A& f5 l, f. T* W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ d; u  J0 ~: L0 w        else wait for 10 sec2 d% v  ?7 a- h- z( u/ z( A( z) z( M
        if A_i=A_leave then send to die; ~  M/ L1 `1 d8 C7 y% w- e
        else inc A_i by 1
3 q  n9 @( R1 l, G9 ^, a  F8 K    end
( b) r$ l" f! |2 N, [; `end5 G3 R, i% T* `+ t: a0 J; |; }

. W' J9 B0 K5 x& g5 Mbegin P_pick2 arriving" r# J. k4 [* B9 F/ ?" s: q
    set A_i to 11
8 O1 {' W# [3 t5 V    move into Q_induct2; v+ A; K; B  D5 ~9 t* C. ~# B
    move into pickaisle.induct2
6 g$ }7 E9 n( C' C% W, }    while A_i<=30 do begin1 K: ~* D: k) @9 @- m: ^2 _( @
        travel to pickaisle.con(A_i)
5 ]" V& A2 F  q3 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( b+ W7 m( v$ _0 K9 b3 _  M" q) `        else wait for 10 sec2 C/ a) {% W! c6 a& m
        if A_i=A_leave then send to die* N* C7 a0 @* e
        else inc A_i by 1  f7 e. [/ c2 B0 v' e# z  L9 u
    end7 i/ t3 @1 E3 A' y
end8 g2 p& j% }+ F2 \$ N5 |/ E

; U1 T; X* w5 u; S) Z* c5 c/ y9 x- Vbegin P_pick3 arriving
$ c6 {/ n: _' [: S: Y( c, S    set A_i to 21$ {- b( q3 B$ F2 W2 H2 n4 F
    move into Q_induct3
5 b  d  |* Q4 V" m5 Y( k$ L* k' a' Z    move into pickaisle.induct3
/ w% q" a% V( q3 D    while A_i<=30 do begin& }3 `1 i" V# c0 Q9 `7 q9 v- V
        travel to pickaisle.con(A_i)
: N. p2 T) j- N/ z, _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 f: @  D# s" l- h) k        else wait for 10 sec3 d& i  w6 L" u; ], Z
        if A_i=A_leave then send to die
# F5 X1 h4 ~" `8 [) ]& V9 Z        else inc A_i by 1
  v5 ^# {+ e& {% V  x! e- h5 c    end/ z3 s- m9 I; F9 w2 c- Q- v
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是个什么东东?
& K1 K$ R( @1 x/ ]# M2 [5 T/ C0 xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 l' w* T8 M5 i) q
5 F$ m2 T' Y# i# QAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( K3 J4 J( W# M# x6 ~- L# E# ^. C% |

& q2 _/ y, R. H8 j8 }8 L+ Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' a( S% W/ @" d' }0 Q( x$ s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# }" @; _5 ?# c7 l6 B7 _( c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ m, z0 D% F4 D3 e1 ~" Z0 Y, n4 r* U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- g& }2 r# R( {# y/ X
begin P_induction arriving" z' `1 V1 T7 H* E8 ^- h  b* ^
    clone 1 load to P_pick(A_induct). k- o- `' Z. A& Y' }  a- S
end最大的系
: w; V; n0 R: F# W, s4 c; d: G; D. g
begin P_pick arriving# ~+ K5 ?% N: T6 A' c$ E
    set A_i to procindex * 10 + 1
1 v# s- H3 ]; \' A; {    move into Q_induct(procindex)
# X& X( C) p: \) t, F4 Q/ t    move into pickaisle.induct(procindex)
4 J- X- @! F6 I+ }  `# V    /*check the type of pickaisle.induct(i), for your last problem.*/$ `# D& j( }5 x$ _
6 f; |, z6 B; k7 H% V( O! b
    while A_i<=30 do begin; O. I, z9 X3 q* K( G
        travel to pickaisle.con(A_i)
5 S# I" j  c2 q2 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# j0 _7 Z/ v/ q, H& g        else wait for 10 sec
( i2 B; m! `( Q9 j* H% [        if A_i=A_leave then send to die
5 U2 i2 n% V: k6 M        else inc A_i by 1
  B2 B3 I* m+ b3 q& K. T( }; R  ~    end/ c  O$ ]6 O" [3 `( V
end6 ^7 u" r0 Z7 _% I6 E
6 x% U0 u$ a" R; c- A: Y8 j
其中的procindex为整形,代表当前process的序号。
, s8 `" y+ T( e1 G5 z' _+ X  astation和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-9-20 12:46 , Processed in 0.017248 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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