设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12643|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) N  G9 [6 Q/ {$ K. W, r9 ?
% n2 e. ~& G4 N% N: P) A. J
我的问题是,在每个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 D1 E- h1 y% a$ v( m- `1 {
' E1 D$ S( e# {2 C  l, q. L' Cbegin P_read arriving  s: V4 ^8 Y( I, g1 ^
    while 1=1 do begin, u8 I% b- o+ M) g
        read A_tote from "data.txt" with delimiter "\n"+ k7 d; a9 w  o! k9 Z7 {+ C
        read A_time from "data.txt" with delimiter "\n"0 Y# z: _$ ]7 X5 e( ^; e
        read A_leave from "data.txt" with delimiter "\n": X# ]& h. i) }# W
        read A_picks from "data.txt" with delimiter "\n"
9 V, S$ L5 e- {$ d  N' A  v0 b7 m        set load type to A_tote
6 h4 Z! m6 R! ]) p+ K. V        if A_tote="tote 1" then set A_induct to 15 i% R8 E$ g, Y) }; C
        else if A_tote="tote 2" then set A_induct to 2
1 ^" d. _, f9 l8 d            else set A_induct to 3    0 M+ @9 a, q! ~
        set A_i to 0) h; W2 f; a, N% X! G  o
        clone 1 load to P_induction  z9 a/ Z% ]' g; t6 D- l8 ^
        wait for A_time sec
. Q5 q6 S8 h" v5 n6 f0 A9 `, x    end, P/ N. G4 b( k, t
end
5 ^5 B7 x5 f' Q& [+ b$ _* ~# U- h- y! B
begin P_induction arriving
% P& a4 {. [6 k  L' S7 A    if A_induct=1 then clone 1 load to P_pick1
6 _/ p8 a6 D% P    else if A_induct=2 then clone 1 load to P_pick2
9 c( ^" R! g& Z- C3 n; ]+ ?        else clone 1 load to P_pick3+ J( a* X& ~  j; w7 A& f1 y
end
5 k* f- S/ R3 y- Y3 u8 Q
6 t  L$ _2 x$ g0 E* Bbegin P_pick1 arriving; l; m9 M5 M: a
    set A_i to 1
4 V! \; O1 m) a4 C5 |+ [    move into Q_induct1
* }9 M) ?9 P1 n3 E    move into pickaisle.induct10 @% d" o: I6 R
    while A_i<=30 do begin
, @" A& Y, `: {3 F& V+ ~6 B  U        travel to pickaisle.con(A_i)' ]5 J* @" f) e8 x9 l" M. e; \6 c) N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& S, j# _5 c  w
        else wait for 10 sec3 Y1 k9 R8 X4 J- U) L5 }; g
        if A_i=A_leave then send to die
; \: ^+ L! B" y# a# ?( I5 }        else inc A_i by 1
+ t. V" \$ ~; Z8 \    end- Y* B* y3 O+ d" U2 [, m3 c
end' \/ z4 Y& i( i6 Q9 w7 R" ?

: k6 ]5 @/ t& y  L  J9 H3 C# o+ ?begin P_pick2 arriving" t% b7 O) D( X: y# E
    set A_i to 11
# G: ]5 v0 B& c; F  Y, y2 b6 b. h    move into Q_induct2) q& s2 P1 t6 A$ n9 E' O
    move into pickaisle.induct27 l1 [/ v$ ^; {2 V( Q. x
    while A_i<=30 do begin
; m! w. v5 l+ ?: u  T# i: L        travel to pickaisle.con(A_i)0 I0 {" S& p1 c% p+ M2 J% Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& V+ _7 X1 R, u" X1 P" _        else wait for 10 sec
4 R+ _  v) k% P. K6 K9 V        if A_i=A_leave then send to die
. O" m; S4 r' o        else inc A_i by 12 K1 ?7 E! k; X( S: N1 J4 p
    end# h' W1 `- U- p8 H; S% z- m
end2 o( M% W3 N. G) w% n

0 q) M5 F7 O9 Z5 O; ]begin P_pick3 arriving0 @2 b2 z& E4 v9 Y! e) j9 P
    set A_i to 21
! I1 Z/ r+ Q0 B4 T    move into Q_induct3- ]$ v4 {/ W* H( F1 L
    move into pickaisle.induct3' b' u9 S. N' n4 F* |/ \- @/ y' d# o
    while A_i<=30 do begin4 M: E- F! c$ h7 ?. p6 l& D% K
        travel to pickaisle.con(A_i)
5 R& M8 z4 j! s5 B0 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) y7 o9 ?2 T& m% n$ \, }' ^+ V: v. t
        else wait for 10 sec
3 q. r: N- c' g9 x0 N        if A_i=A_leave then send to die6 H; H3 M+ ~; T/ h" {/ \
        else inc A_i by 1: t& V5 k" j+ J- s. d! k: R
    end
7 f' \& t5 k5 N* Y) l' Y* R3 N' {* X1 Gend

最佳答案

查看完整内容

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是个什么东东?% U/ J% l9 B+ }7 g3 f, Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ g9 s/ {8 t4 [. R5 i+ |' \
$ u: J5 d9 Z7 h7 T& L- Q$ M& \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 k, y+ C. B& |$ H
1 {% q' }! a8 e. t0 J2 J1 E' `# P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 ~  F2 l! R3 W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! _$ |+ D6 v( r( H  \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. }8 S; v/ G7 g: X5 d7 M0 n9 V8 f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ E' N2 v; C" \7 X, P4 m  C
begin P_induction arriving4 F+ n, B- N( c9 h2 s1 j- C: o
    clone 1 load to P_pick(A_induct)
2 w6 N0 j% i5 N% R: dend最大的系
, ]/ g. {3 f9 f$ B& Y
6 u; b3 e! y1 N8 R$ v7 Hbegin P_pick arriving% n" [- i1 r. u7 D" J4 F6 k: L$ N
    set A_i to procindex * 10 + 18 J# M+ H  o, a
    move into Q_induct(procindex)
* _. o, E3 V, L  M    move into pickaisle.induct(procindex). e6 K3 c3 B( s( `" i$ K
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 T& Z/ F7 U& N3 v, ~* X2 D' J' T! E4 N" Y
    while A_i<=30 do begin: ^% ^/ {% c& k  `& e* ^
        travel to pickaisle.con(A_i)
/ p7 O0 T% C9 h+ D5 e4 Z! z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. l9 z  J- Q6 G        else wait for 10 sec2 h9 L6 W- h2 R2 ^
        if A_i=A_leave then send to die
$ |7 n4 W) l+ Y8 w, m0 W3 D: {        else inc A_i by 1
3 W8 W& h9 }% _$ X! y    end
. Z0 p/ g  Q: g" }3 [" Y1 P( `: Bend
/ h) y: A, J, M% n; N2 Y$ z; ?3 {, A
其中的procindex为整形,代表当前process的序号。+ g, ~3 X1 V6 ?; N/ ]  k; `
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-2-7 07:43 , Processed in 0.019412 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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