设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13932|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ]! U8 y1 F% v' n

" U; Y" ]/ K' i+ S# y& S8 G, w我的问题是,在每个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中的数值,不知道会不会有什么不妥。, D+ a" i8 h! N

# L% e1 g, l5 g/ P1 f1 j8 Ebegin P_read arriving
+ j) j; j* T) l$ b: p    while 1=1 do begin
3 o4 y  g2 y) W0 W1 _; ^- |0 G        read A_tote from "data.txt" with delimiter "\n"
; R0 q7 R' a$ E" J$ o# ~: T; [        read A_time from "data.txt" with delimiter "\n"7 q+ _3 Y5 m1 n5 h* z1 w- W9 v
        read A_leave from "data.txt" with delimiter "\n"& ~" n# G& n$ \( Y  H- B
        read A_picks from "data.txt" with delimiter "\n"6 N+ p# _: C% d
        set load type to A_tote
2 G; ]/ f% j1 |$ W' @; s$ \7 @        if A_tote="tote 1" then set A_induct to 1
* G2 L2 F+ O: B        else if A_tote="tote 2" then set A_induct to 2
+ u9 O( B1 n" }# O% D. Q* f8 @            else set A_induct to 3    % `" Y- s7 [. \6 z, ~4 d
        set A_i to 0. o. z8 h. c7 C8 a$ X) w2 I4 O  z
        clone 1 load to P_induction
' y. L( l# q  ]9 B  o% E. |8 {        wait for A_time sec1 \! t5 @, r5 ?* L! W- Q
    end
: y. ^* i0 p7 lend! s% O: M  @5 Z6 D& P1 C
* U. v* t) Z1 W* O
begin P_induction arriving4 {* R3 O6 L  I) S* r" W
    if A_induct=1 then clone 1 load to P_pick1
/ e7 i  {: A1 J' ~) r: i    else if A_induct=2 then clone 1 load to P_pick2( z8 j$ ]7 n' M, Z' ]
        else clone 1 load to P_pick3: o$ V) u5 O9 i
end9 z& F( g! ^% y% t  j& L

# B7 E- U# O0 P4 ebegin P_pick1 arriving
; l3 H# `/ [1 t$ R- N    set A_i to 1) C( J9 o9 {7 Q* e0 m7 a4 l8 a
    move into Q_induct1/ M6 W! T* g5 L4 T  o
    move into pickaisle.induct1
& X  G+ k3 J2 S3 x6 \  Y    while A_i<=30 do begin% ]. y, j/ s+ z$ Y# f# S" t% F
        travel to pickaisle.con(A_i)
" f' N" @6 l2 `0 y/ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ i) i$ o+ I# Z( [( ]$ h- a
        else wait for 10 sec& ^5 u) o+ ~. ~. u, w/ Y' [
        if A_i=A_leave then send to die
4 J1 |* p8 S# z; i* C( F5 u. G        else inc A_i by 19 {/ ~- s8 J% y0 o% R9 D1 `; F
    end) a0 `' S2 I  L" U2 U
end% u- o  o5 L& F+ T: p

9 m- _8 D" r! H  M1 h0 ~begin P_pick2 arriving
& Z! c$ f$ Q3 K+ g- I" Q    set A_i to 11
1 G* V* Q, g) ?( O5 J1 s3 J( s    move into Q_induct28 `0 ~  v+ y; Y4 G+ q  c
    move into pickaisle.induct25 h  N( S7 Y! o+ ~
    while A_i<=30 do begin
" ]' U4 L: A; d+ S' J- A/ M        travel to pickaisle.con(A_i)) N' n9 s1 R  D! s" R; t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. `+ ~/ a6 \, F. s5 P
        else wait for 10 sec. ^! e) T$ i: g0 L' ?/ W
        if A_i=A_leave then send to die8 l( l1 Q! W4 j
        else inc A_i by 1
; Q. H; B6 ]) |. S4 m6 q    end: X/ y+ a" o1 r, l& z9 u2 \
end+ i0 l1 Z8 v; w, Z
6 ?) X) _# _* |' F2 X
begin P_pick3 arriving
7 w! E6 A; n" _$ o/ i) [, }/ C    set A_i to 21/ N- p! \6 ]3 a0 ?. z% l' e! ]
    move into Q_induct3
2 P( K: D% i9 E8 K    move into pickaisle.induct3
0 U: c& l# t* J    while A_i<=30 do begin
; Y" E) O* P5 e, f% P3 y        travel to pickaisle.con(A_i); a, S; }, ]- \  D4 a. y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! T! S4 g) w" B7 G, L$ N
        else wait for 10 sec
" e8 O3 v, e! j, k% Q        if A_i=A_leave then send to die
+ l1 P! Z: s3 V& r& S! n& V        else inc A_i by 1' p# P+ g2 D* R0 \) ]
    end
; {! Q  _* a1 |; k4 jend

最佳答案

查看完整内容

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是个什么东东?
% w# J: Y* D6 @4 G" mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 Y8 `, T5 }' n7 E, y  U: L# T7 a; G4 |9 X9 U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ @! q3 \' C' O. a5 I

9 }) H# s) L( U4 L; _; S另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ b5 Q1 [1 J6 x/ m% j0 V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 w* |6 e& T; u7 E+ Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) m* M! F4 Q. j5 U" ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% k0 t0 I/ [& V+ s
begin P_induction arriving  u3 q' n$ H" x, N: a
    clone 1 load to P_pick(A_induct)1 M& n& i+ v! z8 {1 N' A# k! p6 [7 G
end最大的系% g' e! }$ ~8 K) U# u

+ m3 C* D3 E8 J+ M  I. O9 p, G3 H6 Y; Ebegin P_pick arriving
9 k3 G% ~6 K1 s& }    set A_i to procindex * 10 + 1* I4 J3 l2 P( y9 q
    move into Q_induct(procindex)9 B% O! S% `: z* r
    move into pickaisle.induct(procindex)+ l( C& E) [( y
    /*check the type of pickaisle.induct(i), for your last problem.*/5 X6 x4 u  U+ }+ `( j/ b% n; V3 C* G

. C5 g  u$ V2 X7 E# Y+ X    while A_i<=30 do begin
/ D1 ?8 G1 a4 k3 k/ m        travel to pickaisle.con(A_i), c& [& R5 \% G( e/ x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# |! a' W$ e6 T' i; r; _% M        else wait for 10 sec
+ l4 p  ^3 S9 x1 U4 N        if A_i=A_leave then send to die
/ U8 E% o+ x9 K. O% y        else inc A_i by 1
( e" B3 w# {$ A. B0 N    end5 a) z0 Z- x5 _, S
end8 d( M- {' |, V7 B
: c* y0 D+ n, i& O
其中的procindex为整形,代表当前process的序号。. y" D9 S( f7 m; @
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 11:05 , Processed in 0.013658 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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