设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14379|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ s" k8 F% d' \6 a2 d3 M% I- r6 F$ v7 t4 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& Y) r! D, [* N$ ^  h. E

, N- s8 Z! x3 T1 g" }begin P_read arriving5 m; C' l) m( e7 |( c
    while 1=1 do begin
, E! Y% _6 \& n! q9 n) U9 J        read A_tote from "data.txt" with delimiter "\n"
" Y0 h- M. J1 W7 T% z  m+ s+ \        read A_time from "data.txt" with delimiter "\n"8 \9 j) \  I% k: \- V
        read A_leave from "data.txt" with delimiter "\n"
* P4 d0 @4 ?, c0 G2 I) b& ]        read A_picks from "data.txt" with delimiter "\n"
. F" q+ j( k, b9 s- v' ~        set load type to A_tote- F  Q2 |1 j) v0 [# W% F
        if A_tote="tote 1" then set A_induct to 11 e% ^4 F* s  i4 |2 g/ c& R' b
        else if A_tote="tote 2" then set A_induct to 2- z9 n/ D3 C) s# K0 D% }; `
            else set A_induct to 3   
9 t8 l  @+ ?, M" p9 \  z; ?) h+ x& w/ n        set A_i to 09 k" g0 A+ W: l: z# t
        clone 1 load to P_induction
+ p& M! M1 w$ l: S        wait for A_time sec- K, J: z* y3 T/ b' O3 N
    end4 v( ?5 k8 ?) }5 n: j9 q
end  B$ c4 P. Q$ A5 v% y
7 N& F( V& R/ F  A( @2 X
begin P_induction arriving& p* U) ?; ^1 m( C1 m" u; o
    if A_induct=1 then clone 1 load to P_pick1, e; Q. K3 g* J* j. {
    else if A_induct=2 then clone 1 load to P_pick2
; M8 U3 h% G6 G1 `. o        else clone 1 load to P_pick3
; l- i+ X0 @2 e! H$ f7 N/ ^end
) M8 S9 I, U( I6 L
5 b5 b9 f+ o. p) `6 R7 C. ^begin P_pick1 arriving+ k4 C5 i) C  j# O4 C$ o: b" ]
    set A_i to 1
7 {! t. z) P3 h/ Q1 K- ~    move into Q_induct1
' R! B' w' e4 {- A5 ~; P, l0 E8 [    move into pickaisle.induct1
( h5 t. r+ m) n+ }% F    while A_i<=30 do begin- g) w% u2 c& y) Y2 Q
        travel to pickaisle.con(A_i)
' _' \5 |, Q  r/ c$ W4 k/ z- R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 c5 h* w; f9 D  H2 c$ {
        else wait for 10 sec
& Y& y* J* w3 F, L        if A_i=A_leave then send to die
) p4 C: c' p0 z$ W: w0 h, u- {        else inc A_i by 1
( W8 v% [9 R* u/ C7 D6 Y4 @0 k    end
* p9 o: b$ A  c) k  Gend
# C6 O' u5 s  Q) R, E$ |2 Y. N- F, D7 P' k
begin P_pick2 arriving8 W1 d( B& u1 \9 O' m; V$ x
    set A_i to 117 n% P5 N! L. m$ R5 a' O
    move into Q_induct2
0 M7 s/ {& u' N    move into pickaisle.induct2
! W4 y% k6 v- V( r    while A_i<=30 do begin
1 O. y, k  |( v% `; w+ l        travel to pickaisle.con(A_i). g1 g) B6 e. e+ M1 L% C( y' Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z" f( k( l5 a- @$ _5 t- H/ N
        else wait for 10 sec; n" [& U. K; ^6 N8 p6 K+ t
        if A_i=A_leave then send to die
* ^2 r1 W" Y$ O  T3 D4 Z/ K7 m0 l        else inc A_i by 1( A8 R% L; ~4 C2 N
    end& y' Z6 Y7 K: Z' `
end
8 k2 C3 X( k$ u0 f
* \9 Z. c" Q7 H1 Y! L! h6 vbegin P_pick3 arriving. ~9 t" g" F7 U3 h
    set A_i to 218 O' {) K; c1 m: Z  b7 x
    move into Q_induct3
2 Q5 T: I$ B( C4 t( H# }! i% Q    move into pickaisle.induct3
) t& P; t& j0 d  ?! D1 }    while A_i<=30 do begin' g) e3 \/ r0 X3 |: |# g
        travel to pickaisle.con(A_i)! F, ]; [0 ]( w. F, ?5 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; C/ Z* I, `2 }" O4 `! P        else wait for 10 sec
% a: J$ g* L8 s" T2 |        if A_i=A_leave then send to die
7 ^" w% \" `% |9 c1 C/ y7 w        else inc A_i by 1
; s: K- `% ?  D" a    end
  g- _, f0 |1 ~+ T0 mend

最佳答案

查看完整内容

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是个什么东东?8 g; U0 \. o; b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 e3 ^" n. x% V

* I: E4 v1 M; E9 c/ ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 W! o  L! g! x2 `9 c- c9 c7 k' ~, f  g( n% u) P6 [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 _6 D) W1 r% z! C2 f; _" i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 _9 o7 d5 I5 d$ a( v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! J) U# S1 Z2 I3 ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 N4 s: t. M6 D0 V8 K( ^4 Ibegin P_induction arriving8 R" C% j  m# F' _: Y
    clone 1 load to P_pick(A_induct)/ V) M9 j- x' U' f& d
end最大的系( {2 Y/ b# ~# `* X
0 `' {' c) |+ f/ k. x$ P; `
begin P_pick arriving
! p0 R4 s5 V% A. U' P  e    set A_i to procindex * 10 + 1
! t9 V4 }+ v7 w4 n$ ^    move into Q_induct(procindex)$ `! h( L2 t& _1 Z5 j. v
    move into pickaisle.induct(procindex)
5 e* K1 {! y; y+ n' A    /*check the type of pickaisle.induct(i), for your last problem.*/
' |4 w9 }. Q" n; i1 S" e8 j# p' X, {1 ]7 b. ]) s+ R- K
    while A_i<=30 do begin
& Z7 L  T+ |$ _' c. X% X- L        travel to pickaisle.con(A_i): n0 ~* h4 q4 f. `2 g7 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Q# o1 i0 T1 T- C
        else wait for 10 sec
9 @; A& Y6 u8 D/ |7 J        if A_i=A_leave then send to die. {0 J2 S* T4 c. ~4 F5 k
        else inc A_i by 1$ b" ~# W  ?, }$ M1 t4 W/ u6 h
    end
$ f9 w) l8 K$ v8 p" q9 w. tend1 o3 G" Z+ L; s
+ ^: k6 l* _( h3 y- _* p, P
其中的procindex为整形,代表当前process的序号。% [5 p+ O1 B! W* G
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-7-8 21:00 , Processed in 0.014593 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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