设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13704|回复: 2

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

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

0 \0 }. L" l! _& z- [' j5 n; e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 Y0 O* h0 ?/ q7 b* ~
8 V9 P% v: e" V5 J* Y* ybegin P_read arriving6 b& \# U# T0 o$ l1 w8 H7 t' Q
    while 1=1 do begin
% U4 I2 g  |* |5 H        read A_tote from "data.txt" with delimiter "\n"
1 U+ ~: O* j/ f5 m5 g3 A$ a6 R+ ~        read A_time from "data.txt" with delimiter "\n"
* b# S9 M, P1 g2 P; {2 Q4 U        read A_leave from "data.txt" with delimiter "\n"0 ]$ S3 ?$ S3 ^  P
        read A_picks from "data.txt" with delimiter "\n"( A2 r  b2 N3 A) G) y' h* ~
        set load type to A_tote
7 m  ^5 t; f6 q0 k3 g" o6 Q* J        if A_tote="tote 1" then set A_induct to 1/ x7 X) w: E$ {, F9 F
        else if A_tote="tote 2" then set A_induct to 2/ X- b  [6 k% f7 y& V5 f
            else set A_induct to 3    " q9 v) X" i& ^3 y) j8 Q1 s* c2 z& ]+ }
        set A_i to 0
. E& _( X2 I3 T5 v4 g        clone 1 load to P_induction
- _% y2 G7 p" V/ I* d        wait for A_time sec
5 k7 E$ i/ l! Q- y8 J    end
/ E' d0 X) w0 wend! |% d3 C( z% a9 y
' b1 s2 N/ z, g& c( ^
begin P_induction arriving  [5 m2 i; z; \+ d9 G$ W
    if A_induct=1 then clone 1 load to P_pick1) {: V% c. z6 x3 V% N
    else if A_induct=2 then clone 1 load to P_pick2. P% `: p' Z6 X5 z' w4 W8 }, s
        else clone 1 load to P_pick3
9 Z5 I& N' w/ n4 m; N& Yend
3 T( f5 d6 |$ d$ e8 [) Q  b* O1 T4 h
begin P_pick1 arriving! F& W- t7 [  [% b$ x
    set A_i to 1
  ^7 v1 @( B7 W' T& Y! ^, \' A" f    move into Q_induct1
! i9 d5 }4 w. D9 |3 j* n6 K) M    move into pickaisle.induct19 q0 {1 R+ n# `' Q
    while A_i<=30 do begin
% Z* v* K& K3 g( I- u7 l        travel to pickaisle.con(A_i)
, ^! ]( l! g, f. h& K1 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 {: R" k2 g" y
        else wait for 10 sec
4 W& n* L' [" @. g. F6 Q6 D+ `, _) t* n        if A_i=A_leave then send to die
! ?( ~8 i3 x' ~% e. ^/ F5 q5 q/ t        else inc A_i by 19 P" j0 k' s" c5 C2 I: D' ^, j
    end$ {, ]6 J5 n) X! t; v' y5 L
end
: ^# a- W" Z: Q) k# X6 |5 R, X! ^/ c4 I7 _
begin P_pick2 arriving
; \0 D2 t9 j) x7 t; q9 x    set A_i to 11
0 A" m" c6 S" ^3 t5 }4 j8 x2 A    move into Q_induct2
& @; I' i. d9 t1 \$ y    move into pickaisle.induct2
, m& v/ V$ l0 q    while A_i<=30 do begin
2 g; F0 E) C& [        travel to pickaisle.con(A_i)
1 p4 B- [9 I% O; k0 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a7 ^' D) g% v& e8 W3 {, i# _; o
        else wait for 10 sec
# n' Z/ h1 L; }6 h8 s; E        if A_i=A_leave then send to die( M6 m. j; A. Z5 [% ]5 Z! c5 l5 d" p  K
        else inc A_i by 1
" a# G4 q8 T: w: e2 z    end
% u4 [& v" l$ V4 s+ F3 F7 gend
& c" q2 x' u- e) Q: S, h* b
  j% t' M" ], Vbegin P_pick3 arriving8 @6 h. c" [% F
    set A_i to 21
0 A3 p2 Y  R( O* W0 s    move into Q_induct3
& C, `: E& i. g4 ^- E  [" W% }3 ]    move into pickaisle.induct3
1 B- z: |0 y* N3 n8 P    while A_i<=30 do begin. C6 {7 Y% G6 a  K( t
        travel to pickaisle.con(A_i)0 y1 Y( D$ |! z, a) [& c- `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?0 V' u+ f5 e$ e# }, t6 G        else wait for 10 sec, b4 l) \* n/ d! t4 v! S/ j1 O
        if A_i=A_leave then send to die# G5 V8 b) O- j: l0 p0 \1 o4 ^9 K
        else inc A_i by 1
) d" e3 H  w$ H( K# B    end
  p& Q; K3 M1 n3 \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是个什么东东?
* E7 C7 J3 @# q6 r. Y0 qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  D7 R; h" L7 _9 t# A9 Y& f: N+ V
" t! \$ F- \2 m* O8 w7 n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 K  J* L+ Y8 c/ u- S2 i6 S, N/ q: b3 K  L7 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! ~& j8 b) _0 l9 f8 C3 J( M5 q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" ]" x# E4 `+ C9 E5 Q# l5 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# a( m( x. v; `; `; c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' U7 V8 _+ n0 d; A* ebegin P_induction arriving% p& |" R8 `: [8 j, }8 U- B
    clone 1 load to P_pick(A_induct)
8 f% ]& P, z0 Q# Zend最大的系" i; m7 h: D0 Q5 e
7 J( @; Q* L0 J9 k) f
begin P_pick arriving
! h* e. q, G1 }; x9 u; Q    set A_i to procindex * 10 + 1
, O7 D5 d! u* a8 f    move into Q_induct(procindex)
; i! p; R3 T8 R, N7 u( x& M6 i    move into pickaisle.induct(procindex)* E- X5 p. d2 S! ]
    /*check the type of pickaisle.induct(i), for your last problem.*/) e: J  M: g0 p& ^- F
5 d7 U% q$ D) c( _9 X
    while A_i<=30 do begin; B+ M/ A% \) S& ?5 A3 v$ N% z1 _
        travel to pickaisle.con(A_i)' |4 Y' ?' T# q% V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. K8 L3 n3 f0 D0 t: m. f) _/ R        else wait for 10 sec) Y+ v0 u3 D% {% Q" t) v) S+ m0 _
        if A_i=A_leave then send to die
3 }: C" Q9 B: @3 s        else inc A_i by 1; \8 ]: p6 d. s0 T" `9 c
    end) A1 p. v3 L) y8 B
end
" D) m/ {4 c2 z  M0 ?2 ]3 ^8 {2 `
5 q6 ^4 d" K: S& T2 Z其中的procindex为整形,代表当前process的序号。
7 a& T% v& ~* vstation和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-4-29 20:46 , Processed in 0.020435 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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